]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: stmmac: Prevent missing interrupts when running NAPI
authorJose Abreu <Jose.Abreu@synopsys.com>
Fri, 24 May 2019 08:20:26 +0000 (10:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:10:15 +0000 (09:10 +0200)
[ Upstream commit a976ca79e23f13bff79c14e7266cea4a0ea51e67 ]

When we trigger NAPI we are disabling interrupts but in case we receive
or send a packet in the meantime, as interrupts are disabled, we will
miss this event.

Trigger both NAPI instances (RX and TX) when at least one event happens
so that we don't miss any interrupts.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 06358fe5b2456baf8dff0484543281ac7c223865..dbee9b0113e35396a7fde13294cea188fcf3eb59 100644 (file)
@@ -2048,6 +2048,9 @@ static int stmmac_napi_check(struct stmmac_priv *priv, u32 chan)
                                                 &priv->xstats, chan);
        struct stmmac_channel *ch = &priv->channel[chan];
 
+       if (status)
+               status |= handle_rx | handle_tx;
+
        if ((status & handle_rx) && (chan < priv->plat->rx_queues_to_use)) {
                stmmac_disable_dma_irq(priv, priv->ioaddr, chan);
                napi_schedule_irqoff(&ch->rx_napi);