提交 021e6209 编写于 作者: E Eran Ben Elisha 提交者: Yang Yingliang

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

stable inclusion
from linux-4.19.153
commit 85c4859b4f54d4469b1dcf411104cc40243c8c05

--------------------------------

[ Upstream commit 0d2ffdc8 ]

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: NEran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NAichun Li <liaichun@huawei.com>
Reviewed-by: Nwangxiaopeng <wangxiaopeng7@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 2c84d986
...@@ -475,8 +475,9 @@ void mlx5_pps_event(struct mlx5_core_dev *mdev, ...@@ -475,8 +475,9 @@ void mlx5_pps_event(struct mlx5_core_dev *mdev,
switch (clock->ptp_info.pin_config[pin].func) { switch (clock->ptp_info.pin_config[pin].func) {
case PTP_PF_EXTTS: case PTP_PF_EXTTS:
ptp_event.index = pin; ptp_event.index = pin;
ptp_event.timestamp = timecounter_cyc2time(&clock->tc, ptp_event.timestamp =
be64_to_cpu(eqe->data.pps.time_stamp)); mlx5_timecounter_cyc2time(clock,
be64_to_cpu(eqe->data.pps.time_stamp));
if (clock->pps_info.enabled) { if (clock->pps_info.enabled) {
ptp_event.type = PTP_CLOCK_PPSUSR; ptp_event.type = PTP_CLOCK_PPSUSR;
ptp_event.pps_times.ts_real = ptp_event.pps_times.ts_real =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册