diff mbox

[for-next,05/15] RDMA/ocrdma: Handle shutdown event from

Message ID 2cf8f0e1-b205-43b9-8720-0ff18406fe9b@CMEXHTCAS1.ad.emulex.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Selvin Xavier June 4, 2014, 8:52 a.m. UTC
From: Devesh Sharma <devesh.sharma@emulex.com>

be2net driver sends shutdown event while shutdown/reboot is initiated.
as part of event processing, ocrdma calls close() and remove() to
free all the resources associated with ocrdma. This also frees
irqs used by ocrdma

Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: Selvin Xavier <selvin.xavier@emulex.com>
---
 drivers/infiniband/hw/ocrdma/ocrdma_main.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox

Patch

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c
index 227a542..3cb20c6 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c
@@ -519,6 +519,12 @@  static int ocrdma_close(struct ocrdma_dev *dev)
 	return 0;
 }
 
+static void ocrdma_shutdown(struct ocrdma_dev *dev)
+{
+	ocrdma_close(dev);
+	ocrdma_remove(dev);
+}
+
 /* event handling via NIC driver ensures that all the NIC specific
  * initialization done before RoCE driver notifies
  * event to stack.
@@ -532,6 +538,9 @@  static void ocrdma_event_handler(struct ocrdma_dev *dev, u32 event)
 	case BE_DEV_DOWN:
 		ocrdma_close(dev);
 		break;
+	case BE_DEV_SHUTDOWN:
+		ocrdma_shutdown(dev);
+		break;
 	}
 }