Skip to contentSkip to conversation

net: ethernet: ti: cpsw: fix extra rx interrupt

PATCH In review Grygorii Strashko 2 participants 2 messages Dec 6, 2019 – Dec 7, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: ethernet: ti: cpsw: fix extra rx interrupt

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

---
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(-)
drivers/net/ethernet/ti/cpsw_priv.c +1 -1
index b833cc1d188c..707d5eb480ce 100644
@@ -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]);
Signature · 1 line
2.17.1
maintainer
#1 lore raw

From: Grygorii Strashko <[email protected]>
Date: Fri, 6 Dec 2019 14:28:20 +0200

Quoted 9 lines

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

Applied and queued up for -stable.