stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "amd-xgbe: Enable IRQs only if napi_complete_done() is true" has been added to the 4.10-stable tree
@ 2017-03-18 14:05 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-03-18 14:05 UTC (permalink / raw)
  To: Thomas.Lendacky, davem, gregkh, jeremy.linton, thomas.lendacky
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    amd-xgbe: Enable IRQs only if napi_complete_done() is true

to the 4.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     amd-xgbe-enable-irqs-only-if-napi_complete_done-is-true.patch
and it can be found in the queue-4.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Sat Mar 18 22:03:53 CST 2017
From: "Lendacky, Thomas" <Thomas.Lendacky@amd.com>
Date: Thu, 9 Mar 2017 17:48:23 -0600
Subject: amd-xgbe: Enable IRQs only if napi_complete_done() is true

From: "Lendacky, Thomas" <Thomas.Lendacky@amd.com>


[ Upstream commit d7aba644ffdebf756e51e26a2229055211838e89 ]

Depending on the hardware, the amd-xgbe driver may use disable_irq_nosync()
and enable_irq() when an interrupt is received to process Rx packets. If
the napi_complete_done() return value isn't checked an unbalanced enable
for the IRQ could result, generating a warning stack trace.

Update the driver to only enable interrupts if napi_complete_done() returns
true.

Reported-by: Jeremy Linton <jeremy.linton@arm.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/amd/xgbe/xgbe-drv.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -2274,10 +2274,7 @@ static int xgbe_one_poll(struct napi_str
 	processed = xgbe_rx_poll(channel, budget);
 
 	/* If we processed everything, we are done */
-	if (processed < budget) {
-		/* Turn off polling */
-		napi_complete_done(napi, processed);
-
+	if ((processed < budget) && napi_complete_done(napi, processed)) {
 		/* Enable Tx and Rx interrupts */
 		if (pdata->channel_irq_mode)
 			xgbe_enable_rx_tx_int(pdata, channel);
@@ -2319,10 +2316,7 @@ static int xgbe_all_poll(struct napi_str
 	} while ((processed < budget) && (processed != last_processed));
 
 	/* If we processed everything, we are done */
-	if (processed < budget) {
-		/* Turn off polling */
-		napi_complete_done(napi, processed);
-
+	if ((processed < budget) && napi_complete_done(napi, processed)) {
 		/* Enable Tx and Rx interrupts */
 		xgbe_enable_rx_tx_ints(pdata);
 	}


Patches currently in stable-queue which might be from Thomas.Lendacky@amd.com are

queue-4.10/amd-xgbe-be-sure-to-set-mdio-modes-on-device-re-start.patch
queue-4.10/amd-xgbe-enable-irqs-only-if-napi_complete_done-is-true.patch
queue-4.10/amd-xgbe-don-t-overwrite-sfp-phy-mod_absent-settings.patch
queue-4.10/amd-xgbe-stop-the-phy-before-releasing-interrupts.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-18 14:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-18 14:05 Patch "amd-xgbe: Enable IRQs only if napi_complete_done() is true" has been added to the 4.10-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).