Linux Documentation
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: ansuelsmth@gmail.com
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
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	[thread overview]
Message-ID: <179608247620.3146.50273369832406405@kernel.org> (raw)
In-Reply-To: <20261129230558.612526-14-ansuelsmth@gmail.com>

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

  reply	other threads:[~2026-11-30 23:47 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 23:05 [PATCH net-next v23 00/15] net: pcs: Introduce support for fwnode PCS Christian Marangi
2026-11-29 23:05 ` [PATCH net-next v23 01/15] net: phylink: make PCS phylink instance access RCU protected Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 02/15] net: phylink: keep and use MAC supported_interfaces in phylink struct Christian Marangi
2026-11-29 23:05 ` [PATCH net-next v23 03/15] net: phylink: introduce internal phylink PCS handling Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 04/15] net: pcs: implement Firmware node support for PCS driver Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 05/15] net: phylink: make phylink_validate state locked Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 06/15] net: phylink: add capabilities helpers and track modified advertising Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 07/15] net: sfp: support deferred module insertion Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 08/15] net: phylink: support PCS provider release Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 09/15] net: phylink: support late PCS provider attach Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 10/15] net: Document PCS subsystem Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 11/15] MAINTAINERS: add myself as PCS subsystem maintainer Christian Marangi
2026-11-29 23:05 ` [PATCH net-next v23 12/15] net: phylink: add .pcs_link_down PCS OP Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 13/15] dt-bindings: net: pcs: Document support for Airoha Ethernet PCS Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko [this message]
2026-11-29 23:05 ` [PATCH net-next v23 14/15] net: pcs: airoha: add PCS driver for Airoha AN7581 SoC Christian Marangi
2026-11-30 23:47   ` netdev-bot+sashiko
2026-11-29 23:05 ` [PATCH net-next v23 15/15] net: airoha: add phylink support Christian Marangi
2026-11-30 23:48   ` netdev-bot+sashiko
2026-11-29 23:09 ` [PATCH net-next v23 00/15] net: pcs: Introduce support for fwnode PCS netdev-bot+sinfo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179608247620.3146.50273369832406405@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=justinstitt@google.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=llvm@lists.linux.dev \
    --cc=lorenzo@kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=willemb@google.com \
    --cc=zhengping.zhang@airoha.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox