summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorJohn Allen <jallen@linux.vnet.ibm.com>2018-03-30 21:44:21 +0300
committerDavid S. Miller <davem@davemloft.net>2018-04-02 03:53:50 +0300
commit6095e590d277ecec54805c4999335406f08855fe (patch)
tree26e0e76ab981bfd608244d1cb63dee7d28786656 /drivers/net
parentda01ec4ee5e69933641e6017d6461d0ce9dbfac6 (diff)
downloadlinux-6095e590d277ecec54805c4999335406f08855fe.tar.xz
ibmvnic: Disable irqs before exiting reset from closed state
When the driver is closed, all the associated irqs are disabled. In the event that the driver exits a reset in the closed state, we should be consistent with the state we are in directly after a close. So before we exit the reset routine, all irqs should be disabled as well. This will prevent the irqs from being enabled twice in this case and reporting a number of noisy warning traces. Signed-off-by: John Allen <jallen@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/ibm/ibmvnic.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 0389a7a52152..b492af6affc3 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1167,19 +1167,11 @@ static void clean_tx_pools(struct ibmvnic_adapter *adapter)
}
}
-static void ibmvnic_cleanup(struct net_device *netdev)
+static void ibmvnic_disable_irqs(struct ibmvnic_adapter *adapter)
{
- struct ibmvnic_adapter *adapter = netdev_priv(netdev);
+ struct net_device *netdev = adapter->netdev;
int i;
- /* ensure that transmissions are stopped if called by do_reset */
- if (adapter->resetting)
- netif_tx_disable(netdev);
- else
- netif_tx_stop_all_queues(netdev);
-
- ibmvnic_napi_disable(adapter);
-
if (adapter->tx_scrq) {
for (i = 0; i < adapter->req_tx_queues; i++)
if (adapter->tx_scrq[i]->irq) {
@@ -1198,6 +1190,21 @@ static void ibmvnic_cleanup(struct net_device *netdev)
}
}
}
+}
+
+static void ibmvnic_cleanup(struct net_device *netdev)
+{
+ struct ibmvnic_adapter *adapter = netdev_priv(netdev);
+
+ /* ensure that transmissions are stopped if called by do_reset */
+ if (adapter->resetting)
+ netif_tx_disable(netdev);
+ else
+ netif_tx_stop_all_queues(netdev);
+
+ ibmvnic_napi_disable(adapter);
+ ibmvnic_disable_irqs(adapter);
+
clean_rx_pools(adapter);
clean_tx_pools(adapter);
}
@@ -1772,6 +1779,7 @@ static int do_reset(struct ibmvnic_adapter *adapter,
}
}
+ ibmvnic_disable_irqs(adapter);
adapter->state = VNIC_CLOSED;
if (reset_state == VNIC_CLOSED)