[PATCH net-next 01/12] dt-bindings: net: Add Ethernet MII multiplexers

netdev-bot+sashiko at kernel.org netdev-bot+sashiko at kernel.org
Sat Dec 5 04:18:22 PST 2026


Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] In mii-mux-auto.yaml, the description says the mux has two ports
  and that exactly one of them takes precedence, but the schema enforces…
- [Low] ethernet-controller.yaml adds `mii-mux-handle` (lines 103-107) as
  a bare phandle.
- [Low] mii-mux-auto.yaml defines `takes-precedence` (lines 29-33) as
  "The multiplexer switches to this port by itself as soon as the port…

--

dt-bindings: net: Add Ethernet MII multiplexers

This adds mii-mux.yaml, a generic binding for an Ethernet MII
multiplexer and its ports. It also adds mii-mux-auto.yaml for two-port
muxes that the hardware switches by itself. A new mii-mux-handle
property in ethernet-controller.yaml lets a MAC point to the mux node.

> diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> index 30b2a335116e9..e2836351cd7ad 100644
> --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> @@ -100,6 +100,12 @@ properties:
>      description:
>        Specifies a reference to a node representing a PHY device.
>  
> +  mii-mux-handle:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description:
> +      Specifies a reference to a node representing an Ethernet MII
> +      multiplexer.
> +

[Severity: Low]
How should mii-mux-handle interact with the MAC-level phy-handle, sfp,
fixed-link, managed and phy-mode properties?

Nothing here stops those properties from appearing next to
mii-mux-handle. The description also doesn't say which one wins. The mux
ports in mii-mux.yaml then define phy-handle, phy-mode and sfp again for
the same MAC-to-PHY link.

The mii-mux-auto.yaml example sets phy-mode = "sgmii" on both the MAC
and port at 1. What does the MAC-level mode mean when the SFP port at 0 is
selected? The port oneOf in mii-mux.yaml forbids phy-mode on that port.

Later in the series, phylink uses a precedence that this binding doesn't
describe. phylink_fwnode_phy_connect() returns early once a mux is
attached:

	if (pl->mux)
		return 0;

	phy_fwnode = fwnode_get_phy_node(fwnode);

But phylink_attach_mux() returns without attaching a mux when the option
is disabled:

	if (pl->mux || !IS_ENABLED(CONFIG_PHY_MUX))
		return 0;

In that case the MAC-level phy-handle is used. The Turris Omnia DTS in
this series depends on this and keeps both on &eth2:

	phy-mode = "sgmii";
	phy-handle = <&phy1>;
	mii-mux-handle = <&wan_mux>;

Could the binding either forbid the conflicting MAC-level link
properties when mii-mux-handle is present, or say which level takes
precedence?

Separately, the RGMII rx/tx-internal-delay-ps conditional in the allOf
of ethernet-controller.yaml only checks the MAC-level phy-mode. Is there
a way to express delays for a port-level rgmii-* mode?

None of the later patches in the series change the binding files.

> diff --git a/Documentation/devicetree/bindings/net/mii-mux-auto.yaml b/Documentation/devicetree/bindings/net/mii-mux-auto.yaml
> new file mode 100644
> index 0000000000000..7a965f6e8dcce
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/mii-mux-auto.yaml

[ ... ]

> +patternProperties:
> +  "^port@[0-9a-f]+$":
> +    $ref: mii-mux.yaml#/$defs/port
> +    unevaluatedProperties: false
> +
> +    properties:
> +      takes-precedence:
> +        type: boolean
> +        description:
> +          The multiplexer switches to this port by itself as soon as the
> +          port gets active, whatever the state of the other port.

[Severity: Low]
What does "gets active" mean here?

On the Turris Omnia, which the commit message uses as the example, the
select line is the SFP cage's mod_def0 signal. The hardware therefore
switches on module presence, not on link or LOS state.

For a PHY port, the binding gives "active" no defined meaning. Even so,
the schema accepts takes-precedence on either port, whether that port
has sfp or phy-handle.

The only driver is mii_mux_auto_check_ports() in
drivers/net/phy/mux/mii_mux_auto.c, added later in the series. It only
accepts the flag on the SFP port:

	if (n_sfp != 1 || n_phy != 1 || n_prec != 1 || n_sfp_prec != 1)
		return -EOPNOTSUPP;

So a DT with takes-precedence on the PHY port passes dt_binding_check
but then fails to probe.

Could the binding describe the trigger as module presence on the SFP
port, and only allow takes-precedence on the port that has sfp?

> +
> +required:
> +  - compatible
> +  - port at 0
> +  - port at 1
> +
> +oneOf:
> +  - properties:
> +      port at 0:
> +        required:
> +          - takes-precedence
> +  - properties:
> +      port at 1:
> +        required:
> +          - takes-precedence

[Severity: Low]
The description calls this a two-port mux where exactly one port takes
precedence. Does the schema enforce either of those?

The "^port@[0-9a-f]+$" pattern accepts any number of ports. The required
list only asks for port at 0 and port at 1, and this oneOf only checks
takes-precedence on those two ports.

For example, this node passes dt_binding_check:

    port at 0 { reg = <0>; sfp = <&sfp0>; takes-precedence; };
    port at 1 { reg = <1>; phy-handle = <&phy0>; phy-mode = "sgmii"; };
    port at 2 { reg = <2>; sfp = <&sfp1>; takes-precedence; };

The port at 0 branch matches and the port at 1 branch fails, so oneOf is
satisfied. port at 2 matches patternProperties, so unevaluatedProperties
never triggers.

Later in the series, mii_mux_auto_check_ports() rejects this layout at
probe time with -EOPNOTSUPP. The schema and the driver therefore
disagree.

Would restricting the pattern to "^port@[01]$" for this compatible make
the required list and the oneOf complete?

None of the later patches in the series change the binding files.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204110622.1106492-1-maxime.chevallier%40bootlin.com



More information about the linux-arm-kernel mailing list