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

From: Grygorii Strashko
Date: Thu Dec 05 2019 - 10:18:30 EST


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.

Signed-off-by: Grygorii Strashko <grygorii.strashko@xxxxxx>
---
Hi

This is an old issue, but I can't specify Fixes tag. And, unfortunatelly,
it can't be backported as is even in v5.4.

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