linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] net: ethernet: ti: cpsw: fix extra rx interrupt
@ 2019-12-06 12:28 Grygorii Strashko
  2019-12-07 19:57 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Grygorii Strashko @ 2019-12-06 12:28 UTC (permalink / raw)
  To: netdev, David S . Miller
  Cc: Sekhar Nori, linux-kernel, linux-omap, Grygorii Strashko

Now RX interrupt is triggered twice every time, because in
cpsw_rx_interrupt() it is asked first and then disabled. So there will be
pending interrupt always, when RX interrupt is enabled again in NAPI
handler.

Fix it by first disabling IRQ and then do ask.

Fixes: 870915feabdc ("drivers: net: cpsw: remove disable_irq/enable_irq as irq can be masked from cpsw itself")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
Hi

It requires manual backporting if selected for stable.
I can prepare separate patch for 5.4 if needed. 

 drivers/net/ethernet/ti/cpsw_priv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/cpsw_priv.c b/drivers/net/ethernet/ti/cpsw_priv.c
index b833cc1d188c..707d5eb480ce 100644
--- a/drivers/net/ethernet/ti/cpsw_priv.c
+++ b/drivers/net/ethernet/ti/cpsw_priv.c
@@ -100,8 +100,8 @@ irqreturn_t cpsw_rx_interrupt(int irq, void *dev_id)
 {
 	struct cpsw_common *cpsw = dev_id;
 
-	cpdma_ctlr_eoi(cpsw->dma, CPDMA_EOI_RX);
 	writel(0, &cpsw->wr_regs->rx_en);
+	cpdma_ctlr_eoi(cpsw->dma, CPDMA_EOI_RX);
 
 	if (cpsw->quirk_irq) {
 		disable_irq_nosync(cpsw->irqs_table[0]);
-- 
2.17.1


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

* Re: [PATCH v2] net: ethernet: ti: cpsw: fix extra rx interrupt
  2019-12-06 12:28 [PATCH v2] net: ethernet: ti: cpsw: fix extra rx interrupt Grygorii Strashko
@ 2019-12-07 19:57 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-12-07 19:57 UTC (permalink / raw)
  To: grygorii.strashko; +Cc: netdev, nsekhar, linux-kernel, linux-omap

From: Grygorii Strashko <grygorii.strashko@ti.com>
Date: Fri, 6 Dec 2019 14:28:20 +0200

> Now RX interrupt is triggered twice every time, because in
> cpsw_rx_interrupt() it is asked first and then disabled. So there will be
> pending interrupt always, when RX interrupt is enabled again in NAPI
> handler.
> 
> Fix it by first disabling IRQ and then do ask.
> 
> Fixes: 870915feabdc ("drivers: net: cpsw: remove disable_irq/enable_irq as irq can be masked from cpsw itself")
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

Applied and queued up for -stable.

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

end of thread, other threads:[~2019-12-07 19:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06 12:28 [PATCH v2] net: ethernet: ti: cpsw: fix extra rx interrupt Grygorii Strashko
2019-12-07 19:57 ` David Miller

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