Skip to content

Commit

Permalink
net: lantiq: Disable IRQs only if NAPI gets scheduled
Browse files Browse the repository at this point in the history
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 <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
hauke authored and davem330 committed Sep 14, 2020
1 parent c582a7f commit 9423361
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/ethernet/lantiq_xrx200.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9423361

Please sign in to comment.