Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
net: macb: Change interrupt and napi enable order in open
Browse files Browse the repository at this point in the history
Current order in open:
-> Enable interrupts (macb_init_hw)
-> Enable NAPI
-> Start PHY

Sequence of RX handling:
-> RX interrupt occurs
-> Interrupt is cleared and interrupt bits disabled in handler
-> NAPI is scheduled
-> In NAPI, RX budget is processed and RX interrupts are re-enabled

With the above, on QEMU or fixed link setups (where PHY state doesn't
matter), there's a chance macb RX interrupt occurs before NAPI is
enabled. This will result in NAPI being scheduled before it is enabled.
Fix this macb open by changing the order.

Fixes: ae1f2a5 ("net: macb: Added support for many RX queues")
Signed-off-by: Harini Katakam <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
harini-katakam authored and davem330 committed May 7, 2019
1 parent ff6ab32 commit 0504453
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/cadence/macb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2461,12 +2461,12 @@ static int macb_open(struct net_device *dev)
goto pm_exit;
}

bp->macbgem_ops.mog_init_rings(bp);
macb_init_hw(bp);

for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue)
napi_enable(&queue->napi);

bp->macbgem_ops.mog_init_rings(bp);
macb_init_hw(bp);

/* schedule a link state check */
phy_start(dev->phydev);

Expand Down

0 comments on commit 0504453

Please sign in to comment.