All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: ansuelsmth@gmail.com
Cc: Jakub Kicinski <kuba@kernel.org>,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, 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-kernel@vger.kernel.org, linux-doc@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 v22 13/15] dt-bindings: net: pcs: Document support for Airoha Ethernet PCS
Date: Sat, 21 Nov 2026 15:26:54 -0800	[thread overview]
Message-ID: <20261121232654.1365615-1-kuba@kernel.org> (raw)
In-Reply-To: <20261117123956.11981-14-ansuelsmth@gmail.com>

This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
dt-bindings: net: pcs: Document support for Airoha Ethernet PCS

This adds a DT binding for the Airoha AN7581 PCS blocks on the Ethernet,
PON, PCIe and USB serdes ports. It follows the new PCS provider model,
where consumers reference the PCS through #pcs-cells.

> 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

[ ... ]

> +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 here? The commit
message has the same typo:

  (10BASE-R, USXGMII, 2500BASE-X, 1000BASE-X, SGMII).

The driver later in the series sets PHY_INTERFACE_MODE_10GBASER in
airoha_pcs_probe().

[ ... ]

> +  airoha,scu:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: phandle to the SCU node required to configure
> +      the serdes line to the correct interface mode.

[Severity: Medium]
Is a bare SCU phandle the right interface for selecting the serdes mode?

The SCU already offers this as a generic PHY provider. In
clock/airoha,en7523-scu.yaml:

  '#phy-cells':
    description:
      The first cell indicates the serdes phy number, see [2] for the
      available serdes port.
    const: 1

In drivers/clk/clk-en7523.c, en7581_serdes_phy_set_mode() handles
PHY_MODE_ETHERNET. It writes the REG_NP_SCU_SSTR XSI0/XSI1 select bits
while holding priv->lock.

The PCS driver later in the series writes the same bits through this
phandle, using its own regmap, in airoha_pcs_setup_scu_pcie():

    regmap_update_bits(priv->scu, AIROHA_SCU_SSTR,
                       AIROHA_SCU_PCIE_XSI0_SEL,
                       xsi_sel);

Doesn't that leave two unsynchronized read-modify-write paths on the
same SCU register?

Probing looks like a problem too. airoha_pcs_probe() does:

    priv->scu = syscon_regmap_lookup_by_phandle(dev->of_node,
                                                "airoha,scu");

The scuclk node in the example has only the compatible
"airoha,en7581-scu". It isn't a "syscon", and nothing registers it with
of_syscon_register_regmap().

Won't the lookup return -EPROBE_DEFER on every attempt? If so, the
eth/pon/pcie PCS never probes when the DT follows the example.

The phandle also has no cells. That means the dual-lane pcie node can't
say which SCU serdes port each PCS instance drives.

Could the binding use something like this instead of airoha,scu plus
phys: false?

    phys = <&scuclk AIROHA_SCU_SERDES_PCIE1>,
           <&scuclk AIROHA_SCU_SERDES_PCIE2>;

The usb variant already uses phys.

[ ... ]

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

[ ... ]

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

[Severity: Medium]
With #pcs-cells set to 1, a MAC that uses one of the PCIe serdes PCS
instances has to write pcs-handle = <&pcs N>. Will the consumer schema
accept that?

ethernet-controller.yaml still has:

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

That allows only the phandle in each entry. airoha,en7581-eth.yaml
references ethernet-controller.yaml# for its ethernet@N subnodes. A GMAC
node with pcs-handle = <&pcs_pcie 0> would then fail dtbs_check.

At runtime, fwnode_parse_pcsspec() in drivers/net/pcs/pcs.c parses the
"#pcs-cells" argument. airoha_pcs_xlate() rejects a PCIe specifier when
nargs != 1.

No patch in the series changes ethernet-controller.yaml. Its pcs-handle
description also still refers to a PCS PHY device on an MDIO bus.

[ ... ]

> +      required:
> +        - phys
> +
> +additionalProperties: false

[Severity: Medium]
Should resets and reset-names be documented here? The driver later in
the 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 these resets on every
interface setup.

The SCU reset controller has matching lines in
include/dt-bindings/reset/airoha,en7581-reset.h. Examples are
EN7581_XSI_PHY_RST, EN7581_XPON_PHY_RST and EN7581_XPON_MAC_RST.

Because of additionalProperties: false, a DT that provides these resets
fails validation. A DT that passes validation has no resets, so the reset
sequence in airoha_pcs_setup_scu() does nothing.

Wouldn't the PCS then stay in whatever state the bootloader or the
previous interface mode left it in?

[ ... ]

> +    pcs@1fa04000 {
> +      compatible = "airoha,an7581-pcs-pcie";
> +      reg = <0x1fa04000 0x1000>,

[ ... ]

> +            <0x1fa5a000 0x1000>,
> +            <0x1fa5b000 0x1000>,
> +            <0x1fa5c000 0x1000>;

[Severity: Medium]
Do these ranges overlap the existing PCIe PHY? In
arch/arm64/boot/dts/airoha/en7581.dtsi, the pciephy: phy@1fa5a000 node
is enabled and claims the same blocks:

    reg = <0x0 0x1fa5a000 0x0 0xfff>,
          <0x0 0x1fa5b000 0x0 0xfff>,
          <0x0 0x1fa5c000 0x0 0xfff>, ...
    reg-names = "csr-2l", "pma0", "pma1", ...

airoha_pcie_phy_probe() and airoha_pcs_init_named_regmap() both map these
ranges with devm_platform_ioremap_resource_byname(), which requests the
memory region.

Won't the driver that probes second fail with -EBUSY?

That would also rule out mixed setups, such as PCIe on one lane and
Ethernet on the other, because both need the shared csr-2l/pma blocks.

This variant also sets phys: false. The PCS therefore can't hand the
analog/PMA side to the PHY that owns it, the way the usb variant does.

  parent reply	other threads:[~2026-11-21 23:26 UTC|newest]

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

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=20261121232654.1365615-1-kuba@kernel.org \
    --to=kuba@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=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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.