From: Daniel Jurgens Date: Wed, 19 Oct 2022 21:13:50 +0000 (+0300) Subject: net/mlx5: Disable eswitch before waiting for VF pages X-Git-Tag: baikal/mips/sdk6.1~133 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=a0b4f28e662052bea8c400166a3652133c18c171;p=kernel.git net/mlx5: Disable eswitch before waiting for VF pages [ Upstream commit 5998144955d5ec881cb61849571da0c101a33471 ] The offending commit changed the ordering of moving to legacy mode and waiting for the VF pages. Moving to legacy mode is important in bluefield, because it sends the host driver into error state, and frees its pages. Without this transition we end up waiting 2 minutes for pages that aren't coming before carrying on with the unload process. Fixes: da5c5f25de4b ("net/mlx5: E-switch, Remove dependency between sriov and eswitch mode") Signed-off-by: Daniel Jurgens Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index f07175549a87d..51c3e86f71a94 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -1339,8 +1339,8 @@ err_irq_table: static void mlx5_unload(struct mlx5_core_dev *dev) { mlx5_sf_dev_table_destroy(dev); - mlx5_sriov_detach(dev); mlx5_eswitch_disable(dev->priv.eswitch); + mlx5_sriov_detach(dev); mlx5_lag_remove_mdev(dev); mlx5_ec_cleanup(dev); mlx5_sf_hw_table_destroy(dev);