All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] amd-xgbe: Use __napi_schedule() in BH context
@ 2020-04-16 15:57 Sebastian Andrzej Siewior
  2020-04-16 21:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2020-04-16 15:57 UTC (permalink / raw)
  To: netdev; +Cc: Tom Lendacky, David S. Miller, Thomas Gleixner, Eric Dumazet

The driver uses __napi_schedule_irqoff() which is fine as long as it is
invoked with disabled interrupts by everybody. Since the commit
mentioned below the driver may invoke xgbe_isr_task() in tasklet/softirq
context. This may lead to list corruption if another driver uses
__napi_schedule_irqoff() in IRQ context.

Use __napi_schedule() which safe to use from IRQ and softirq context.

Fixes: 85b85c853401d ("amd-xgbe: Re-issue interrupt if interrupt status not cleared")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
---

Repost of
  https://lore.kernel.org/r/20191126222013.1904785-2-bigeasy@linutronix.de

+ Tom's Ack collected.

 drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
index b71f9b04a51e1..a87264f95f1a4 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -514,7 +514,7 @@ static void xgbe_isr_task(unsigned long data)
 				xgbe_disable_rx_tx_ints(pdata);
 
 				/* Turn on polling */
-				__napi_schedule_irqoff(&pdata->napi);
+				__napi_schedule(&pdata->napi);
 			}
 		} else {
 			/* Don't clear Rx/Tx status if doing per channel DMA
-- 
2.26.1


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

* Re: [PATCH net] amd-xgbe: Use __napi_schedule() in BH context
  2020-04-16 15:57 [PATCH net] amd-xgbe: Use __napi_schedule() in BH context Sebastian Andrzej Siewior
@ 2020-04-16 21:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-04-16 21:04 UTC (permalink / raw)
  To: bigeasy; +Cc: netdev, thomas.lendacky, tglx, eric.dumazet

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 16 Apr 2020 17:57:40 +0200

> The driver uses __napi_schedule_irqoff() which is fine as long as it is
> invoked with disabled interrupts by everybody. Since the commit
> mentioned below the driver may invoke xgbe_isr_task() in tasklet/softirq
> context. This may lead to list corruption if another driver uses
> __napi_schedule_irqoff() in IRQ context.
> 
> Use __napi_schedule() which safe to use from IRQ and softirq context.
> 
> Fixes: 85b85c853401d ("amd-xgbe: Re-issue interrupt if interrupt status not cleared")
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Acked-by: Tom Lendacky <thomas.lendacky@amd.com>

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2020-04-16 21:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16 15:57 [PATCH net] amd-xgbe: Use __napi_schedule() in BH context Sebastian Andrzej Siewior
2020-04-16 21:04 ` 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.