summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/e1000e/ptp.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-03-31 12:01:21 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-31 12:33:27 -0400
commit32eaf120e66b1763626ed564adf1e42e69da82f4 (patch)
treef22ecbd443cfe9448523e8e637353e771c3b1a5e /drivers/net/ethernet/intel/e1000e/ptp.c
parentd482994fca82380912b3a80201b74d5118ff0487 (diff)
parented7c6317bc599502e1fdc7f5f95cb9a5550360a4 (diff)
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 <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/e1000e/ptp.c')
-rw-r--r--drivers/net/ethernet/intel/e1000e/ptp.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c
index 1490f1e8d6aa..6fedc2c327dd 100644
--- a/drivers/net/ethernet/intel/e1000e/ptp.c
+++ b/drivers/net/ethernet/intel/e1000e/ptp.c
@@ -106,7 +106,7 @@ static int e1000e_phc_adjtime(struct ptp_clock_info *ptp, s64 delta)
* Read the timecounter and return the correct value in ns after converting
* it into a struct timespec.
**/
-static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
{
struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter,
ptp_clock_info);
@@ -133,14 +133,14 @@ static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
* wall timer value.
**/
static int e1000e_phc_settime(struct ptp_clock_info *ptp,
- const struct timespec *ts)
+ const struct timespec64 *ts)
{
struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter,
ptp_clock_info);
unsigned long flags;
u64 ns;
- ns = timespec_to_ns(ts);
+ ns = timespec64_to_ns(ts);
/* reset the timecounter */
spin_lock_irqsave(&adapter->systim_lock, flags);
@@ -171,11 +171,12 @@ static void e1000e_systim_overflow_work(struct work_struct *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",
+ (long long) ts.tv_sec, ts.tv_nsec);
schedule_delayed_work(&adapter->systim_overflow_work,
E1000_SYSTIM_OVERFLOW_PERIOD);
@@ -190,8 +191,8 @@ static const struct ptp_clock_info e1000e_ptp_clock_info = {
.pps = 0,
.adjfreq = e1000e_phc_adjfreq,
.adjtime = e1000e_phc_adjtime,
- .gettime = e1000e_phc_gettime,
- .settime = e1000e_phc_settime,
+ .gettime64 = e1000e_phc_gettime,
+ .settime64 = e1000e_phc_settime,
.enable = e1000e_phc_enable,
};