Skip to content

Commit 89f988d

Browse files
paravmellanoxdledford
authored andcommitted
IB/mlx4: Follow mirror sequence of device add during device removal
Current code device add sequence is: ib_register_device() ib_mad_init() init_sriov_init() register_netdev_notifier() Therefore, the remove sequence should be, unregister_netdev_notifier() close_sriov() mad_cleanup() ib_unregister_device() However it is not above. Hence, make do above remove sequence. Fixes: fa417f7 ("IB/mlx4: Add support for IBoE") Signed-off-by: Parav Pandit <[email protected]> Reviewed-by: Maor Gottlieb <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Doug Ledford <[email protected]>
1 parent 33df2f1 commit 89f988d

File tree

1 file changed

+5
-4
lines changed
  • drivers/infiniband/hw/mlx4

1 file changed

+5
-4
lines changed

drivers/infiniband/hw/mlx4/main.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3018,16 +3018,17 @@ static void mlx4_ib_remove(struct mlx4_dev *dev, void *ibdev_ptr)
30183018
ibdev->ib_active = false;
30193019
flush_workqueue(wq);
30203020

3021-
mlx4_ib_close_sriov(ibdev);
3022-
mlx4_ib_mad_cleanup(ibdev);
3023-
ib_unregister_device(&ibdev->ib_dev);
3024-
mlx4_ib_diag_cleanup(ibdev);
30253021
if (ibdev->iboe.nb.notifier_call) {
30263022
if (unregister_netdevice_notifier(&ibdev->iboe.nb))
30273023
pr_warn("failure unregistering notifier\n");
30283024
ibdev->iboe.nb.notifier_call = NULL;
30293025
}
30303026

3027+
mlx4_ib_close_sriov(ibdev);
3028+
mlx4_ib_mad_cleanup(ibdev);
3029+
ib_unregister_device(&ibdev->ib_dev);
3030+
mlx4_ib_diag_cleanup(ibdev);
3031+
30313032
mlx4_qp_release_range(dev, ibdev->steer_qpn_base,
30323033
ibdev->steer_qpn_count);
30333034
kfree(ibdev->ib_uc_qpns_bitmap);

0 commit comments

Comments
 (0)