All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] ibmvnic: Disable irqs before exiting reset from closed state
@ 2018-03-30 18:44 John Allen
  2018-04-02  0:56 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: John Allen @ 2018-03-30 18:44 UTC (permalink / raw)
  To: netdev; +Cc: Thomas Falcon, Nathan Fontenot

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>
---
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 0389a7a..b492af6 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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] ibmvnic: Disable irqs before exiting reset from closed state
  2018-03-30 18:44 [PATCH net] ibmvnic: Disable irqs before exiting reset from closed state John Allen
@ 2018-04-02  0:56 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-04-02  0:56 UTC (permalink / raw)
  To: jallen; +Cc: netdev, tlfalcon, nfont

From: John Allen <jallen@linux.vnet.ibm.com>
Date: Fri, 30 Mar 2018 13:44:21 -0500

> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-02  0:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-30 18:44 [PATCH net] ibmvnic: Disable irqs before exiting reset from closed state John Allen
2018-04-02  0:56 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.