Thread View: linux.kernel.netdev
5 messages
5 total messages
Started by Yuehong Wu
Tue, 03 Nov 2026 11:47
[PATCH net] net: ethernet: adi: adin1110: mask the RX IRQ of the port being stopped
Author: Yuehong Wu
Date: Tue, 03 Nov 2026 11:47
Date: Tue, 03 Nov 2026 11:47
37 lines
9872 bytes
9872 bytes
adin1110_net_stop() programs the RX-ready interrupt mask of the wrong
port: it uses ADIN2111_RX_RDY_IRQ (the second port's bit) when stopping
port 0 and ADIN1110_RX_RDY_IRQ (the first port's bit) when stopping
port 1, while adin1110_port_rx_ready() uses the opposite mapping, port 0
-> ADIN1110_RX_RDY and port 1 -> ADIN2111_P2_RX_RDY.
The port being stopped therefore keeps its own RX interrupt enabled
while the peer's is masked. On ADIN2111 that stalls RX on the peer port;
on ADIN1110 the RX interrupt is never masked at all. As the interrupt is
level triggered and adin1110_read_frames() skips the FIFO while
netif_oper_up() is false, the stopped port also keeps re-raising its
interrupt with nobody draining the FIFO.
Swap the two bits so the port being stopped masks its own interrupt.
Fixes: bc93e19d088b ("net: ethernet: adi: Add ADIN1110 support")
Signed-off-by: Yuehong Wu <wuyuehong@cmss.chinamobile.com>
---
drivers/net/ethernet/adi/adin1110.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/adi/adin1110.c b/drivers/net/ethernet/adi/adin1110.c
index 53fac3d..abdc160 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;
/* Disable RX RDY IRQs */
mutex_lock(&priv->lock);
--
2.43.0
Re: [PATCH net] net: ethernet: adi: adin1110: mask the RX IRQ of the port being stopped
Author: netdev-bot+sinfo
Date: Tue, 03 Nov 2026 11:53
Date: Tue, 03 Nov 2026 11:53
26 lines
8737 bytes
8737 bytes
Hi! This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information: - How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan. - Whether the issue was actually triggered, or is only theoretical (e.g. found by code inspection). If it was triggered please include the symptoms, like the stack trace or error messages. - What hardware the change was tested on. For driver fixes please mention the device (and if relevant firmware version) used for testing, or say that the change was not tested on real hardware. Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. If the series needs another revision for other reasons, please include the information in the commit messages then. The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.
Re: [PATCH net] net: ethernet: adi: adin1110: mask the RX IRQ of the port being stopped
Author: Yuehong Wu
Date: Tue, 03 Nov 2026 12:09
Date: Tue, 03 Nov 2026 12:09
33 lines
9998 bytes
9998 bytes
Hi, Here is the information missing from the changelog: - How the issue was found: during a code review of the driver that was assisted by an AI coding assistant (an LLM). The assistant compared adin1110_net_stop() against the bit definitions and the mapping used by adin1110_port_rx_ready(); I then checked the finding against the register semantics used by adin1110_net_open() (IMASK1: 1 = masked). - Triggered or theoretical: theoretical. I have not triggered it and there is no reproducer. Expected symptoms if it is hit: on ADIN2111, bringing one port down masks the peer port's RX-ready interrupt so the peer stops receiving, while the port that was brought down keeps its own RX interrupt enabled; since the interrupt is level triggered and adin1110_read_frames() skips the FIFO while netif_oper_up() is false, pending frames keep re-asserting it. On the single-port ADIN1110 the RX interrupt is never masked at all. - Hardware: none. The change was not tested on real hardware; it was compile-tested only (CONFIG_ADIN1110=m, x86_64) and passes scripts/checkpatch.pl --strict. Per Documentation/process/generated-content.rst, the tool assistance is noted above. I have reviewed the analysis and the change and take responsibility for them. If another revision is needed, I will fold this information into the commit message. Thanks, Yuehong Wu
Re: [PATCH net] net: ethernet: adi: adin1110: mask the RX IRQ of the port being stopped
Author: netdev-bot+sashiko
Date: Sat, 07 Nov 2026 14:34
Date: Sat, 07 Nov 2026 14:34
94 lines
11380 bytes
11380 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 ยท High: 1 ยท Medium: 0 ยท 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).
- [High] The fix is incomplete: the peer port's ndo_open can re-arm the
RX-ready interrupt of a port that is still down.
--
net: ethernet: adi: adin1110: mask the RX IRQ of the port being stopped
This patch swaps the two RX_RDY bits in adin1110_net_stop(). Each port
now masks its own RX-ready interrupt in IMASK1 when it is stopped, which
matches the bit mapping in adin1110_port_rx_ready().
> 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;
>
> /* Disable RX RDY IRQs */
> mutex_lock(&priv->lock);
[Severity: High]
Is this fix complete? The peer port's open path looks like it can unmask
this bit again while this port is still down.
adin1110_net_stop() masks the bit with a read-modify-write.
adin1110_net_open() does not. It rebuilds IMASK1 from scratch and
unmasks RX_RDY for both ports:
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);
...
}
On ADIN2111, take this sequence:
ip link set eth1 down -> adin1110_net_stop() masks ADIN2111_RX_RDY_IRQ
ip link set eth0 down
ip link set eth0 up -> adin1110_net_open() clears that mask again
eth1 is still down at this point, but its RX_RDY interrupt is enabled
again. A port that was never opened also gets its RX_RDY unmasked as soon
as the other port opens.
For the down port, adin1110_port_rx_ready() returns false:
if (!netif_oper_up(port_priv->netdev))
return false;
So adin1110_irq() never drains that port's FIFO. It only writes STATUS1
with priv->irq_mask and returns IRQ_HANDLED.
The interrupt is requested with IRQF_TRIGGER_LOW. Frames can be left in
the FIFO, for example frames that arrive between the IMASK1 write and
phy_stop(). The commit message describes this exact state: "the stopped
port also keeps re-raising its interrupt with nobody draining the FIFO".
Wouldn't that state still be reachable after this patch?
The handler always returns IRQ_HANDLED, so the spurious IRQ detector
would not disable the line. The threaded handler would keep running SPI
transactions under priv->lock.
Also, priv->irq_mask is overwritten in adin1110_net_open() and never
updated in adin1110_net_stop(). The driver therefore does not track which
ports have RX_RDY masked.
Should adin1110_net_open() unmask only the opening port's RX_RDY bit with
a per-port read-modify-write, like adin1110_net_stop() does? Should the
stopped port's RX FIFO also be drained or flushed on stop?
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261103-adin1110-net-stop-1-yuehongwu%40cmss.chinamobile.com
Re: [PATCH net] net: ethernet: adi: adin1110: mask the RX IRQ of the port being stopped
Author: Yuehong Wu
Date: Sun, 08 Nov 2026 04:06
Date: Sun, 08 Nov 2026 04:06
36 lines
10257 bytes
10257 bytes
Hi Sashiko, Thanks, the finding is correct: adin1110_net_open() writes IMASK1 with an absolute value that includes ADIN2111_RX_RDY_IRQ whenever the chip is an ADIN2111, so opening either port re-enables the RX-ready interrupt of a peer port that is still down and undoes the mask from adin1110_net_stop(). v4 keeps a stopped peer port masked: the peer's bit is only added to the value written to IMASK1 when netif_running() is true for that port. The write stays absolute, so the bit is still enabled while the peer is running, and netif_running() is __LINK_STATE_START, with ndo_open() and ndo_stop() serialised by RTNL. priv->irq_mask keeps its previous value and meaning (the STATUS1 write-one-to-clear mask), so the clearing behaviour is unchanged. IMASK1 is written in exactly two places, both under priv->lock. Single-port ADIN1110 writes exactly the same values as before. On the FIFO question: I do not think it needs to be drained on stop. While the port is down its RX-ready bit is masked, so it cannot raise an interrupt, and whatever is left in its FIFO is drained by adin1110_read_frames() when the port is opened again. Draining in the stop path would mean reading the port FIFO from a second context while the peer may be running. The patch only changes the mask programming; the pre-existing probe-time mask state, the TX/SPI interrupt policy and the operstate gating in adin1110_port_rx_ready() are untouched. Testing: no ADIN1110 or ADIN2111 hardware; compile-tested with gcc, W=1, CONFIG_ADIN1110=m and =y, full kernel builds. Thanks, Yuehong pw-bot: cr
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