Skip to content

Commit 8ff38e7

Browse files
Moshe Shemeshkuba-moo
authored andcommitted
net/mlx5: Stop waiting for PCI up if teardown was triggered
If driver teardown is called while PCI is turned off, there is a race between health recovery and teardown. If health recovery already started it will wait 60 sec trying to see if PCI gets back and it can recover, but actually there is no need to wait anymore once teardown was called. Use the MLX5_BREAK_FW_WAIT flag which is set on driver teardown to break waiting for PCI up. Signed-off-by: Moshe Shemesh <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c05d145 commit 8ff38e7

File tree

1 file changed

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

1 file changed

+4
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/health.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ int mlx5_health_wait_pci_up(struct mlx5_core_dev *dev)
325325
while (sensor_pci_not_working(dev)) {
326326
if (time_after(jiffies, end))
327327
return -ETIMEDOUT;
328+
if (test_bit(MLX5_BREAK_FW_WAIT, &dev->intf_state)) {
329+
mlx5_core_warn(dev, "device is being removed, stop waiting for PCI\n");
330+
return -ENODEV;
331+
}
328332
msleep(100);
329333
}
330334
return 0;

0 commit comments

Comments
 (0)