diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/ethernet/sfc/ptp.c | 30 | ||||
| -rw-r--r-- | drivers/pps/kapi.c | 4 |
2 files changed, 17 insertions, 17 deletions
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c index ad62615a93dc..c771e0af4e06 100644 --- a/drivers/net/ethernet/sfc/ptp.c +++ b/drivers/net/ethernet/sfc/ptp.c | |||
| @@ -401,8 +401,8 @@ size_t efx_ptp_update_stats(struct efx_nic *efx, u64 *stats) | |||
| 401 | /* For Siena platforms NIC time is s and ns */ | 401 | /* For Siena platforms NIC time is s and ns */ |
| 402 | static void efx_ptp_ns_to_s_ns(s64 ns, u32 *nic_major, u32 *nic_minor) | 402 | static void efx_ptp_ns_to_s_ns(s64 ns, u32 *nic_major, u32 *nic_minor) |
| 403 | { | 403 | { |
| 404 | struct timespec ts = ns_to_timespec(ns); | 404 | struct timespec64 ts = ns_to_timespec64(ns); |
| 405 | *nic_major = ts.tv_sec; | 405 | *nic_major = (u32)ts.tv_sec; |
| 406 | *nic_minor = ts.tv_nsec; | 406 | *nic_minor = ts.tv_nsec; |
| 407 | } | 407 | } |
| 408 | 408 | ||
| @@ -431,8 +431,8 @@ static ktime_t efx_ptp_s_ns_to_ktime_correction(u32 nic_major, u32 nic_minor, | |||
| 431 | */ | 431 | */ |
| 432 | static void efx_ptp_ns_to_s27(s64 ns, u32 *nic_major, u32 *nic_minor) | 432 | static void efx_ptp_ns_to_s27(s64 ns, u32 *nic_major, u32 *nic_minor) |
| 433 | { | 433 | { |
| 434 | struct timespec ts = ns_to_timespec(ns); | 434 | struct timespec64 ts = ns_to_timespec64(ns); |
| 435 | u32 maj = ts.tv_sec; | 435 | u32 maj = (u32)ts.tv_sec; |
| 436 | u32 min = (u32)(((u64)ts.tv_nsec * NS_TO_S27_MULT + | 436 | u32 min = (u32)(((u64)ts.tv_nsec * NS_TO_S27_MULT + |
| 437 | (1ULL << (NS_TO_S27_SHIFT - 1))) >> NS_TO_S27_SHIFT); | 437 | (1ULL << (NS_TO_S27_SHIFT - 1))) >> NS_TO_S27_SHIFT); |
| 438 | 438 | ||
| @@ -646,28 +646,28 @@ static void efx_ptp_send_times(struct efx_nic *efx, | |||
| 646 | struct pps_event_time *last_time) | 646 | struct pps_event_time *last_time) |
| 647 | { | 647 | { |
| 648 | struct pps_event_time now; | 648 | struct pps_event_time now; |
| 649 | struct timespec limit; | 649 | struct timespec64 limit; |
| 650 | struct efx_ptp_data *ptp = efx->ptp_data; | 650 | struct efx_ptp_data *ptp = efx->ptp_data; |
| 651 | struct timespec start; | 651 | struct timespec64 start; |
| 652 | int *mc_running = ptp->start.addr; | 652 | int *mc_running = ptp->start.addr; |
| 653 | 653 | ||
| 654 | pps_get_ts(&now); | 654 | pps_get_ts(&now); |
| 655 | start = now.ts_real; | 655 | start = now.ts_real; |
| 656 | limit = now.ts_real; | 656 | limit = now.ts_real; |
| 657 | timespec_add_ns(&limit, SYNCHRONISE_PERIOD_NS); | 657 | timespec64_add_ns(&limit, SYNCHRONISE_PERIOD_NS); |
| 658 | 658 | ||
| 659 | /* Write host time for specified period or until MC is done */ | 659 | /* Write host time for specified period or until MC is done */ |
| 660 | while ((timespec_compare(&now.ts_real, &limit) < 0) && | 660 | while ((timespec64_compare(&now.ts_real, &limit) < 0) && |
| 661 | ACCESS_ONCE(*mc_running)) { | 661 | ACCESS_ONCE(*mc_running)) { |
| 662 | struct timespec update_time; | 662 | struct timespec64 update_time; |
| 663 | unsigned int host_time; | 663 | unsigned int host_time; |
| 664 | 664 | ||
| 665 | /* Don't update continuously to avoid saturating the PCIe bus */ | 665 | /* Don't update continuously to avoid saturating the PCIe bus */ |
| 666 | update_time = now.ts_real; | 666 | update_time = now.ts_real; |
| 667 | timespec_add_ns(&update_time, SYNCHRONISATION_GRANULARITY_NS); | 667 | timespec64_add_ns(&update_time, SYNCHRONISATION_GRANULARITY_NS); |
| 668 | do { | 668 | do { |
| 669 | pps_get_ts(&now); | 669 | pps_get_ts(&now); |
| 670 | } while ((timespec_compare(&now.ts_real, &update_time) < 0) && | 670 | } while ((timespec64_compare(&now.ts_real, &update_time) < 0) && |
| 671 | ACCESS_ONCE(*mc_running)); | 671 | ACCESS_ONCE(*mc_running)); |
| 672 | 672 | ||
| 673 | /* Synchronise NIC with single word of time only */ | 673 | /* Synchronise NIC with single word of time only */ |
| @@ -723,7 +723,7 @@ efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf), | |||
| 723 | struct efx_ptp_data *ptp = efx->ptp_data; | 723 | struct efx_ptp_data *ptp = efx->ptp_data; |
| 724 | u32 last_sec; | 724 | u32 last_sec; |
| 725 | u32 start_sec; | 725 | u32 start_sec; |
| 726 | struct timespec delta; | 726 | struct timespec64 delta; |
| 727 | ktime_t mc_time; | 727 | ktime_t mc_time; |
| 728 | 728 | ||
| 729 | if (number_readings == 0) | 729 | if (number_readings == 0) |
| @@ -737,14 +737,14 @@ efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf), | |||
| 737 | */ | 737 | */ |
| 738 | for (i = 0; i < number_readings; i++) { | 738 | for (i = 0; i < number_readings; i++) { |
| 739 | s32 window, corrected; | 739 | s32 window, corrected; |
| 740 | struct timespec wait; | 740 | struct timespec64 wait; |
| 741 | 741 | ||
| 742 | efx_ptp_read_timeset( | 742 | efx_ptp_read_timeset( |
| 743 | MCDI_ARRAY_STRUCT_PTR(synch_buf, | 743 | MCDI_ARRAY_STRUCT_PTR(synch_buf, |
| 744 | PTP_OUT_SYNCHRONIZE_TIMESET, i), | 744 | PTP_OUT_SYNCHRONIZE_TIMESET, i), |
| 745 | &ptp->timeset[i]); | 745 | &ptp->timeset[i]); |
| 746 | 746 | ||
| 747 | wait = ktime_to_timespec( | 747 | wait = ktime_to_timespec64( |
| 748 | ptp->nic_to_kernel_time(0, ptp->timeset[i].wait, 0)); | 748 | ptp->nic_to_kernel_time(0, ptp->timeset[i].wait, 0)); |
| 749 | window = ptp->timeset[i].window; | 749 | window = ptp->timeset[i].window; |
| 750 | corrected = window - wait.tv_nsec; | 750 | corrected = window - wait.tv_nsec; |
| @@ -803,7 +803,7 @@ efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf), | |||
| 803 | ptp->timeset[last_good].minor, 0); | 803 | ptp->timeset[last_good].minor, 0); |
| 804 | 804 | ||
| 805 | /* Calculate delay from NIC top of second to last_time */ | 805 | /* Calculate delay from NIC top of second to last_time */ |
| 806 | delta.tv_nsec += ktime_to_timespec(mc_time).tv_nsec; | 806 | delta.tv_nsec += ktime_to_timespec64(mc_time).tv_nsec; |
| 807 | 807 | ||
| 808 | /* Set PPS timestamp to match NIC top of second */ | 808 | /* Set PPS timestamp to match NIC top of second */ |
| 809 | ptp->host_time_pps = *last_time; | 809 | ptp->host_time_pps = *last_time; |
diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c index cdad4d95b20e..805c749ac1ad 100644 --- a/drivers/pps/kapi.c +++ b/drivers/pps/kapi.c | |||
| @@ -179,8 +179,8 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event, | |||
| 179 | /* check event type */ | 179 | /* check event type */ |
| 180 | BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0); | 180 | BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0); |
| 181 | 181 | ||
| 182 | dev_dbg(pps->dev, "PPS event at %ld.%09ld\n", | 182 | dev_dbg(pps->dev, "PPS event at %lld.%09ld\n", |
| 183 | ts->ts_real.tv_sec, ts->ts_real.tv_nsec); | 183 | (s64)ts->ts_real.tv_sec, ts->ts_real.tv_nsec); |
| 184 | 184 | ||
| 185 | timespec_to_pps_ktime(&ts_real, ts->ts_real); | 185 | timespec_to_pps_ktime(&ts_real, ts->ts_real); |
| 186 | 186 | ||
