Skip to content

Commit 88ec484

Browse files
mosheshemesh2gregkh
authored andcommitted
net/mlx5: Skip clock update work when device is in error state
commit d006207 upstream. When device is in error state, marked by the flag MLX5_DEVICE_STATE_INTERNAL_ERROR, the HW and PCI may not be accessible and so clock update work should be skipped. Furthermore, such access through PCI in error state, after calling mlx5_pci_disable_device() can result in failing to recover from pci errors. Fixes: ef9814d ("net/mlx5e: Add HW timestamping (TS) support") Reported-and-tested-by: Ganesh G R <[email protected]> Closes: https://lore.kernel.org/netdev/[email protected] Signed-off-by: Moshe Shemesh <[email protected]> Reviewed-by: Aya Levin <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4276f3e commit 88ec484

File tree

1 file changed

+5
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/lib

1 file changed

+5
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,15 @@ static void mlx5_timestamp_overflow(struct work_struct *work)
198198
clock = container_of(timer, struct mlx5_clock, timer);
199199
mdev = container_of(clock, struct mlx5_core_dev, clock);
200200

201+
if (mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)
202+
goto out;
203+
201204
write_seqlock_irqsave(&clock->lock, flags);
202205
timecounter_read(&timer->tc);
203206
mlx5_update_clock_info_page(mdev);
204207
write_sequnlock_irqrestore(&clock->lock, flags);
208+
209+
out:
205210
schedule_delayed_work(&timer->overflow_work, timer->overflow_period);
206211
}
207212

0 commit comments

Comments
 (0)