Skip to content

Commit 031a163

Browse files
shayshyiSaeed Mahameed
authored andcommitted
net/mlx5: Set BREAK_FW_WAIT flag first when removing driver
Currently, BREAK_FW_WAIT flag is set after syncing with fw_reset. However, fw_reset can call mlx5_load_one() which is waiting for fw init bit and BREAK_FW_WAIT flag is intended to stop. e.g.: the driver might wait on a loop it should exit. Fix it by setting the flag before syncing with fw_reset. Fixes: 8324a02 ("net/mlx5: Add exit route when waiting for FW") Signed-off-by: Shay Drory <[email protected]> Reviewed-by: Moshe Shemesh <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent dd64572 commit 031a163

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1789,11 +1789,11 @@ static void remove_one(struct pci_dev *pdev)
17891789
struct mlx5_core_dev *dev = pci_get_drvdata(pdev);
17901790
struct devlink *devlink = priv_to_devlink(dev);
17911791

1792+
set_bit(MLX5_BREAK_FW_WAIT, &dev->intf_state);
17921793
/* mlx5_drain_fw_reset() is using devlink APIs. Hence, we must drain
17931794
* fw_reset before unregistering the devlink.
17941795
*/
17951796
mlx5_drain_fw_reset(dev);
1796-
set_bit(MLX5_BREAK_FW_WAIT, &dev->intf_state);
17971797
devlink_unregister(devlink);
17981798
mlx5_sriov_disable(pdev);
17991799
mlx5_crdump_disable(dev);

0 commit comments

Comments
 (0)