Commit 824c8dc4 authored by Shay Drory's avatar Shay Drory Committed by Saeed Mahameed

net/mlx5: Drain health before unregistering devlink

mlx5 health mechanism is using devlink APIs, which are using devlink
notify APIs. After the cited patch, using devlink notify APIs after
devlink is unregistered triggers a WARN_ON().
Hence, drain health WQ before devlink is unregistered.

Fixes: cf530217 ("devlink: Notify users when objects are accessible")
Signed-off-by: default avatarShay Drory <shayd@nvidia.com>
Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 623efc4c
...@@ -1802,15 +1802,16 @@ static void remove_one(struct pci_dev *pdev) ...@@ -1802,15 +1802,16 @@ static void remove_one(struct pci_dev *pdev)
struct devlink *devlink = priv_to_devlink(dev); struct devlink *devlink = priv_to_devlink(dev);
set_bit(MLX5_BREAK_FW_WAIT, &dev->intf_state); set_bit(MLX5_BREAK_FW_WAIT, &dev->intf_state);
/* mlx5_drain_fw_reset() is using devlink APIs. Hence, we must drain /* mlx5_drain_fw_reset() and mlx5_drain_health_wq() are using
* fw_reset before unregistering the devlink. * devlink notify APIs.
* Hence, we must drain them before unregistering the devlink.
*/ */
mlx5_drain_fw_reset(dev); mlx5_drain_fw_reset(dev);
mlx5_drain_health_wq(dev);
devlink_unregister(devlink); devlink_unregister(devlink);
mlx5_sriov_disable(pdev); mlx5_sriov_disable(pdev);
mlx5_thermal_uninit(dev); mlx5_thermal_uninit(dev);
mlx5_crdump_disable(dev); mlx5_crdump_disable(dev);
mlx5_drain_health_wq(dev);
mlx5_uninit_one(dev); mlx5_uninit_one(dev);
mlx5_pci_close(dev); mlx5_pci_close(dev);
mlx5_mdev_uninit(dev); mlx5_mdev_uninit(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment