net/mlx5: Drain health before unregistering devlink
authorShay Drory <shayd@nvidia.com>
Mon, 24 Apr 2023 09:31:59 +0000 (12:31 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:34:00 +0000 (10:34 +0200)
commit9e49af9766ece106bda4db772669c73d2c52a014
treeff30305c4254fe5b368ada21beb0777eaa1d44bd
parentddd8d552a8f8d6e15bcdcdd294fb3ee897d4e221
net/mlx5: Drain health before unregistering devlink

[ Upstream commit 824c8dc4a470040bf0e56ba716543839c2498d49 ]

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: cf530217408e ("devlink: Notify users when objects are accessible")
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>
drivers/net/ethernet/mellanox/mlx5/core/main.c