]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: stmmac: Do not enable RX FIFO overflow interrupts
authorYannick Vignon <yannick.vignon@nxp.com>
Thu, 6 May 2021 14:33:12 +0000 (16:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 09:38:30 +0000 (11:38 +0200)
[ Upstream commit 8a7cb245cf28cb3e541e0d6c8624b95d079e155b ]

The RX FIFO overflows when the system is not able to process all received
packets and they start accumulating (first in the DMA queue in memory,
then in the FIFO). An interrupt is then raised for each overflowing packet
and handled in stmmac_interrupt(). This is counter-productive, since it
brings the system (or more likely, one CPU core) to its knees to process
the FIFO overflow interrupts.

stmmac_interrupt() handles overflow interrupts by writing the rx tail ptr
into the corresponding hardware register (according to the MAC spec, this
has the effect of restarting the MAC DMA). However, without freeing any rx
descriptors, the DMA stops right away, and another overflow interrupt is
raised as the FIFO overflows again. Since the DMA is already restarted at
the end of stmmac_rx_refill() after freeing descriptors, disabling FIFO
overflow interrupts and the corresponding handling code has no side effect,
and eliminates the interrupt storm when the RX FIFO overflows.

Signed-off-by: Yannick Vignon <yannick.vignon@nxp.com>
Link: https://lore.kernel.org/r/20210506143312.20784-1-yannick.vignon@oss.nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index a41ac13cc4e554865c161a5b5009da1aa5323963..0d993f4b701c248a0f61caa4304c3fdfa5d6ae2e 100644 (file)
@@ -211,7 +211,7 @@ static void dwmac4_dma_rx_chan_op_mode(void __iomem *ioaddr, int mode,
                                       u32 channel, int fifosz, u8 qmode)
 {
        unsigned int rqs = fifosz / 256 - 1;
-       u32 mtl_rx_op, mtl_rx_int;
+       u32 mtl_rx_op;
 
        mtl_rx_op = readl(ioaddr + MTL_CHAN_RX_OP_MODE(channel));
 
@@ -282,11 +282,6 @@ static void dwmac4_dma_rx_chan_op_mode(void __iomem *ioaddr, int mode,
        }
 
        writel(mtl_rx_op, ioaddr + MTL_CHAN_RX_OP_MODE(channel));
-
-       /* Enable MTL RX overflow */
-       mtl_rx_int = readl(ioaddr + MTL_CHAN_INT_CTRL(channel));
-       writel(mtl_rx_int | MTL_RX_OVERFLOW_INT_EN,
-              ioaddr + MTL_CHAN_INT_CTRL(channel));
 }
 
 static void dwmac4_dma_tx_chan_op_mode(void __iomem *ioaddr, int mode,
index 8e7c60e02fa09acaa66eee762e4245b46aa81436..10d28be73f456d51ae9f2dbcd5bcbae2d7f12220 100644 (file)
@@ -3855,7 +3855,6 @@ static irqreturn_t stmmac_interrupt(int irq, void *dev_id)
        /* To handle GMAC own interrupts */
        if ((priv->plat->has_gmac) || xmac) {
                int status = stmmac_host_irq_status(priv, priv->hw, &priv->xstats);
-               int mtl_status;
 
                if (unlikely(status)) {
                        /* For LPI we need to save the tx status */
@@ -3866,17 +3865,8 @@ static irqreturn_t stmmac_interrupt(int irq, void *dev_id)
                }
 
                for (queue = 0; queue < queues_count; queue++) {
-                       struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue];
-
-                       mtl_status = stmmac_host_mtl_irq_status(priv, priv->hw,
-                                                               queue);
-                       if (mtl_status != -EINVAL)
-                               status |= mtl_status;
-
-                       if (status & CORE_IRQ_MTL_RX_OVERFLOW)
-                               stmmac_set_rx_tail_ptr(priv, priv->ioaddr,
-                                                      rx_q->rx_tail_addr,
-                                                      queue);
+                       status = stmmac_host_mtl_irq_status(priv, priv->hw,
+                                                           queue);
                }
 
                /* PCS link status */