🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #11953

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

#11953
From: Yuehong Wu
Date: Fri, 06 Nov 2026 02:02
53 lines
11017 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.

Found by code review while comparing the bit mapping against
adin1110_port_rx_ready().  I do not have access to ADIN1110 or ADIN2111
hardware, so this was only compile-tested (CONFIG_ADIN1110=m, x86_64),
not exercised on a device.

Fixes: bc93e19d088b ("net: ethernet: adi: Add ADIN1110 support")
Signed-off-by: Yuehong Wu <wuyuehong@cmss.chinamobile.com>
---
v2 -> v3: no code change.  Cc the ADI commit-signers that
get_maintainer.pl reports once a git history is available (Nuno Sa,
Heiner Kallweit, Chen Ni).  Thanks to Andrew Lunn for pointing out that
Nuno was missing.

v2:
- Cc the netdev maintainers, as flagged by the cc_maintainers CI check on v1.
- Explain how the issue was found and that the change was only compile-tested,
  no hardware access (netdev guideline for patches found by code review).
v1: https://lore.kernel.org/all/20261103-adin1110-net-stop-1-yuehongwu@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
Technical Details
Message-ID: <20261106-adin1110-net-stop-v3-1-yuehongwu@cmss.chinamobile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357697-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357697-linux-kernel-netdev=dewy.ru
From: wuyuehong@cmss.chinamobile.com (Yuehong Wu)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v3] net: ethernet: adi: adin1110: mask the RX IRQ of the port being stopped
Date: Fri, 06 Nov 2026 10:02:51 +0800
Organization: Usenet Network
Message-ID: <20261106-adin1110-net-stop-v3-1-yuehongwu@cmss.chinamobile.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3774750"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:+vWFK3bn1VeryzkflhA29rYzXRw= sha256:orKztAfUc8htij+0Hz/wrilHZ5Aor8F1RIxL4K8kBYU=
	sha1:Hc2s3/3X12vMUsqURLV7ifuhpPc= sha256:lrbphFBe9SH5lF6djmE/N3MGGy59bQcCrfYz0KMcjgs=
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 1B34711312A; Fri,  6 Nov 2026 05:03:47 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.751
X-Spam-Status: No, score=-2.751 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_INVALID=0.1, DKIM_SIGNED=0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=fail (1024-bit key)
	reason="fail (body has been altered)" header.d=cmss.chinamobile.com
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 qUoXJBFBn2Yy;
	Fri,  6 Nov 2026 05:03:42 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-357697-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=cmss.chinamobile.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 6D6251130FA; Fri,  6 Nov 2026 05:03:32 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 3BD1F2A108; Fri,  6 Nov 2026 02:03:21 +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=1793930601;
	b=VnrKNGe8/N7iVWuxNGNINKkvmcjmtadz3TPFv41hYIXI43z9f96S+PUf8vH1CO5t88nu
	 S+8u3YSuSZHmaTvaRQCqz6y3rjks3DCoSRzQuke5Jq06yidq3ISb1brRo60G9/pF8qE/N
	 4sy/Lzb0l/J2ddpw4NiCuIoElPoZYt9nQVsL/YG76O7S7u4MpENP5xIbnrbmZuDquu9cv
	 sUVrnb/FK7NCW1wE8vGqjifYFwIl/I3uI/xgxgb3qu1Y19VVsLxN86AKZ+q9SjXGSBTPm
	 YO8QgMqgxHomkgmiJ0KXnaolEuQ/kK/qvdlXgVWc2S1TK9tcHj/V6sa56RUE6p0Chpg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793930601;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:X-RM-TagInfo:
	 X-RM-SPAM-FLAG:Received:X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG:
	 Received:X-RM-TRANSID:From:To:Cc:Subject:Date:Message-ID:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=a5+XHx9VkmMYhdeQ2fq6mtWIZa8h3SwrC9yL/0CDbts=;
	b=aUrt54AWBY/ABk769CPxLTjOytNrAfEkie/mMq27/dI8mugl1HIeq8IglHcn7kI0PIu1
	 rpy+uajC1tuEIadNg5vpBz4Z35fHOR6r2x6XUqI+vHH2pGvELJbEK8Ne0BWIiwIKqoBX7
	 J4KDrmtib5pl4JEadXsrIF5VsCspjTZZNKiw3Kw6MUxz4r77LCHmMQfuUVDYeS1zc7+yy
	 qNW2UEDjQAetaLlkOvxBHJ3XKRlOfnSgeEFVop7zB2dDP7x0ZeBxi56OWLL5vmG4Zdpp8
	 b9qqZXyDRFlZ25HNlOElcN/NQOM47p/ejJ3H99zNUuT1PmYFNBU6OVJtDeczHFUoosw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=ppqx8sxJ;
	dmarc=pass header.from=cmss.chinamobile.com;
	spf=pass smtp.mailfrom=cmss.chinamobile.com;
	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 10C9E606A332;
	Fri,  6 Nov 2026 02:03:21 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=ppqx8sxJ
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=111.22.67.139
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793930599;
	b=UNk47fny5ZTYAx30wZshpUY2++5K2K/QvvvYL3JEEv6E8VpyExNcgE6PkGAEOaizwFb+
	 pt1l4xXVcK0JfXpa3ju8PtKhol0cJVup+vCJfDeTVHiHHp1KLbs5aP3hOOLq+kzptUL38
	 QBUPeb5kVKICnpmqI49Rnchfoc03M/d4VED9u16vCRB/l3qVxMdRgHkGJ8GUZG7/r0yy/
	 MIpYGfUO4DAbb2BAbaUuXlaicPf4W1wsh6fNdaY0VsZqb1Hit5CPjrhCk4zYxdMSkZJBz
	 Y7Ay9I0ln2bQqxsep7+gFPuhgHrA+GJU6AcCgtja/MAyMF9F2EBIxSYUhtv8X88RT9g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793930599;
	h=DMARC-Filter:DKIM-Signature:X-RM-TagInfo:X-RM-SPAM-FLAG:Received:
	 X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG:Received:X-RM-TRANSID:From:
	 To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=a5+XHx9VkmMYhdeQ2fq6mtWIZa8h3SwrC9yL/0CDbts=;
	b=qc96gG1UglocMUownRzeKJ86glxdLVy3inp+9B9RhGmHwOeQkSO3orL7bOQbRC1DLBIl
	 Oig/wzmFECOAGFICINxmw11lVjXG745kB4Ac5qvy+QVhm+DqwIxoB9MaoE75quIKQJwyx
	 CBTRUloooGeH18vtf4MuZfN03opxAy12kvU72OKO1LbiAAu2UdIQnUvOXWjY0Goft4E9o
	 EUkdgxX4IbvejGjAJsAg4MSpp3MoXDhjGh2jns5itvX9sCzPm1NZCEOb0/bAroh5/ki/K
	 3JQupgwLpvQDj+2NVL51wFl1cG2jC2F6DCkhEV+EleVrpX1FQM0942aDuvuBtszxahg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=cmss.chinamobile.com;
	spf=pass smtp.mailfrom=cmss.chinamobile.com;
	dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=ppqx8sxJ;
	arc=none smtp.remote-ip=111.22.67.139
