aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorDevesh Sharma <devesh.sharma@emulex.com>2014-06-10 10:02:15 -0400
committerRoland Dreier <roland@purestorage.com>2014-08-01 18:07:36 -0400
commitd114f99a29b7f9c7a5e001ca1ef9c93db70d8668 (patch)
tree099c04ef3abf6d1cb2e9df877163ca06eb1fd43b /drivers/net/ethernet
parent4808b184fd54d64995046b83864809536a058e7a (diff)
be2net: Issue shutdown event to ocrdma driver
In the shutdown path, when be2net calls pci_disable_msix(), it complains (BUG_ON) that irqs requested by ocrdma driver are still in use. This patch fixes this problem by issuing shutdown event to ocrdma from be2net shutdown path. As part of shutdown event processing, ocrdma driver will free up all the resources and free irqs. Once this completes be2net completes pci_disable_msix successfully. 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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/emulex/benet/be.h1
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c1
-rw-r--r--drivers/net/ethernet/emulex/benet/be_roce.c18
-rw-r--r--drivers/net/ethernet/emulex/benet/be_roce.h3
4 files changed, 20 insertions, 3 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index c2f5d2d3b932..56d4d100e024 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -890,5 +890,6 @@ void be_roce_dev_remove(struct be_adapter *);
890 */ 890 */
891void be_roce_dev_open(struct be_adapter *); 891void be_roce_dev_open(struct be_adapter *);
892void be_roce_dev_close(struct be_adapter *); 892void be_roce_dev_close(struct be_adapter *);
893void be_roce_dev_shutdown(struct be_adapter *);
893 894
894#endif /* BE_H */ 895#endif /* BE_H */
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 1e187fb760f8..36ce69ae9a2f 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -4958,6 +4958,7 @@ static void be_shutdown(struct pci_dev *pdev)
4958 if (!adapter) 4958 if (!adapter)
4959 return; 4959 return;
4960 4960
4961 be_roce_dev_shutdown(adapter);
4961 cancel_delayed_work_sync(&adapter->work); 4962 cancel_delayed_work_sync(&adapter->work);
4962 cancel_delayed_work_sync(&adapter->func_recovery_work); 4963 cancel_delayed_work_sync(&adapter->func_recovery_work);
4963 4964
diff --git a/drivers/net/ethernet/emulex/benet/be_roce.c b/drivers/net/ethernet/emulex/benet/be_roce.c
index 5bf16603a3e9..ef4672dc7357 100644
--- a/drivers/net/ethernet/emulex/benet/be_roce.c
+++ b/drivers/net/ethernet/emulex/benet/be_roce.c
@@ -120,7 +120,8 @@ static void _be_roce_dev_open(struct be_adapter *adapter)
120{ 120{
121 if (ocrdma_drv && adapter->ocrdma_dev && 121 if (ocrdma_drv && adapter->ocrdma_dev &&
122 ocrdma_drv->state_change_handler) 122 ocrdma_drv->state_change_handler)
123 ocrdma_drv->state_change_handler(adapter->ocrdma_dev, 0); 123 ocrdma_drv->state_change_handler(adapter->ocrdma_dev,
124 BE_DEV_UP);
124} 125}
125 126
126void be_roce_dev_open(struct be_adapter *adapter) 127void be_roce_dev_open(struct be_adapter *adapter)
@@ -136,7 +137,8 @@ static void _be_roce_dev_close(struct be_adapter *adapter)
136{ 137{
137 if (ocrdma_drv && adapter->ocrdma_dev && 138 if (ocrdma_drv && adapter->ocrdma_dev &&
138 ocrdma_drv->state_change_handler) 139 ocrdma_drv->state_change_handler)
139 ocrdma_drv->state_change_handler(adapter->ocrdma_dev, 1); 140 ocrdma_drv->state_change_handler(adapter->ocrdma_dev,
141 BE_DEV_DOWN);
140} 142}
141 143
142void be_roce_dev_close(struct be_adapter *adapter) 144void be_roce_dev_close(struct be_adapter *adapter)
@@ -148,6 +150,18 @@ void be_roce_dev_close(struct be_adapter *adapter)
148 } 150 }
149} 151}
150 152
153void be_roce_dev_shutdown(struct be_adapter *adapter)
154{
155 if (be_roce_supported(adapter)) {
156 mutex_lock(&be_adapter_list_lock);
157 if (ocrdma_drv && adapter->ocrdma_dev &&
158 ocrdma_drv->state_change_handler)
159 ocrdma_drv->state_change_handler(adapter->ocrdma_dev,
160 BE_DEV_SHUTDOWN);
161 mutex_unlock(&be_adapter_list_lock);
162 }
163}
164
151int be_roce_register_driver(struct ocrdma_driver *drv) 165int be_roce_register_driver(struct ocrdma_driver *drv)
152{ 166{
153 struct be_adapter *dev; 167 struct be_adapter *dev;
diff --git a/drivers/net/ethernet/emulex/benet/be_roce.h b/drivers/net/ethernet/emulex/benet/be_roce.h
index a3d9e96c18eb..e6f7eb1a7d87 100644
--- a/drivers/net/ethernet/emulex/benet/be_roce.h
+++ b/drivers/net/ethernet/emulex/benet/be_roce.h
@@ -62,7 +62,8 @@ struct ocrdma_driver {
62 62
63enum { 63enum {
64 BE_DEV_UP = 0, 64 BE_DEV_UP = 0,
65 BE_DEV_DOWN = 1 65 BE_DEV_DOWN = 1,
66 BE_DEV_SHUTDOWN = 2
66}; 67};
67 68
68/* APIs for RoCE driver to register callback handlers, 69/* APIs for RoCE driver to register callback handlers,