Re: [PATCH net-next v22 13/15] dt-bindings: net: pcs: Document support for Airoha Ethernet PCS
From: Jakub Kicinski
Date: Sat Nov 21 2026 - 18:27:08 EST
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.