Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by James Hilliard
Tue, 13 Oct 2026 17:37
[PATCH net-next v3] net: stmmac: unwind the WoL IRQ after a safety IRQ request failure
Author: James Hilliard
Date: Tue, 13 Oct 2026 17:37
Date: Tue, 13 Oct 2026 17:37
64 lines
10940 bytes
10940 bytes
The safety IRQ is requested after the MAC and optional WoL IRQs. If its request fails, stmmac_free_irq() frees the unregistered safety IRQ and leaks the WoL handler. This can warn about an already-free IRQ and make the next open fail. Move the safety and WoL cleanup labels into reverse acquisition order. This was found by code inspection while working on the stmmac MTU/resume recovery series. Injecting a safety IRQ request failure in QEMU with mocked MAC/DMA hardware reproduced the "Trying to free already-free IRQ" warning and leaked WoL handler. The failure has not been observed without fault injection. Signed-off-by: James Hilliard <james.hilliard1@gmail.com> Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> --- Changes in v3: - Rebase onto net-next and drop the Fixes tag as requested. - Describe how the issue was found and reproduced in the commit message. - Add Maxime Chevallier's Reviewed-by. - No code changes. - Link to v2: https://patch.msgid.link/20261006-stmmac-irq-unwind-v2-1-194591c87460@gmail.com Changes in v2: - Drop the claim that later per-queue IRQ failures also had broken cleanup; those paths already released both IRQs. - Add Nicolai Buchwitz's Reviewed-by. - Link to v1: https://patch.msgid.link/20260930-stmmac-irq-unwind-v1-1-0c8a053761c7@gmail.com --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 56d89a696272..3ce2d5994c61 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3821,13 +3821,13 @@ static void stmmac_free_irq(struct net_device *dev, free_irq(msi->sfty_ce_irq, dev); fallthrough; case REQ_IRQ_ERR_SFTY_CE: - if (priv->wol_irq > 0 && priv->wol_irq != dev->irq) - free_irq(priv->wol_irq, dev); - fallthrough; - case REQ_IRQ_ERR_SFTY: if (priv->sfty_irq > 0 && priv->sfty_irq != dev->irq) free_irq(priv->sfty_irq, dev); fallthrough; + case REQ_IRQ_ERR_SFTY: + if (priv->wol_irq > 0 && priv->wol_irq != dev->irq) + free_irq(priv->wol_irq, dev); + fallthrough; case REQ_IRQ_ERR_WOL: free_irq(dev->irq, dev); fallthrough; --- base-commit: 05b5019b01fb9443b09ae4ed34af1135a80a84c8 change-id: 20260930-stmmac-irq-unwind-0be86901638d Best regards, -- James Hilliard <james.hilliard1@gmail.com>
Re: [PATCH net-next v3] net: stmmac: unwind the WoL IRQ after a safety IRQ request failure
Author: patchwork-bot+netdevbpf
Date: Mon, 19 Oct 2026 13:40
Date: Mon, 19 Oct 2026 13:40
24 lines
6513 bytes
6513 bytes
Hello:
This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Tue, 13 Oct 2026 11:37:11 -0600 you wrote:
> The safety IRQ is requested after the MAC and optional WoL IRQs. If its
> request fails, stmmac_free_irq() frees the unregistered safety IRQ and
> leaks the WoL handler. This can warn about an already-free IRQ and make
> the next open fail.
>
> Move the safety and WoL cleanup labels into reverse acquisition order.
>
> [...]
Here is the summary with links:
- [net-next,v3] net: stmmac: unwind the WoL IRQ after a safety IRQ request failure
https://git.kernel.org/netdev/net-next/c/ecb8b18051a1
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads