mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
net/mlx5: SF, Drain health before removing device
[ Upstream commitb4646da057] There is no point in recovery during device removal. Also, if health work started need to wait for it to avoid races and NULL pointer access. Hence, drain health WQ before removing device. Fixes:1958fc2f07("net/mlx5: SF, Add auxiliary device driver") Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9e49af9766
commit
e73b7de4bf
@@ -63,6 +63,7 @@ static void mlx5_sf_dev_remove(struct auxiliary_device *adev)
|
|||||||
struct mlx5_sf_dev *sf_dev = container_of(adev, struct mlx5_sf_dev, adev);
|
struct mlx5_sf_dev *sf_dev = container_of(adev, struct mlx5_sf_dev, adev);
|
||||||
struct devlink *devlink = priv_to_devlink(sf_dev->mdev);
|
struct devlink *devlink = priv_to_devlink(sf_dev->mdev);
|
||||||
|
|
||||||
|
mlx5_drain_health_wq(sf_dev->mdev);
|
||||||
devlink_unregister(devlink);
|
devlink_unregister(devlink);
|
||||||
mlx5_uninit_one(sf_dev->mdev);
|
mlx5_uninit_one(sf_dev->mdev);
|
||||||
iounmap(sf_dev->mdev->iseg);
|
iounmap(sf_dev->mdev->iseg);
|
||||||
|
|||||||
Reference in New Issue
Block a user