From: netdev-bot+sashiko@kernel.org
To: wuyuehong@cmss.chinamobile.com
Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, kees@kernel.org, nuno.sa@analog.com,
hkallweit1@gmail.com, nichen@iscas.ac.cn,
alexandru.tachici@analog.com, lennart@lfdomain.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v3] net: ethernet: adi: adin1110: mask the RX IRQ of the port being stopped
Date: Tue, 10 Nov 2026 05:04:37 +0000 [thread overview]
Message-ID: <179428707736.994134.3917076046074725088@kernel.org> (raw)
In-Reply-To: <20261106-adin1110-net-stop-v3-1-yuehongwu@cmss.chinamobile.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The patch fixes the bit mapping in adin1110_net_stop(), but on
ADIN2111 a stopped port's RX-ready interrupt can still end up unmasked.
--
net: ethernet: adi: adin1110: mask the RX IRQ of the port being stopped
This commit swaps the RX-ready interrupt bits used in adin1110_net_stop().
With the swap, the port being stopped masks its own RX interrupt in
ADIN1110_IMASK1 and no longer masks its peer's. The commit message says
the old mapping left the stopped port's interrupt unmasked, so it kept
firing with nobody draining the FIFO.
> diff --git a/drivers/net/ethernet/adi/adin1110.c b/drivers/net/ethernet/adi/adin1110.c
> index 53fac3dc8be62..abdc16089c9e3 100644
> --- a/drivers/net/ethernet/adi/adin1110.c
> +++ b/drivers/net/ethernet/adi/adin1110.c
> @@ -945,7 +945,7 @@ static int adin1110_net_stop(struct net_device *net_dev)
> u32 mask;
> int ret;
>
> - mask = !port_priv->nr ? ADIN2111_RX_RDY_IRQ : ADIN1110_RX_RDY_IRQ;
> + mask = !port_priv->nr ? ADIN1110_RX_RDY_IRQ : ADIN2111_RX_RDY_IRQ;
[Severity: Medium]
On ADIN2111, can a stopped port's RX-ready interrupt still be unmasked
again when the other port is opened?
The bit set here is only kept in hardware. Nothing records it per port,
and priv->irq_mask is not updated. adin1110_net_open() does not do a
per-port read-modify-write. It rewrites the whole register with both
ports' RX bits:
drivers/net/ethernet/adi/adin1110.c:adin1110_net_open() {
...
val = ADIN1110_TX_RDY_IRQ | ADIN1110_RX_RDY_IRQ | ADIN1110_SPI_ERR_IRQ;
if (priv->cfg->id == ADIN2111_MAC)
val |= ADIN2111_RX_RDY_IRQ;
priv->irq_mask = val;
ret = adin1110_write_reg(priv, ADIN1110_IMASK1, ~val);
...
}
Here is one way to reach this:
ip link set port0 down (net_stop masks ADIN1110_RX_RDY_IRQ)
ip link set port1 down
ip link set port1 up (net_open clears it again)
Port 0 is still down at the end, but its RX-ready source is unmasked.
Frames can reach port 0's RX FIFO between the IMASK1 write in
adin1110_net_stop() and phy_stop(). Once the port is no longer oper-up,
nothing drains those frames:
drivers/net/ethernet/adi/adin1110.c:adin1110_port_rx_ready() {
if (!netif_oper_up(port_priv->netdev))
return false;
...
}
After port 1's open unmasks the bit, the interrupt is requested with
IRQF_TRIGGER_LOW | IRQF_ONESHOT. Would adin1110_irq() then run over and
over? It skips port 0 and only acknowledges the status:
adin1110_write_reg(priv, ADIN1110_STATUS1, priv->irq_mask);
This assumes STATUS1.RX_RDY stays asserted while the FIFO holds data,
which is how adin1110_read_frames() treats it.
If so, this is still reachable on ADIN2111 through the peer's open:
"the stopped port also keeps re-raising its interrupt with nobody
draining the FIFO"
Should adin1110_net_open() unmask only its own port's RX bit with a
read-modify-write, and keep priv->irq_mask consistent per port? On
ADIN1110 there is only one port, so the change looks complete there.
>
> /* Disable RX RDY IRQs */
> mutex_lock(&priv->lock);
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261106-adin1110-net-stop-v3-1-yuehongwu%40cmss.chinamobile.com
next prev parent reply other threads:[~2026-11-10 5:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 11:47 [PATCH net] " Yuehong Wu
2026-11-03 11:53 ` netdev-bot+sinfo
2026-11-03 12:09 ` Yuehong Wu
2026-11-05 1:41 ` [PATCH net v2] " Yuehong Wu
2026-11-05 16:04 ` Andrew Lunn
2026-11-06 1:07 ` Yuehong Wu
2026-11-06 2:02 ` [PATCH net v3] " Yuehong Wu
2026-11-06 17:00 ` Nuno Sá
2026-11-08 4:05 ` [PATCH net v4] " Yuehong Wu
2026-11-10 5:04 ` netdev-bot+sashiko [this message]
2026-11-09 1:54 ` [PATCH net v2] " netdev-bot+sashiko
2026-11-07 14:34 ` [PATCH net] " netdev-bot+sashiko
2026-11-08 4:06 ` Yuehong Wu
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=179428707736.994134.3917076046074725088@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=alexandru.tachici@analog.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hkallweit1@gmail.com \
--cc=kees@kernel.org \
--cc=kuba@kernel.org \
--cc=lennart@lfdomain.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nichen@iscas.ac.cn \
--cc=nuno.sa@analog.com \
--cc=pabeni@redhat.com \
--cc=wuyuehong@cmss.chinamobile.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®