๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13648

Re: [PATCH net v3] net: ethernet: adi: adin1110: mask the RX IRQ of the port being stopped

#13648
From: netdev-bot+sashiko
Date: Tue, 10 Nov 2026 05:04
98 lines
11562 bytes
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
Technical Details
Message-ID: <179428707736.994134.3917076046074725088@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359880-linux-kernel-netdev=dewy.ru
References: <20261106-adin1110-net-stop-v3-1-yuehongwu@cmss.chinamobile.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359880-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
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
Organization: Usenet Network
Message-ID: <179428707736.994134.3917076046074725088@kernel.org>
References: <20261106-adin1110-net-stop-v3-1-yuehongwu@cmss.chinamobile.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="525586"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:OdG+E7D9i6cTBKXDW4RhukxGMNE= sha256:InZssNtauKVR0KyZ0JFuGOi3MjdOnAkABM9m+A+CWOM=
	sha1:b48SJt8fUMVv+FnIekdF8ezCXH4= sha256:e2ukWs6UwPX9cK2hEKKI1NmDkwoXPUDpfZVVS8j2HpU=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id BDBBF113A39; Tue, 10 Nov 2026 08:08:18 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id YqYWW58wRNlr;
	Tue, 10 Nov 2026 08:08:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-359880-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 9CBC5113A11; Tue, 10 Nov 2026 08:08:01 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 28F17640A4E; Tue, 10 Nov 2026 05:06:41 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794287100;
	b=GIi680/wMamVSG2qp6LNuuIEGlZeMKmaaoa275DerQo31myKRqO4/VPgJo7Wu53qnvIB
	 YAnlC0uyiBBWcPZf39xKkIfTGwl6C0gTk+gqVgi+H+Tl0met/voGOxHOt82dfVyKTjoEK
	 3rqIsgN9l3gG/IJQQHUTSm+dXEUix0kx0jUDpJMlTdmiV7En1jFMKTcWSRK7haJoPESJN
	 1JPPGvNYbmYOzvjSARey5QQr28RdBS8ysGBcv2z7PmnSnMs9OAseWo42MIsFYA9lyF/6D
	 TRyT4aIyx945e0pmIpmB0mZeuK4RJvd056OQD6ePC+I3XTA/IkVzyLpJpdWYw5nrknw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794287100;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=jXeGcKc5lyVio5sQ0M5A2Xgx0Qjt+eDjTJW1dRcHGgk=;
	b=R0fGMB2qIHJbcvg+TvphAAHtKHnICj4W7HEw1r9UKH7dRpl6JvvZYpUG8s0wzIBMaul7
	 n8NGOqGVYhS+7hM8blRFCM5wV0dw6WdvC7o2V/Yrsfkw0xLWJ4GDpbhuJqKJdXPLdtYCs
	 kGMNy8cSvzWRPSnuSkdAJPQGZ/1b8rEqcTyEJNo+Dh3NxlsZ/3pWqS3OWMviJSvpx9Xlh
	 IyMOHo6dQIhyo/6bCsW/o0+LGIoD31Nn64Qs1ETU4xIgZg1CIrenmqc1ClgrmnWwg+xDK
	 RMx2qinIeR8YVSQsw+v7ELRSL0c4chbOrEspk5TpAZUg15z4+wlG5YrZvOYJsLwVPKg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=V7Co3OEs;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 04429606D6B1;
	Tue, 10 Nov 2026 05:05:00 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=V7Co3OEs
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794287079;
	b=lVsYrPirONJWkuZ4TRnPU/ZNqc+bHbSqDZ683fPsJcdNgG9A/tCGnGDTeWKnbmTUWOb4
	 fxl3ahAon3d9QhpnuxM5EFenoJODIXJMjC4lNJ6lk3fOxAXpdkRaJFSzP/JJWonmtkakS
	 +S1AvJbGMaWJgSM08kSC1PFrT5aDZ3pHfE5EV00QWd6nHJqEmhaHhO1fVhMKy4UxfhUcJ
	 Kj2Pjfu5zaIzDgdk5FTIqMta3AL1UOgFyRRv8OK/WLI2JcmBTdn8xYx6BLR/Q4PyAhFPV
	 Z1BMYuJdY7UKAw6Vecb10hZzNYf3yGeNN3QXaLb9lI61s4+YhX4aBTSgwBXphyIc4Aw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794287079;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=jXeGcKc5lyVio5sQ0M5A2Xgx0Qjt+eDjTJW1dRcHGgk=;
	b=wYXuF0LzBEyKc7wAj80aUw1WJs3k1jwLPwblNfry8tn29xJN7ctccoXQhPMXmfvBn/LJ
	 tuvcN7PxfVv1C9n0A1g2Xc6YCTyopNWaknctEPYpjguid+gfFECXJ7S6mO5K35FNf8JnU
	 mpa7iRaIy5AV4/gwaAujRbcA52u8os8T6VnUL6Bz3ED+Fve9IidHiVyLspK0XfoCcakNd
	 6MoVZGjFGboodZ8l8Yryl1wl5Rm7h+2+cfN/GWE3WUlJk+GPrUa2+V8oH+t3o6h1xvA6j
	 MtGVABztIMZRedCzwpgbe/n91XEwVouWjsV/u2dpEXVTxpAunLZvYGLWanSO1AzySxw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=V7Co3OEs;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id D26CA606C921;
	Tue, 10 Nov 2026 05:04:38 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C77EC1F0089F;
	Tue, 10 Nov 2026 05:04:37 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794287078;
	bh=jXeGcKc5lyVio5sQ0M5A2Xgx0Qjt+eDjTJW1dRcHGgk=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=V7Co3OEscrdD3IQX/RzBMPRPPx/wNo8IJIk0scvADGHhxJq71tsuydntIZfdww4Fg
	 QQf4iMTfyYnoJawaRic10+jWLxlKqVZXQnCq8L+e75N+2zPLleiyUSJvCMUz/d4KYt
	 qQpNIDBM8JYK7Ms8JROPeHxaZ7X5Oc5KMo+NCRgXy33WQ8Npg44jX1lVh68ArLEzeG
	 Uk33bV3V1oQk6FGsGtTNYC8SOS8j23T0eXfxuuQOLrbhVofUIIy8lsSJ/HFNIlVTr0
	 kSG0KLj3MJvo87YxjTg98xcSJz+JAU9suLHMA6P8FpD9e2zpVuN5p9QZ+gL2+vgxQU
	 ww+Kl9BCIQ6ug==
X-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
X-In-Reply-To: <20261106-adin1110-net-stop-v3-1-yuehongwu@cmss.chinamobile.com>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list