Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85c4859b authored by Eran Ben Elisha's avatar Eran Ben Elisha Committed by Greg Kroah-Hartman
Browse files

net/mlx5: Don't call timecounter cyc2time directly from 1PPS flow



[ Upstream commit 0d2ffdc8d4002a62de31ff7aa3bef28c843c3cbe ]

Before calling timecounter_cyc2time(), clock->lock must be taken.
Use mlx5_timecounter_cyc2time instead which guarantees a safe access.

Fixes: afc98a0b ("net/mlx5: Update ptp_clock_event foreach PPS event")
Signed-off-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 556ce4cb
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -475,7 +475,8 @@ void mlx5_pps_event(struct mlx5_core_dev *mdev,
	switch (clock->ptp_info.pin_config[pin].func) {
	case PTP_PF_EXTTS:
		ptp_event.index = pin;
		ptp_event.timestamp = timecounter_cyc2time(&clock->tc,
		ptp_event.timestamp =
			mlx5_timecounter_cyc2time(clock,
						  be64_to_cpu(eqe->data.pps.time_stamp));
		if (clock->pps_info.enabled) {
			ptp_event.type = PTP_CLOCK_PPSUSR;