aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mlx4/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index c231112396b2..c61bcee9ee8a 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -1390,6 +1390,9 @@ static void update_gids_task(struct work_struct *work)
1390 int err; 1390 int err;
1391 struct mlx4_dev *dev = gw->dev->dev; 1391 struct mlx4_dev *dev = gw->dev->dev;
1392 1392
1393 if (!gw->dev->ib_active)
1394 return;
1395
1393 mailbox = mlx4_alloc_cmd_mailbox(dev); 1396 mailbox = mlx4_alloc_cmd_mailbox(dev);
1394 if (IS_ERR(mailbox)) { 1397 if (IS_ERR(mailbox)) {
1395 pr_warn("update gid table failed %ld\n", PTR_ERR(mailbox)); 1398 pr_warn("update gid table failed %ld\n", PTR_ERR(mailbox));
@@ -1420,6 +1423,9 @@ static void reset_gids_task(struct work_struct *work)
1420 int err; 1423 int err;
1421 struct mlx4_dev *dev = gw->dev->dev; 1424 struct mlx4_dev *dev = gw->dev->dev;
1422 1425
1426 if (!gw->dev->ib_active)
1427 return;
1428
1423 mailbox = mlx4_alloc_cmd_mailbox(dev); 1429 mailbox = mlx4_alloc_cmd_mailbox(dev);
1424 if (IS_ERR(mailbox)) { 1430 if (IS_ERR(mailbox)) {
1425 pr_warn("reset gid table failed\n"); 1431 pr_warn("reset gid table failed\n");
@@ -2369,6 +2375,9 @@ static void mlx4_ib_remove(struct mlx4_dev *dev, void *ibdev_ptr)
2369 struct mlx4_ib_dev *ibdev = ibdev_ptr; 2375 struct mlx4_ib_dev *ibdev = ibdev_ptr;
2370 int p; 2376 int p;
2371 2377
2378 ibdev->ib_active = false;
2379 flush_workqueue(wq);
2380
2372 mlx4_ib_close_sriov(ibdev); 2381 mlx4_ib_close_sriov(ibdev);
2373 mlx4_ib_mad_cleanup(ibdev); 2382 mlx4_ib_mad_cleanup(ibdev);
2374 ib_unregister_device(&ibdev->ib_dev); 2383 ib_unregister_device(&ibdev->ib_dev);