From: Jose Abreu Date: Fri, 28 Jun 2019 07:29:20 +0000 (+0200) Subject: net: stmmac: Only disable interrupts if NAPI is scheduled X-Git-Tag: tags/kvm-5.3-2~55^2~118^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3ba07debfc8d7d76bd48577536b5382490b21c10;p=users%2Fdwmw2%2Flinux.git net: stmmac: Only disable interrupts if NAPI is scheduled Only disable the interrupts if RX NAPI gets to be scheduled. Also, schedule the TX NAPI only when the interrupts are disabled. Signed-off-by: Jose Abreu Cc: Joao Pinto Cc: David S. Miller Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index a629b3144a0dc..3425d4dda03d6 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2053,12 +2053,12 @@ 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); + if (napi_schedule_prep(&ch->rx_napi)) { + stmmac_disable_dma_irq(priv, priv->ioaddr, chan); + __napi_schedule_irqoff(&ch->rx_napi); + status |= handle_tx; + } } if ((status & handle_tx) && (chan < priv->plat->tx_queues_to_use))