diff options
author | Kees Cook <keescook@chromium.org> | 2016-07-25 23:50:36 +0300 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2016-07-25 23:50:36 +0300 |
commit | 74e630a7582e6b3cb39559d712a0049f08dea8a0 (patch) | |
tree | 98a752412dcfc74d802024c1d9e8c541b93174f9 /drivers/net/ethernet/mellanox/mlx4/main.c | |
parent | 35da60941e44dbf57868e67686dd24cc1a33125a (diff) | |
parent | 523d939ef98fd712632d93a5a2b588e477a7565e (diff) | |
download | linux-74e630a7582e6b3cb39559d712a0049f08dea8a0.tar.xz |
Merge tag 'v4.7' into for-linus/pstore
Linux 4.7
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/main.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 12c77a70abdb..546fab0ecc3b 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -3222,6 +3222,7 @@ static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data, INIT_LIST_HEAD(&priv->pgdir_list); mutex_init(&priv->pgdir_mutex); + spin_lock_init(&priv->cmd.context_lock); INIT_LIST_HEAD(&priv->bf_list); mutex_init(&priv->bf_mutex); @@ -4134,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); } |