X-Received: from cmccmta6.chinamobile.com (cmccmta6.chinamobile.com [111.22.67.139])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id F2A9C606A31B;
	Fri,  6 Nov 2026 02:03:16 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F2A9C606A31B
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmss.chinamobile.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmss.chinamobile.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=cmss.chinamobile.com; s=default; l=0;
	h=from:subject:message-id:to:cc:mime-version;
	bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=;
	b=ppqx8sxJ8Y1oVubf3Xg5bguV+QMQxKmL+cCdlXzbu0LgBP86xeJ3+F7UTxJ2uAknIGRcpIL9bXeWi
	 pMyyWqk87dpvk62JNYUvKSGXZlggWNdgxSR8TqC4ijC0wLHPLg04zA3sbRXinwDTDpZZTrbE6SWs0F
	 INzD1jQm3raEDvMM=
X-RM-TagInfo: emlType=0                                       
X-RM-SPAM-FLAG: 00000000
X-Received: from spf.mail.chinamobile.com (unknown[10.188.0.87])
	by rmmx-syy-dmz-app09-12009 (RichMail) with SMTP id 2ee96aed35621f5-b01d6;
	Fri, 06 Nov 2026 10:03:14 +0800 (CST)
X-RM-TRANSID: 2ee96aed35621f5-b01d6
X-RM-TagInfo: emlType=0                                       
X-RM-SPAM-FLAG: 00000000
X-Received: from cmss.chinamobile.com (unknown[10.55.1.72])
	by rmsmtp-syy-appsvr01-12001 (RichMail) with SMTP id 2ee16aed3561424-0d505;
	Fri, 06 Nov 2026 10:03:14 +0800 (CST)
X-RM-TRANSID: 2ee16aed3561424-0d505
X-Cc: 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>, Kees Cook <kees@kernel.org>, nuno.sa@analog.com, Heiner Kallweit <hkallweit1@gmail.com>, Chen Ni <nichen@iscas.ac.cn>, "Alexandru Tachici" <alexandru.tachici@analog.com>, Lennart Franzen <lennart@lfdomain.com>, linux-kernel@vger.kernel.org
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