diff mbox series

[v2] net: ethernet: ti: cpsw: fix extra rx interrupt

Message ID 20191206122820.24811-1-grygorii.strashko@ti.com
State New
Headers show
Series [v2] net: ethernet: ti: cpsw: fix extra rx interrupt | expand

Commit Message

Grygorii Strashko Dec. 6, 2019, 12:28 p.m. UTC
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(-)

-- 
2.17.1

Comments

David Miller Dec. 7, 2019, 7:57 p.m. UTC | #1
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.
diff mbox series

Patch

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]);