]> git.baikalelectronics.ru Git - 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)
commit3fd3f089ecb9ebc35d91597926a6997b6a8c3a92
treef8c1cabb75af53f51f7cb0b82a392879e1608d5e
parentebb3037fd87ebd8ad9d2f613730c9ca11498a581
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: 78080f553ea3 ("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