]> git.baikalelectronics.ru Git - kernel.git/commit
net: macb: Change interrupt and napi enable order in open
authorHarini Katakam <harini.katakam@xilinx.com>
Tue, 7 May 2019 14:29:10 +0000 (19:59 +0530)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 May 2019 19:26:40 +0000 (12:26 -0700)
commit5bad47818ac5b44e4f1e271279aca4739a528c51
tree395f6914080e5e7bd294ed7b54a2f3924d3b8c57
parent27ec44380fab1d728707e60edba7f1042f6cbb83
net: macb: Change interrupt and napi enable order in open

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: 39f1cb2c2ea3 ("net: macb: Added support for many RX queues")
Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb_main.c