Skip to content

Commit

Permalink
net/mlx5: Drain wq first during PCI device removal
Browse files Browse the repository at this point in the history
mlx5_unload_one() is done with cleanup = true only once.

So instead of doing health wq drain inside the if(), directly do
during PCI device removal.

Signed-off-by: Parav Pandit <[email protected]>
Reviewed-by: Moshe Shemesh <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
  • Loading branch information
paravmellanox authored and Saeed Mahameed committed May 15, 2020
1 parent 4162f58 commit 41798df
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/net/ethernet/mellanox/mlx5/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1236,10 +1236,8 @@ int mlx5_load_one(struct mlx5_core_dev *dev, bool boot)

void mlx5_unload_one(struct mlx5_core_dev *dev, bool cleanup)
{
if (cleanup) {
if (cleanup)
mlx5_unregister_device(dev);
mlx5_drain_health_wq(dev);
}

mutex_lock(&dev->intf_state_mutex);
if (!test_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state)) {
Expand Down Expand Up @@ -1382,6 +1380,7 @@ static void remove_one(struct pci_dev *pdev)
mlx5_crdump_disable(dev);
mlx5_devlink_unregister(devlink);

mlx5_drain_health_wq(dev);
mlx5_unload_one(dev, true);
mlx5_pci_close(dev);
mlx5_mdev_uninit(dev);
Expand Down

0 comments on commit 41798df

Please sign in to comment.