Commit 6095e590 authored by John Allen's avatar John Allen Committed by David S. Miller

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: default avatarJohn Allen <jallen@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent da01ec4e
...@@ -1167,19 +1167,11 @@ static void clean_tx_pools(struct ibmvnic_adapter *adapter) ...@@ -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; 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) { if (adapter->tx_scrq) {
for (i = 0; i < adapter->req_tx_queues; i++) for (i = 0; i < adapter->req_tx_queues; i++)
if (adapter->tx_scrq[i]->irq) { if (adapter->tx_scrq[i]->irq) {
...@@ -1198,6 +1190,21 @@ static void ibmvnic_cleanup(struct net_device *netdev) ...@@ -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_rx_pools(adapter);
clean_tx_pools(adapter); clean_tx_pools(adapter);
} }
...@@ -1772,6 +1779,7 @@ static int do_reset(struct ibmvnic_adapter *adapter, ...@@ -1772,6 +1779,7 @@ static int do_reset(struct ibmvnic_adapter *adapter,
} }
} }
ibmvnic_disable_irqs(adapter);
adapter->state = VNIC_CLOSED; adapter->state = VNIC_CLOSED;
if (reset_state == VNIC_CLOSED) if (reset_state == VNIC_CLOSED)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment