]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: ethernet: ti: cpsw: fix extra rx interrupt
authorGrygorii Strashko <grygorii.strashko@ti.com>
Fri, 6 Dec 2019 12:28:20 +0000 (14:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Dec 2019 09:42:22 +0000 (10:42 +0100)
[ Upstream commit 51302f77bedab8768b761ed1899c08f89af9e4e2 ]

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/ti/cpsw.c

index 892b06852e150384a2140fb5b03b8cd749054e03..687f0c20b47f1fd0f2abe74a228b423fb6e79fe9 100644 (file)
@@ -773,8 +773,8 @@ static 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]);