From: Hauke Mehrtens Date: Sat, 12 Sep 2020 19:36:29 +0000 (+0200) Subject: net: lantiq: Disable IRQs only if NAPI gets scheduled X-Git-Tag: v5.8.12~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=318d2408a81de9d4558803ab4a4763644f186312;p=thirdparty%2Fkernel%2Fstable.git net: lantiq: Disable IRQs only if NAPI gets scheduled [ Upstream commit 9423361da52356cb68642db5b2729b6b85aad330 ] The napi_schedule() call will only schedule the NAPI if it is not already running. To make sure that we do not deactivate interrupts without scheduling NAPI only deactivate the interrupts in case NAPI also gets scheduled. Signed-off-by: Hauke Mehrtens Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c index abee7d61074c8..635ff3a5dcfb3 100644 --- a/drivers/net/ethernet/lantiq_xrx200.c +++ b/drivers/net/ethernet/lantiq_xrx200.c @@ -345,10 +345,12 @@ static irqreturn_t xrx200_dma_irq(int irq, void *ptr) { struct xrx200_chan *ch = ptr; - ltq_dma_disable_irq(&ch->dma); - ltq_dma_ack_irq(&ch->dma); + if (napi_schedule_prep(&ch->napi)) { + __napi_schedule(&ch->napi); + ltq_dma_disable_irq(&ch->dma); + } - napi_schedule(&ch->napi); + ltq_dma_ack_irq(&ch->dma); return IRQ_HANDLED; }