]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerPaolo Pisati <paolo.pisati@canonical.com>
Wed, 9 Mar 2022 14:17:56 +0000 (15:17 +0100)
commit1ea4043aa7bc7e5d9732c9264c4f1458ebc71c79
tree0bc7f4fa253416a13eef98a5a32609ac042d796d
parent072a95fd5b52e8ca0a0a0eaf445780a2766d4ed3
net: stmmac: only enable DMA interrupts when ready

BugLink: https://bugs.launchpad.net/bugs/1964361
[ Upstream commit 087a7b944c5db409f7c1a68bf4896c56ba54eaff ]

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: 523f11b5d4fd72efb ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c