diff options
author | Eran Ben Elisha <eranbe@mellanox.com> | 2016-06-21 14:20:03 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-22 16:38:11 -0400 |
commit | 9d76931180557270796f9631e2c79b9c7bb3c9fb (patch) | |
tree | 58119d9fbb3bfae0856da104657aad7d3dcf59f7 /drivers/net/ethernet/mellanox/mlx4/main.c | |
parent | 93c098af09455ea7bdc6f0f6b08f6ac14fa06cf4 (diff) | |
download | op-kernel-dev-9d76931180557270796f9631e2c79b9c7bb3c9fb.zip op-kernel-dev-9d76931180557270796f9631e2c79b9c7bb3c9fb.tar.gz |
net/mlx4_en: Avoid unregister_netdev at shutdown flow
This allows a clean shutdown, even if some netdev clients do not
release their reference from this netdev. It is enough to release
the HW resources only as the kernel is shutting down.
Fixes: 2ba5fbd62b25 ('net/mlx4_core: Handle AER flow properly')
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/main.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 372ebfa..546fab0 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -4135,8 +4135,11 @@ static void mlx4_shutdown(struct pci_dev *pdev) mlx4_info(persist->dev, "mlx4_shutdown was called\n"); mutex_lock(&persist->interface_state_mutex); - if (persist->interface_state & MLX4_INTERFACE_STATE_UP) + if (persist->interface_state & MLX4_INTERFACE_STATE_UP) { + /* Notify mlx4 clients that the kernel is being shut down */ + persist->interface_state |= MLX4_INTERFACE_STATE_SHUTDOWN; mlx4_unload_one(pdev); + } mutex_unlock(&persist->interface_state_mutex); } |