RDMA/ocrdma: Handle shutdown event from be2net driver
authorDevesh Sharma <devesh.sharma@emulex.com>
Tue, 10 Jun 2014 14:02:16 +0000 (19:32 +0530)
committerRoland Dreier <roland@purestorage.com>
Fri, 1 Aug 2014 22:07:36 +0000 (15:07 -0700)
be2net driver sends a shutdown event to ocrdma during shutdown/reboot.
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>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/ocrdma/ocrdma_main.c

index 227a542..3cb20c6 100644 (file)
@@ -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;
        }
 }