🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24853

Re: [PATCH net-next v23 13/15] dt-bindings: net: pcs: Document support for Airoha Ethernet PCS

#24853
From: netdev-bot+sashiko
Date: Mon, 30 Nov 2026 23:47
234 lines
16448 bytes
Thank you for your contribution! Sashiko AI review found 5 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 2 · Low: 3

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 airoha,an7581-pcs-pcie binding makes the PCS node own the
  PCIe SerDes analog and per-lane PMA blocks.
- [Medium] The binding defines no `resets`/`reset-names` and sets
  `additionalProperties: false` (airoha,pcs.yaml line 176), so any DT…
- [Low] The airoha,an7581-pcs-pcie variant sets "#pcs-cells" to const 1
  (Documentation/devicetree/bindings/net/pcs/airoha,pcs.yaml, line…
- [Low] The commit message and the binding `description` (airoha,pcs.yaml
  lines 12-15) list "10BASE-R" as a supported interface.
- [Low] No MAINTAINERS entry covers the new file
  Documentation/devicetree/bindings/net/pcs/airoha,pcs.yaml, at this…

--

dt-bindings: net: pcs: Document support for Airoha Ethernet PCS

This commit adds a YAML binding for the Airoha AN7581 PCS blocks, with
four compatibles for the Ethernet, PON, PCIe-shared and USB-shared SerDes
ports. The PCIe variant describes two PCS instances and uses
#pcs-cells = <1>. The other variants use #pcs-cells = <0>.

> diff --git a/Documentation/devicetree/bindings/net/pcs/airoha,pcs.yaml b/Documentation/devicetree/bindings/net/pcs/airoha,pcs.yaml
> new file mode 100644
> index 0000000000000..9c1d116c1b016
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/pcs/airoha,pcs.yaml
> @@ -0,0 +1,261 @@

[ ... ]

> +maintainers:
> +  - Christian Marangi <ansuelsmth@gmail.com>

[Severity: Low]
Should this new file also get a MAINTAINERS entry?

The series adds an ETHERNET PCS SUBSYSTEM entry, but it only lists:

F:	Documentation/networking/pcs.rst
F:	drivers/net/pcs/pcs.c
F:	include/linux/pcs/pcs-provider.h
F:	include/linux/pcs/pcs.h

No entry covers airoha,pcs.yaml or drivers/net/pcs/airoha/. The other
bindings in this directory (renesas,rzn1-miic.yaml,
rockchip,rk3568-xpcs.yaml, snps,dw-xpcs.yaml) each have an F: line.
As it stands, checkpatch will warn, and get_maintainer.pl will not list
the author for later changes to this binding.

> +
> +description:
> +  Airoha AN7581 SoC expose multiple Physical Coding Sublayer (PCS) for
> +  the various Serdes port supporting different Media Independent Interface
> +  (10BASE-R, USXGMII, 2500BASE-X, 1000BASE-X, SGMII).

[Severity: Low]
This isn't a bug, but should 10BASE-R be 10GBASE-R? The driver sets
PHY_INTERFACE_MODE_10GBASER for this mode. The commit message has the
same text.

The description also reads as if every SerDes port supports the whole
list. Is that true for airoha,an7581-pcs-usb? That variant has no usxgmii
or pcs_pma regions, and airoha_pcs_probe() only sets the 10GBASE-R and
USXGMII bits for the ETH, PON and PCIE port types:

	case AIROHA_PCS_ETH:
	case AIROHA_PCS_PON:
	case AIROHA_PCS_PCIE:
		__set_bit(PHY_INTERFACE_MODE_10GBASER, ...);
		__set_bit(PHY_INTERFACE_MODE_USXGMII, ...);
		fallthrough;
	case AIROHA_PCS_USB:

The commit message also calls this an Ethernet PCS binding. It does not
mention the PCIe-shared variant (two PCS instances, #pcs-cells = <1>) or
the USB-shared variant (needs a USB PHY via phys, no SCU).

[ ... ]

> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: airoha,an7581-pcs-pcie
> +
> +    then:
> +      properties:

[ ... ]

> +        reg-names:
> +          items:

[ ... ]

> +            - const: pcs_ana
> +            - const: pcs_pma0
> +            - const: pcs_pma1
> +
> +        phys: false

[Severity: Medium]
Do these regions overlap with the existing PCIe PHY node?

The example for this compatible puts pcs_ana, pcs_pma0 and pcs_pma1 at
0x1fa5a000, 0x1fa5b000 and 0x1fa5c000. The pciephy node in
arch/arm64/boot/dts/airoha/en7581.dtsi already claims the same blocks.
That node is not disabled by default:

	pciephy: phy@1fa5a000 {
		compatible = "airoha,en7581-pcie-phy";
		reg = <0x0 0x1fa5a000 0x0 0xfff>,
		      <0x0 0x1fa5b000 0x0 0xfff>,
		      <0x0 0x1fa5c000 0x0 0xfff>,

Both drivers map these regions with
devm_platform_ioremap_resource_byname():

- airoha_pcie_phy_probe() maps "csr-2l", "pma0" and "pma1".
- airoha_pcs_pcie_alloc_maps()->airoha_pcs_init_named_regmap() maps
  "pcs_ana", "pcs_pma0" and "pcs_pma1".

Suppose a board enables an airoha,an7581-pcs-pcie node laid out like the
example. Would the second device to probe fail with -EBUSY? That breaks
either the PCIe controllers or the Ethernet PCS.

Because of phys: false, the PCS node also cannot refer to the PCIe PHY.
The USB variant, by contrast, requires phys and leaves the PMA to the
USB PHY.

Could the binding model the SerDes as one resource owned by one node?
Or could it at least document that pciephy must be disabled when this
variant is used?

> +
> +        "#pcs-cells":
> +          const: 1

[Severity: Low]
What does the single #pcs-cells argument cell mean? The binding does not
say.

airoha_pcs_xlate() treats it as a PCS port index that must be below
num_port, so 0 or 1 for the pcs_mac0 and pcs_mac1 instances:

	case AIROHA_PCS_PCIE:
		if (pcsspec->nargs != 1) {
	...
	if (pcsspec->nargs)
		index = pcsspec->args[0];

	if (index >= priv->data->num_port) {

This becomes DT ABI once merged. Should the cell be described here?

On the consumer side, the series does not change pcs-handle in
Documentation/devicetree/bindings/net/ethernet-controller.yaml:

  pcs-handle:
    $ref: /schemas/types.yaml#/definitions/phandle-array
    items:
      maxItems: 1

Its description also still says the property points to a PCS PHY device
on an MDIO bus.

The airoha,en7581-eth GMAC ports reference ethernet-controller.yaml with
unevaluatedProperties: false. Would an entry like
pcs-handle = <&pcs_pcie 1>; then be checked against a schema that only
allows a bare phandle?

The runtime parser in drivers/net/pcs/pcs.c, used by fwnode_pcs_get() and
fwnode_phylink_pcs_count(), does expect argument cells:

	return fwnode_property_get_reference_args(fwnode, "pcs-handle",
						  "#pcs-cells", 0, index,
						  out_args);

I could not verify whether dt-validate actually rejects this, because
that depends on how dtschema splits pcs-handle phandle-arrays. Still,
the commit message says "This follow the new PCS provider with the use
of #pcs-cells property", while the documented contract only seems to
work for #pcs-cells = <0>.

> +
> +      required:
> +        - airoha,scu

[ ... ]

> +additionalProperties: false

[Severity: Medium]
Should the binding document resets and reset-names?

There is no resets property, and additionalProperties is false, so a
node that provides reset lines fails validation. The PCS driver added
later in this series requests them in airoha_pcs_probe():

	priv->rsts[0].id = "mac";
	priv->rsts[1].id = "phy";
	ret = devm_reset_control_bulk_get_optional_exclusive(dev, ARRAY_SIZE(priv->rsts),
							     priv->rsts);

airoha_pcs_setup_scu() then asserts and deasserts them after it switches
the SCU interface select, on every interface mode setup.

On a DT that follows this binding, the optional getter returns no-op
controls. Doesn't that mean the MAC/PHY reset around a mode change is
silently skipped?

A DT that adds the "mac" and "phy" resets the driver expects would
instead be rejected by dt_binding_check and dtbs_check.

include/dt-bindings/reset/airoha,en7581-reset.h already exports lines
that look suitable: EN7581_XPON_PHY_RST, EN7581_XPON_MAC_RST,
EN7581_XSI_MAC_RST, EN7581_XSI_PHY_RST, EN7581_DUAL_HSI0/1_RST,
EN7581_DUAL_HSI0/1_MAC_RST, EN7581_HSI_RST and EN7581_HSI_MAC_RST.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261129230558.612526-1-ansuelsmth%40gmail.com
Technical Details
Message-ID: <179608247620.3146.50273369832406405@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374538-linux-kernel-netdev=dewy.ru
References: <20261129230558.612526-14-ansuelsmth@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374538-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v23 13/15] dt-bindings: net: pcs: Document
 support for Airoha Ethernet PCS
Date: Mon, 30 Nov 2026 23:47:56 +0000
Organization: Usenet Network
Message-ID: <179608247620.3146.50273369832406405@kernel.org>
References: <20261129230558.612526-14-ansuelsmth@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1569048"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Tbf2Hxx4nmIMW2pTHH5yRSHvEbc= sha256:6LKZcumv/02G34xHsv0835fGLneGo+rEVVnDlBPd3HE=
	sha1:5y0oEevTRoRvjSlHueLlbCbpIxo= sha256:qMjJ9WVgdzz4AQ7CgDXjfOF6UxlMhhL4hyeUxti8IWs=
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 01476126013; Tue,  1 Dec 2026 02:49:27 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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] 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 uGv28BKuCRXy;
	Tue,  1 Dec 2026 02:49:23 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374538-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 2779A12600C; Tue,  1 Dec 2026 02:49:15 +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 B204A336D7; Mon, 30 Nov 2026 23:48:10 +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=1796082479;
	b=K46qWSGfPXha5lbTjQjNKFVkYaWhqTSiMWz8HZRgWTip2VQrrPnErdVLi4YKcPDNHC7T
	 9EUN1NCYHMGX25oEh3psbozwtnuAAM4n1cDQtR2cSZPU0MWsvHpwkWwMQdjBb/sNdbyaH
	 LOlKaUGVUfFoVOagwFj+3rAmjK7D+pKvdYBtG4I8Uz1PT7bUl3BGmixKAIp4ZV51OLdHN
	 BHnBVQMTG+jFHyVNDvFSXsoEcZYnN9aZKfKr6zU+QsF39wiB3iOGjOkk4Vw4ONfngpEhc
	 I3UtM54yG6aesMNeVm93AKjtcKfnJXmHfIVHwYVY39bOSdDcnL1bRzpLMCSxQb5DMbw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796082479;
	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=48Rsd/ZG6m01INHGBaYbyyzg7WfQTl3FMIQPE6hdCYA=;
	b=BaEPdM8PSo7jKvsGoLBk5BhhaUBhHZlLxTGOdR9by163M/zZ5AAFlHKgOwU/G36PNlpW
	 apFKqFDpsYBzaEgmV+f0zDt12/LohJS956ij5EJKvugOXhNo8DLtdWHJ5idKyQBokXtGR
	 DZ72txWMrlCrEEE2bLms/Dgsct0/PKRyvZCxNmPSxJ8flWIZVhVhziyOpdQth25X2/dey
	 dzc4kkNW+pgPyUF+W0XI4hVAymT5H5MvR1sh3sZpn8QSFQU/JWWyNh6dZKwFbxPBULFC3
	 E9EhuoyLag5Mql2MgRH9oJOqQHRKnbGdUollfKggeITbjuuAxqFk1E158HaCGz1sUVw==
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=XgwxsxUK;
	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 9B228606A685;
	Mon, 30 Nov 2026 23:47:59 +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=XgwxsxUK
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=1796082478;
	b=uv8qkIOM+2ws9eo4UVlW9oVJIzw/5HOZu9uUktvfoWzk+U8ljNJzveBmkw8A9uVMYfqB
	 +13FhxT5mIYr1GXQLqarJGzrLRbVzTPdVEH7vgv/M+Uw58nWwZlFuw6kShsAsp340ww97
	 MV9ghYi3BQmNlsxQEZCEjCSTrLZf1NTUcm0wTamT1uu6Yso+Ibv9mJSo0MX+OhZUkw6hL
	 CSGToR3fvTgfc58R2iwzQhEdV9D9OyjrflCWX5gKpKBRGdluJxB70PaySEoD+uIn0epPb
	 vBLZnhRWbQH6WfueF2hOk9HePWn3hA+tbYzg5QEUgQiH3QUL9LJptJOHLs3X0kPWhYg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796082478;
	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=48Rsd/ZG6m01INHGBaYbyyzg7WfQTl3FMIQPE6hdCYA=;
	b=N2seGqD1LkPsQzUuFxxgowEwAla3nOtOpDA1iWarfQLrE+eQH7ltE8qMKS6QLAGN6CS7
	 koQVtGOTW12H+u07cq1njybhr4Aw/VEBRMLPKrQugRA4R1osV3s56AM3mVDgFYgc7Qf+q
	 jHwkegs6cSOY/h67PzohCkA4zsK44tsu0Y2ySHdDIxSVfpx9h0ZFFWbMCpce3abRCjDN3
	 28uaHsq6fiBnJdXEu1a9Zo29bs3SNK9f0AaoqSBh6VhUWQREdXix2Je/wLh14TvkgudHS
	 1tnFuRRHtgPI/mZiOOxV3WpwSZr/B6rillHgbcY92PLelrrUnfsMLeMZFmF11hwuCXw==
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=XgwxsxUK;
	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 B9E22606A6B6;
	Mon, 30 Nov 2026 23:47:58 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id A11D41F00898;
	Mon, 30 Nov 2026 23:47:56 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796082478;
	bh=48Rsd/ZG6m01INHGBaYbyyzg7WfQTl3FMIQPE6hdCYA=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=XgwxsxUKAOvdAyAI1+sfNLt2xnO1R2Kxi1gCvqIkZLMjBosP0WwzF7zKdJCyTgVyu
	 MLS4Du0Tj3i187qRElSZacOP+eU9C8XdmNicubNQhs9HRGSSGshuKHglAyeRMo6x8m
	 3s19sN3ehH2z+zk8icUfBO/vydJcc/XJAd7efLl9ui6VFcvyXEfHJuFZlgg3Ug7Cb/
	 GYsWcKY4PhXQFw2VjJz+ZKr17NNg6a01WjGwhBa3+iB2ZO0pV+B0B/TlyVEQ2vryu7
	 klpjf2uzgxr6734h5VoU/JgARZ9DtSSn/b1txXKf+Rpk33tTWayO+OVQDRlzANF5IG
	 ldoQKQlIhWJHQ==
X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org,
 conor+dt@kernel.org, willemb@google.com, horms@kernel.org, corbet@lwn.net,
 skhan@linuxfoundation.org, rdunlap@infradead.org, lorenzo@kernel.org,
 hkallweit1@gmail.com, linux@armlinux.org.uk, maxime.chevallier@bootlin.com,
 p.zabel@pengutronix.de, nathan@kernel.org, ndesaulniers@google.com,
 morbo@google.com, justinstitt@google.com, rmk+kernel@armlinux.org.uk,
 netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-mediatek@lists.infradead.org, llvm@lists.linux.dev,
 zhengping.zhang@airoha.com
X-In-Reply-To: <20261129230558.612526-14-ansuelsmth@gmail.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