* [PATCH net v2] net: txgbe: fix MISC interrupt unmasking in non-MSI-X mode and device shutdown
@ 2026-08-18 2:30 Jiawen Wu
2026-08-22 20:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Jiawen Wu @ 2026-08-18 2:30 UTC (permalink / raw)
To: netdev
Cc: Mengyuan Lou, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Larysa Zaremba, Jiawen Wu,
Simon Horman
In txgbe_misc_irq_thread_fn(), the driver unmasks the miscellaneous
interrupt at the end of the handler using TXGBE_INTR_MISC(wx) (which
resolves to BIT(wx->num_q_vectors)). While this is correct for MSI-X
mode, it is incorrect for legacy INTx or single MSI modes.
Due to hardware behavior, the WX_PX_MISC_IVAR register is completely
ignored by the hardware when MSI-X is disabled. In non-MSI-X mode, the
hardware forcibly merges all interrupt causes (both Queue and MISC) into
a single bit: BIT(0) of the interrupt register.
Unconditionally unmasking TXGBE_INTR_MISC(wx) (e.g., BIT(1)) in non-MSI-X
mode means the actual MISC interrupt bit (BIT(0)) is not unmasked
promptly at the end of the MISC thread. Instead, it remains masked until
NAPI completes its polling and unmasks the shared BIT(0). This delays the
assertion of subsequent MISC interrupts, preventing timely handling of
events like link state changes.
Fix this by explicitly checking `pdev->msix_enabled` and falling back
to BIT(0) as the interrupt mask for the MISC cause when MSI-X is disabled.
Additionally, unconditionally unmasking the interrupt at the end of the
thread introduces a race condition during device teardown. Guarding the
wx_intr_enable() call with a check for the WX_STATE_DOWN bit, to prevent
re-arming the interrupt during device shutdown.
Fixes: e37546ad1f9b ("net: wangxun: revert the adjustment of the IRQ vector sequence")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Simon Horman <horms@kernel.org>
---
Changes in v2:
- Add the checking of WX_STATE_DOWN bit before unmasking the interrupt.
- Link to v1: https://lore.kernel.org/all/59215DA27859BC49+20260813073305.360251-1-jiawenwu@trustnetic.com
---
drivers/net/ethernet/wangxun/txgbe/txgbe_irq.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_irq.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_irq.c
index 8746318ad3bc..5ad1ff7c3ce9 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_irq.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_irq.c
@@ -164,6 +164,7 @@ static irqreturn_t txgbe_misc_irq_thread_fn(int irq, void *data)
struct wx *wx = txgbe->wx;
unsigned int nhandled = 0;
unsigned int sub_irq;
+ u64 misc_mask;
u32 eicr;
eicr = txgbe->eicr;
@@ -183,7 +184,9 @@ static irqreturn_t txgbe_misc_irq_thread_fn(int irq, void *data)
nhandled++;
}
- wx_intr_enable(wx, TXGBE_INTR_MISC(wx));
+ misc_mask = wx->pdev->msix_enabled ? TXGBE_INTR_MISC(wx) : BIT(0);
+ if (!test_bit(WX_STATE_DOWN, wx->state))
+ wx_intr_enable(wx, misc_mask);
return (nhandled > 0 ? IRQ_HANDLED : IRQ_NONE);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net v2] net: txgbe: fix MISC interrupt unmasking in non-MSI-X mode and device shutdown
2026-08-18 2:30 [PATCH net v2] net: txgbe: fix MISC interrupt unmasking in non-MSI-X mode and device shutdown Jiawen Wu
@ 2026-08-22 20:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-22 20:30 UTC (permalink / raw)
To: Jiawen Wu
Cc: netdev, mengyuanlou, andrew+netdev, davem, edumazet, kuba, pabeni,
larysa.zaremba, horms
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 18 Aug 2026 10:30:26 +0800 you wrote:
> In txgbe_misc_irq_thread_fn(), the driver unmasks the miscellaneous
> interrupt at the end of the handler using TXGBE_INTR_MISC(wx) (which
> resolves to BIT(wx->num_q_vectors)). While this is correct for MSI-X
> mode, it is incorrect for legacy INTx or single MSI modes.
>
> Due to hardware behavior, the WX_PX_MISC_IVAR register is completely
> ignored by the hardware when MSI-X is disabled. In non-MSI-X mode, the
> hardware forcibly merges all interrupt causes (both Queue and MISC) into
> a single bit: BIT(0) of the interrupt register.
>
> [...]
Here is the summary with links:
- [net,v2] net: txgbe: fix MISC interrupt unmasking in non-MSI-X mode and device shutdown
https://git.kernel.org/netdev/net/c/7bf29145d7a9
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-22 20:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 2:30 [PATCH net v2] net: txgbe: fix MISC interrupt unmasking in non-MSI-X mode and device shutdown Jiawen Wu
2026-08-22 20:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox