From: David S. Miller Date: Tue, 31 Mar 2015 16:01:21 +0000 (-0400) Subject: Merge branch 'ptp-2038' X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=32eaf120e66b1763626ed564adf1e42e69da82f4;p=linux-beck.git Merge branch 'ptp-2038' 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 --- 32eaf120e66b1763626ed564adf1e42e69da82f4 diff --cc drivers/net/ethernet/intel/e1000e/ptp.c index 1490f1e8d6aa,b747a3e8aec0..6fedc2c327dd --- a/drivers/net/ethernet/intel/e1000e/ptp.c +++ b/drivers/net/ethernet/intel/e1000e/ptp.c @@@ -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); diff --cc drivers/net/ethernet/intel/igb/igb_ptp.c index 52d01b8b01ed,0348b7e96709..c4894fb5c1d2 --- a/drivers/net/ethernet/intel/igb/igb_ptp.c +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c @@@ -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);