mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] niu: write back TXC_INT_MASK in niu_txc_set_imask()
@ 2026-11-19 17:06 Ian Rogers
  0 siblings, 0 replies; only message in thread
From: Ian Rogers @ 2026-11-19 17:06 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: netdev, linux-kernel, llvm, Elkin Cruz, Ian Rogers

niu_txc_set_imask() acquires the parent lock, reads TXC_INT_MASK into
'val', updates the port's interrupt mask bits in 'val', and unlocks
without writing 'val' back to TXC_INT_MASK, making the function a hardware
no-op and leaving per-port TXC error interrupts masked.

Write 'val' back with nw64(TXC_INT_MASK, val) before unlocking, matching
niu_txc_enable_port() immediately above it.

Found via an x86_64 LLVM=1 (Clang 21.1.8) allyesconfig audit with
-Wunused-but-set-variable enabled; fix and changelog drafted with an AI
coding assistant. Build-tested under LLVM=1 W=1 and
-Wunused-but-set-variable; not tested on Sun Neptune 10GbE hardware.

Fixes: a3138df9f20e ("[NIU]: Add Sun Neptune ethernet driver.")
Signed-off-by: Ian Rogers <irogers@google.com>
---
 drivers/net/ethernet/sun/niu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index c74a97fe5464..b2da560edd82 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -4650,6 +4650,7 @@ static void niu_txc_set_imask(struct niu *np, u64 imask)
 	val = nr64(TXC_INT_MASK);
 	val &= ~TXC_INT_MASK_VAL(np->port);
 	val |= (imask << TXC_INT_MASK_VAL_SHIFT(np->port));
+	nw64(TXC_INT_MASK, val);
 	niu_unlock_parent(np, flags);
 }
 
-- 
2.56.1.708.g77570a6a1d-goog


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-19 17:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19 17:06 [PATCH net] niu: write back TXC_INT_MASK in niu_txc_set_imask() Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®