From: Ian Rogers <irogers@google.com>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, Elkin Cruz <elkin@google.com>,
Ian Rogers <irogers@google.com>
Subject: [PATCH net] niu: write back TXC_INT_MASK in niu_txc_set_imask()
Date: Thu, 19 Nov 2026 09:06:23 -0800 [thread overview]
Message-ID: <20261119170623.1519909-1-irogers@google.com> (raw)
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
reply other threads:[~2026-11-19 17:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261119170623.1519909-1-irogers@google.com \
--to=irogers@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=elkin@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®