]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: only enable DMA interrupts when ready
authorVincent Whitchurch <vincent.whitchurch@axis.com>
Thu, 24 Feb 2022 11:38:29 +0000 (12:38 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Feb 2022 10:34:22 +0000 (10:34 +0000)
commit2deea1397af47ad0e5aa9bca3a292c01b39425c1
tree26f7ea9bf28b01add917117bfeee47155bd17b5b
parent74a941fb101efc78e8f7448c6ebde2e58ca3b83c
net: stmmac: only enable DMA interrupts when ready

In this driver's ->ndo_open() callback, it enables DMA interrupts,
starts the DMA channels, then requests interrupts with request_irq(),
and then finally enables napi.

If RX DMA interrupts are received before napi is enabled, no processing
is done because napi_schedule_prep() will return false.  If the network
has a lot of broadcast/multicast traffic, then the RX ring could fill up
completely before napi is enabled.  When this happens, no further RX
interrupts will be delivered, and the driver will fail to receive any
packets.

Fix this by only enabling DMA interrupts after all other initialization
is complete.

Fixes: c745529e05c8187b2 ("net: stmmac: move hardware setup for stmmac_open to new function")
Reported-by: Lars Persson <larper@axis.com>
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c