Merge branch 'ptp-2038'
authorDavid S. Miller <davem@davemloft.net>
Tue, 31 Mar 2015 16:01:21 +0000 (12:01 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Mar 2015 16:33:27 +0000 (12:33 -0400)
Fixed two warnings in e1000e and igb, when switching to timespec64
some printf formats started to not match.  In theses cases actually
the new type is __kernel_time_t which is __kernel_long_t which
unfortunately can be either "long" or "long long".  So to solve
this I cases the arguments to "long long".  -DaveM

Richard Cochran says:

====================
ptp: get ready for 2038

This series converts the core driver methods of the PTP Hardware Clock
(PHC) subsystem to use the 64 bit version of the timespec structure,
making the core API ready for the year 2038.

In addition, I reviewed how each driver and device represents the time
value at the hardware register level.  Most of the drivers are ready,
but a few will need some work before the year 2038, as shown:

   Patch   Driver
   ------------------------------------------------
   12      drivers/net/ethernet/intel/igb/igb_ptp.c
   15 ?    drivers/net/ethernet/sfc/ptp.c
   16      drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c

The commit log messages document how each driver is ready or why it is
not ready.  For patch 15, I could not easily find out the hardware
representation of the time value, and so the SFC maintainers will have
to review their low level code in order to resolve any remaining
issues.

* ChangeLog
** V3
   - dp83640: use timespec64 throughout per Arnd's suggestion
   - tilegx: use timespec64 throughout per Chris' suggestion
   - add Jeff's acked-bys
** V2
   - use the new methods in the posix clock code right away (patch #3)
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
1  2 
drivers/net/ethernet/intel/e1000e/ptp.c
drivers/net/ethernet/intel/igb/igb_ptp.c

index 1490f1e8d6aa19c9ca0c26bcdf9d87796d4f329f,b747a3e8aec0bc1c17fc629b3d22c0249cafbd72..6fedc2c327ddc622d28fdee10d4c94b7564bdabe
@@@ -171,11 -171,11 +171,12 @@@ static void e1000e_systim_overflow_work
        struct e1000_adapter *adapter = container_of(work, struct e1000_adapter,
                                                     systim_overflow_work.work);
        struct e1000_hw *hw = &adapter->hw;
-       struct timespec ts;
+       struct timespec64 ts;
  
-       adapter->ptp_clock_info.gettime(&adapter->ptp_clock_info, &ts);
+       adapter->ptp_clock_info.gettime64(&adapter->ptp_clock_info, &ts);
  
-       e_dbg("SYSTIM overflow check at %ld.%09lu\n", ts.tv_sec, ts.tv_nsec);
 -      e_dbg("SYSTIM overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);
++      e_dbg("SYSTIM overflow check at %lld.%09lu\n",
++            (long long) ts.tv_sec, ts.tv_nsec);
  
        schedule_delayed_work(&adapter->systim_overflow_work,
                              E1000_SYSTIM_OVERFLOW_PERIOD);
index 52d01b8b01edb64eb148f0a861b1d59ff3262084,0348b7e96709b8359883705a7bc45f1c33cab0f2..c4894fb5c1d2d3eab0c4c8e0dadd5cafaea5d0c0
@@@ -627,11 -628,11 +628,12 @@@ static void igb_ptp_overflow_check(stru
  {
        struct igb_adapter *igb =
                container_of(work, struct igb_adapter, ptp_overflow_work.work);
-       struct timespec ts;
+       struct timespec64 ts;
  
-       igb->ptp_caps.gettime(&igb->ptp_caps, &ts);
+       igb->ptp_caps.gettime64(&igb->ptp_caps, &ts);
  
-       pr_debug("igb overflow check at %ld.%09lu\n", ts.tv_sec, ts.tv_nsec);
 -      pr_debug("igb overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);
++      pr_debug("igb overflow check at %lld.%09lu\n",
++               (long long) ts.tv_sec, ts.tv_nsec);
  
        schedule_delayed_work(&igb->ptp_overflow_work,
                              IGB_SYSTIM_OVERFLOW_PERIOD);