🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24287

[PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues

#24287
From: Cristian Ciocaltea
Date: Mon, 30 Nov 2026 00:55
68 lines
11725 bytes
While refactoring the Aeonsemi AS21xxx driver to prepare support for the
2nd PHY generation, a number of bugs were found in the existing code,
all dating back to its initial support commit.

Fix them in this series, which was developed and tested on Gen2
hardware, and additionally verified on an Airoha AN7583 evaluation board
with a Gen1 (AS21010JB1) PHY, running a 6.12.94 OpenWrt based kernel.

Note the first two patches were cherry-picked from [1] to avoid bringing
in a partial dependency, since the remaining patches in that series had
to be replaced in order to address all the corner cases.

In more detail, the series covers:

- Link status, speed and duplex reporting: avoid reporting link up with
  a stale speed while autoneg is restarting; fix the speed status mask
  and the 10M status value (the mask bug had been hiding the latter);
  read speed from VEND1_SPEED_STATUS on the autoneg path too and derive
  duplex from the link partner abilities; read 10/100/1000 link modes
  from the Clause 22 advertisement.

- Autoneg advertisement: the PHY doesn't fully support the C45 AN
  registers written by phylib, which can break the link when restricting
  the advertisement.  Implement .config_aneg via the firmware IPC
  command, which takes only a top speed, and reflect the result in
  phydev->advertising.

- IPC mailbox robustness: don't write the reply to a NULL buffer, take
  ipc_lock before writing the payload, check payload write errors, and
  reject odd payload lengths.

- Bounds and validation: handle odd-length firmware without reading out
  of bounds, fix the off-by-one LED index check, and return -EOPNOTSUPP
  for unsupported LED hw control rules instead of overwriting the LED
  configuration.

- Reset handling: release the PHY reset before reading the ID in
  .match_phy_device(), so rebinding the driver no longer leaves the PHY
  stuck in reset.

[1] https://lore.kernel.org/all/20261028073024.25175-1-ansuelsmth@gmail.com/

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
Christian Marangi (2):
      net: phy: as21xxx: handle stale link status during autoneg
      net: phy: as21xxx: handle odd firmware on loading

Cristian Ciocaltea (12):
      net: phy: as21xxx: Fix LED index bounds check
      net: phy: as21xxx: Use the correct mask for the speed status
      net: phy: as21xxx: Correct the 10M speed status value
      net: phy: as21xxx: Do not write the IPC reply to a NULL buffer
      net: phy: as21xxx: Write IPC payload under ipc_lock
      net: phy: as21xxx: Handle IPC payload write errors
      net: phy: as21xxx: Reject odd IPC payload lengths
      net: phy: as21xxx: Fix LED hw control set for unsupported rules
      net: phy: as21xxx: Read 10/100/1000 link modes from C22 advertisement
      net: phy: as21xxx: Configure autoneg advertisement via IPC
      net: phy: as21xxx: Fix speed and duplex reporting
      net: phy: as21xxx: Release reset before reading ID in match

 drivers/net/phy/as21xxx.c | 496 +++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 420 insertions(+), 76 deletions(-)
---
base-commit: fad0d57b12f6979bc0127f0a4f704c6d7177ca78
change-id: 20261129-as21xxx-fixes-e934adae8841
Technical Details
Message-ID: <20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc@collabora.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373735-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373735-linux-kernel-netdev=dewy.ru
From: cristian.ciocaltea@collabora.com (Cristian Ciocaltea)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues
Date: Mon, 30 Nov 2026 02:55:07 +0200
Organization: Usenet Network
Message-ID: <20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc@collabora.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1297761"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:RCfGduFGEwqmmF95rkfSgey0ynM= sha256:U33dL4VfVuf5Vqy0wjBjTml6InavjyD1OTAbG68p+Wc=
	sha1:E4wzSimBlpBLIYhSGmjr2GKvu6g= sha256:rAWCkHDOHp0et8nVk48QzIL+02udHaOptkMEJgH2Z5s=
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 957ED125FC0; Mon, 30 Nov 2026 03:56:01 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-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=pass (2048-bit key)
	header.d=collabora.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 B6By5xAswxgd;
	Mon, 30 Nov 2026 03:55:58 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373735-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=collabora.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 1BB97125FB8; Mon, 30 Nov 2026 03:55:47 +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 ECFFE24E37; Mon, 30 Nov 2026 00:55:43 +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=1796000142;
	b=x2CneXhyHAEdNfc0A5A/OxZxN01W9Qvka2fe56oIn0rN7YUdPNBmfKzdrlj5+Gzyg24X
	 mEcTiaeNwV7oKAZdCWxN4A2gNeiFv05lCfaOrFaNYPTNL1lcdT74cN4lN6SoReeSQ3bnq
	 Ci6oo+oGecjV5vxQoiqnBm6QTRkDFCrCDLnYo2w5ZN7JlKK/A3vEZe6h4JA++KBYw1b5K
	 /fq5vBc1HRDW20gZml8qalUkGP7SzsgeqqlDTyO3sJQsSba2PB3pVqg5LOb9YPaRdOTOw
	 o0sWOo44GkI6yLLumto5n+Opq0E496jho1vxt4k2NLD2sH3USMNl8BZN7HO6ZbPzwuw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796000142;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:
	 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:X-B4-Tracking:X-Change-ID:To:
	 Cc:X-Mailer;
	bh=n7SCMwobdv12kx8EZqSS9I5UqysAiptP/g2RUPDoXYQ=;
	b=fFz1766YMBEXH0+o0nR0BcBWXoFzUxCVYY0JziPDQgnYSUU+RKG/d/gO5zPzgrlILcii
	 6AyZYTE5zeut/M+RMywv4lCjZRP5Xk3PTVX/JJw5Tu+kPEEEzVB5LYK9kIUWBKKWe/+cO
	 bklPzvA9F0ZYsQqjPTV17rFDKIEn8uJP/UYu0u49QVootpQvsok7vgg837QSVl03xQuQe
	 mX46O+Po5H5UiX5pxlb0yy5zDid8xTcedlD825ZP7H4xAS8d8klqrdhzQpr3vXlT5+D6l
	 HZTmvS0D2IvOrYf7op7yAOWJMfALDM1XCziYFh6Uri+RuPhzL05erbWb5XE2RM+y3eA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=AXMeIJUP;
	dmarc=pass header.from=collabora.com;
	spf=pass smtp.mailfrom=collabora.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 D6A05606A33F;
	Mon, 30 Nov 2026 00:55:42 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=AXMeIJUP
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=148.251.105.195
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796000142;
	b=jXCbPezQbQ7NQeZS/IanaGDCOHuoj3SPcbe575Bb53nFUh+Rg3Bq2zuchDOIQ2AO1sm5
	 GjJgzQJap2WyyNWXN+3ns2Z10F9qDaqUNK3F19+m5NkQW/3vGt8cexXlkrrAIoy2C7Hh3
	 HgX1vW+hvTixS8zE3K0QaC/WjdquOF+gCIcdgUSCKLnhe6fkUOOXeJyBZa5HiYgolSpQA
	 80JLs49CdasOrOnHV4kn5ebYGVDZ4ihxerECYFyB3zLzwIB1/Jm/pvSdn1MGXpNRjrp95
	 1bmrVRc7hpHaY1uhcKeTJR+/ZgLjIqcvlx6xST06E3gqrReBIHMKe3bRL1h05864sMQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796000142;
	h=DMARC-Filter:DKIM-Signature:Received:From:Subject:Date:Message-Id:
	 MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking:
	 X-Change-ID:To:Cc:X-Mailer;
	bh=n7SCMwobdv12kx8EZqSS9I5UqysAiptP/g2RUPDoXYQ=;
	b=esnuMWeLaW5+HGSAZWf6AFKgrjMdWV0ecflGqM/HZcccc5e+TrR45KUWl77B/9pZIYQA
	 xJKfhJ7/OPGP2Hs5vvDBkBHvrf+SJ3ytA+qKWuEGx4Fo9haz5ybkqWLiH3QlfaEN+rTXO
	 YRleG/rs8CUXcJpL1COcxhPoqYFGkxvtnc5kKEzq1KOHir3VVikMT6epR9LNlyXZc8BtD
	 VRr0wrkujeAf/zOFKLfeq7QNb9iGWZevAFdACESx9McJaYEkay6tNeOv+9vuDRUfUx+mA
	 uKKSb0IxZ3k9S/GbcA6NIRfdkggrdc72+STFeqBIqfGluV2UFcC61NF+PrCCcY7HMXQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=collabora.com;
	spf=pass smtp.mailfrom=collabora.com;
	dkim=pass header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=AXMeIJUP;
	arc=none smtp.remote-ip=148.251.105.195
X-Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id D98F2606A325
	for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 00:55:40 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D98F2606A325
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;
	s=mail; t=1796000132;
	bh=Oj02N9NMUnrn1NfZCDzan/IX/ZY+VYVF4aAs8n1SRMk=;
	h=From:Subject:Date:To:Cc:From;
	b=AXMeIJUP5bvvJq372JSDiVdtL2gJWYnaPGU7NJypLDwjcWEotoeaWo3gH85MlGSFm
	 WxpCcWTbbyOe1toxBrJur7U5kESAbRKPpnfhiUZIAqn+Rr2pg3v6TwU+HIPbrp4DYR
	 WHjbTnW8O3/cCpGf8OmEpx8J/Su65wHDSeSTUrDXBdUpyXCfnY/I+MEElxVrRv8BD1
	 fWn3pkZhP4aNlAW3hfh6tQfAn43aMPNDgGUJynehgwtRzwjqQCMEz5tX0KFfYDdIL9
	 oqGRBwai5VaWrUr3TamFq2wmCEQ4AKwZNSHJnt5Ee/T51gy1F8XTbpPTlLZSxRI3q5
	 AX8r7Qv/lYr+w==
X-Received: from localhost (unknown [100.64.0.241])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	(Authenticated sender: cristicc)
	by bali.collaboradmins.com (Postfix) with ESMTPSA id 634AB17E07C5;
	Mon, 30 Nov 2026 01:55:32 +0100 (CET)
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
X-B4-Tracking: v=1; b=H4sIAAAAAAAC/yWMQQ6CMBREr0JmbRN+JQa8inFRYZTPoph+NE0Id
 6fo8r3JmxXGpDRcqxWJXzWdYwE5VejHEF90OhSGr/1FxHcumJecs3tqpjl25yYMgW3bCErzTvw
 NJbkhcsH9L+3zmNgvxxO2bQfA/lYadgAAAA==
X-Change-ID: 20261129-as21xxx-fixes-e934adae8841
X-Cc: kernel@collabora.com, netdev@vger.kernel.org, 
 Maxime Chevallier <maxime.chevallier@bootlin.com>
X-Mailer: b4 0.15.2