aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ocrdma/ocrdma_main.c
diff options
context:
space:
mode:
authorNaresh Gottumukkala <bgottumukkala@emulex.com>2013-09-06 05:32:47 -0400
committerRoland Dreier <roland@purestorage.com>2013-11-08 17:43:06 -0500
commit1852d1da3b4723d7db0d490f54c07442b3e1c452 (patch)
tree431dbd1132b59578a8ea153ffb863fb22f30b3a9 /drivers/infiniband/hw/ocrdma/ocrdma_main.c
parent6ebacdfc07ca61ba258693c9b4c88f1ffbe8ccd7 (diff)
RDMA/ocrdma: Fix a crash in rmmod
1) ocrdma_remove_free() is called from a call_rcu callback funtion context, which can be a bottom-half context. So the code in ocrdma_remove_free should not sleep. But ocrdma_cleanup_hw() can sleep, So move it ocrdma_remove() instead of ocrdma_remove_free. 2) Fix a couple of kbuild test robot warnings. Signed-off-by: Naresh Gottumukkala <bgottumukkala@emulex.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma_main.c')
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma_main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c
index 0ce7674621ea..91443bcb9e0e 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c
@@ -452,9 +452,6 @@ static void ocrdma_remove_free(struct rcu_head *rcu)
452{ 452{
453 struct ocrdma_dev *dev = container_of(rcu, struct ocrdma_dev, rcu); 453 struct ocrdma_dev *dev = container_of(rcu, struct ocrdma_dev, rcu);
454 454
455 ocrdma_free_resources(dev);
456 ocrdma_cleanup_hw(dev);
457
458 idr_remove(&ocrdma_dev_id, dev->id); 455 idr_remove(&ocrdma_dev_id, dev->id);
459 kfree(dev->mbx_cmd); 456 kfree(dev->mbx_cmd);
460 ib_dealloc_device(&dev->ibdev); 457 ib_dealloc_device(&dev->ibdev);
@@ -470,6 +467,10 @@ static void ocrdma_remove(struct ocrdma_dev *dev)
470 spin_lock(&ocrdma_devlist_lock); 467 spin_lock(&ocrdma_devlist_lock);
471 list_del_rcu(&dev->entry); 468 list_del_rcu(&dev->entry);
472 spin_unlock(&ocrdma_devlist_lock); 469 spin_unlock(&ocrdma_devlist_lock);
470
471 ocrdma_free_resources(dev);
472 ocrdma_cleanup_hw(dev);
473
473 call_rcu(&dev->rcu, ocrdma_remove_free); 474 call_rcu(&dev->rcu, ocrdma_remove_free);
474} 475}
475 476