]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
net/mlx5: Disable reload while removing the device
authorParav Pandit <parav@mellanox.com>
Thu, 14 May 2020 10:12:56 +0000 (05:12 -0500)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 11 Jun 2020 22:38:00 +0000 (15:38 -0700)
commit60904cd349abc98cb888fc28d1ca55a8e2cf87b3
treef8c1cabb75af53f51f7cb0b82a392879e1608d5e
parent5f1572e6178e47c3ace55ced187d93240952c9cd
net/mlx5: Disable reload while removing the device

While unregistration is in progress, user might be reloading the
interface.
This can race with unregistration in below flow which uses the
resources which are getting disabled by reload flow.

Hence, disable the devlink reloading first when removing the device.

     CPU0                                   CPU1
     ----                                   ----
local_pci_remove()                  devlink_mutex
  remove_one()                       devlink_nl_cmd_reload()
    mlx5_unregister_device()           devlink_reload()
                                       ops->reload_down()
                                         mlx5_unload_one()

Fixes: 4383cfcc65e7 ("net/mlx5: Add devlink reload")
Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/devlink.c
drivers/net/ethernet/mellanox/mlx5/core/main.c