aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFeras Daoud <ferasda@mellanox.com>2018-01-03 10:23:55 -0500
committerSaeed Mahameed <saeedm@mellanox.com>2018-01-11 19:01:50 -0500
commitafc98a0b46d8576a55f18092400cc518d03a79a1 (patch)
treece480909cdd34a1907b208c1ebdd70fa121d298f
parent75b81ce719b79565eb0b39aa9954b6e11a5e73bf (diff)
net/mlx5: Update ptp_clock_event foreach PPS event
PPS event did not update ptp_clock_event fields, therefore, timestamp value was not updated correctly. This fix updates the event source and the timestamp value for each PPS event. Fixes: 7c39afb394c7 ("net/mlx5: PTP code migration to driver core section") Signed-off-by: Feras Daoud <ferasda@mellanox.com> Reported-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
index fa8aed62b231..5701f125e99c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
@@ -423,9 +423,13 @@ void mlx5_pps_event(struct mlx5_core_dev *mdev,
423 423
424 switch (clock->ptp_info.pin_config[pin].func) { 424 switch (clock->ptp_info.pin_config[pin].func) {
425 case PTP_PF_EXTTS: 425 case PTP_PF_EXTTS:
426 ptp_event.index = pin;
427 ptp_event.timestamp = timecounter_cyc2time(&clock->tc,
428 be64_to_cpu(eqe->data.pps.time_stamp));
426 if (clock->pps_info.enabled) { 429 if (clock->pps_info.enabled) {
427 ptp_event.type = PTP_CLOCK_PPSUSR; 430 ptp_event.type = PTP_CLOCK_PPSUSR;
428 ptp_event.pps_times.ts_real = ns_to_timespec64(eqe->data.pps.time_stamp); 431 ptp_event.pps_times.ts_real =
432 ns_to_timespec64(ptp_event.timestamp);
429 } else { 433 } else {
430 ptp_event.type = PTP_CLOCK_EXTTS; 434 ptp_event.type = PTP_CLOCK_EXTTS;
431 } 435 }