All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Christian Marangi" <ansuelsmth@gmail.com>, devicetree@vger.kernel.org
Cc: robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next v23 13/15] dt-bindings: net: pcs: Document support for Airoha Ethernet PCS
Date: Mon, 30 Nov 2026 23:25:55 +0000	[thread overview]
Message-ID: <sashiko-outbox-242236@kernel.org> (raw)
In-Reply-To: <20261129230558.612526-14-ansuelsmth@gmail.com>

Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [Medium] dt-bindings: net: pcs: airoha,scu conflicts with SCU PHY and
  PCIe PHY MMIO
- [Medium] dt-bindings: net: pcs: missing resets and #pcs-cells consumer
  mismatch
- [Low] dt-bindings: net: pcs: unwieldy per-compatible conditionals in
  airoha,pcs.yaml
- [Low] dt-bindings: net: pcs: typo 10BASE-R for 10GBASE-R in
  description
--

commit 6b51fe520d3567df1745ff58edfff93a1c09b45b
Author: Christian Marangi <ansuelsmth@gmail.com>

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

This commit adds the Device Tree binding schema for the Airoha Ethernet
PCS and SerDes on the AN7581 SoC.

> 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 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/pcs/airoha,pcs.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Airoha Ethernet PCS and Serdes
> +
> +maintainers:
> +  - Christian Marangi <ansuelsmth@gmail.com>
> +
> +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]
As reported by Benjamin Larsson on RFC v5 [1], should 10BASE-R be
10GBASE-R here and in the commit message?  The reg item descriptions below
also mix "reg" and "register".

> +
> +properties:
> +  compatible:
> +    enum:
> +      - airoha,an7581-pcs-eth
> +      - airoha,an7581-pcs-pon
> +      - airoha,an7581-pcs-pcie
> +      - airoha,an7581-pcs-usb
> +
> +  reg:
> +    minItems: 6
> +    maxItems: 15
> +
> +  reg-names:
> +    minItems: 6
> +    maxItems: 15
> +
> +  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]
As reported by Jakub Kicinski on v22 [2], is a bare airoha,scu phandle the
right interface for selecting the SerDes mode while forbidding phys on the
eth, pon, and pcie variants?

The AN7581 SCU node (scuclk, compatible airoha,en7581-scu) already exposes
SerDes mode selection on REG_NP_SCU_SSTR and REG_NP_SCU_SSR3 under
priv->lock as a generic PHY provider (#phy-cells = <1>).  Because scuclk
is not a syscon, syscon_regmap_lookup_by_phandle() in airoha_pcs_probe()
fails with -EINVAL when given &scuclk as shown in the examples, and a
separate regmap would access those SCU registers without priv->lock.

In addition, in the airoha,an7581-pcs-pcie example below, pcs_ana
(0x1fa5a000), pcs_pma0 (0x1fa5b000), and pcs_pma1 (0x1fa5c000) claim the
same MMIO ranges as csr-2l, pma0, and pma1 of phy@1fa5a000
(airoha,en7581-pcie-phy in arch/arm64/boot/dts/airoha/en7581.dtsi),
causing an exclusive memory region conflict (-EBUSY) when both drivers
probe.

> +
> +  phys:
> +    maxItems: 1
> +
> +  "#pcs-cells": true
> +
> +required:
> +  - compatible
> +  - reg
> +  - reg-names
> +  - "#pcs-cells"
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - airoha,an7581-pcs-eth
> +              - airoha,an7581-pcs-pon

[Severity: Low]
This isn't a bug, but the variants share almost no top-level constraints
and override reg, reg-names, #pcs-cells, phys, and airoha,scu across three
large per-compatible if/then blocks.  Would splitting the distinct
variants into separate schema documents be cleaner?

[ ... ]

> +        "#pcs-cells":
> +          const: 1
> +
> +      required:
> +        - airoha,scu
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: airoha,an7581-pcs-usb
> +
> +    then:
> +      properties:
> +        reg:
> +          items:
> +            - description: PCS MAC reg
> +            - description: HSGMII AN reg
> +            - description: HSGMII PCS reg
> +            - description: MULTI SGMII reg
> +            - description: HSGMII rate adaption reg
> +            - description: PCS Analog register
> +
> +        reg-names:
> +          items:
> +            - const: pcs_mac
> +            - const: hsgmii_an
> +            - const: hsgmii_pcs
> +            - const: multi_sgmii
> +            - const: hsgmii_rate_adp
> +            - const: pcs_ana
> +
> +        airoha,scu: false
> +
> +        "#pcs-cells":
> +          const: 0
> +
> +      required:
> +        - phys
> +
> +additionalProperties: false

[Severity: Medium]
As reported by Jakub Kicinski on v22 [2], should resets and reset-names be
documented here?  airoha_pcs_probe() requests the "mac" and "phy" resets,
so with additionalProperties: false any DT node providing them will fail
schema validation.

Also, requiring #pcs-cells = <1> for airoha,an7581-pcs-pcie conflicts with
Documentation/devicetree/bindings/net/ethernet-controller.yaml (referenced
by airoha,en7581-eth.yaml), which restricts each pcs-handle entry to
maxItems: 1 (phandle only, with no argument cells).

[1] https://lore.kernel.org/r/5f3b3b38-1b53-4b9a-9673-de4ca321b3f1@genexis.eu
[2] https://lore.kernel.org/r/20261121232654.1365615-1-kuba@kernel.org

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261129230558.612526-1-ansuelsmth@gmail.com?part=13

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

Thread overview: 39+ 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:25   ` sashiko-bot
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:25   ` sashiko-bot
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:25   ` sashiko-bot
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:25   ` sashiko-bot
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:25   ` sashiko-bot
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:25   ` sashiko-bot
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:25   ` sashiko-bot [this message]
2026-11-30 23:47   ` netdev-bot+sashiko
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:25   ` sashiko-bot
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:25   ` sashiko-bot
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=sashiko-outbox-242236@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ansuelsmth@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.