Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Maxime Chevallier" <maxime.chevallier@bootlin.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next 01/12] dt-bindings: net: Add Ethernet MII multiplexers
Date: Sat, 05 Dec 2026 11:08:42 +0000	[thread overview]
Message-ID: <sashiko-outbox-251442@kernel.org> (raw)
In-Reply-To: <20261204110622.1106492-2-maxime.chevallier@bootlin.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] dt-bindings: net: mii-mux-auto allows >2 ports and extra
  takes-precedence
- [Low] dt-bindings: net: mii-mux-auto leaves takes-precedence trigger
  unspecified
--

commit 15b0b40dd7397c1fe9390dd7da13fe9a18c062a8
Author: Maxime Chevallier <maxime.chevallier@bootlin.com>

dt-bindings: net: Add Ethernet MII multiplexers

This commit adds generic and hardware-switched Ethernet MII multiplexer
devicetree bindings, adds a mii-mux-handle property to
ethernet-controller.yaml, and adds a MAINTAINERS entry.

> 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
> @@ -0,0 +1,89 @@

[ ... ]

> +allOf:
> +  - $ref: mii-mux.yaml#
> +
> +properties:
> +  compatible:
> +    const: mii-mux-auto
> +
> +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]
Should the takes-precedence description specify what physical event counts
as "active"?

Without software control or state readback, drivers must infer when the
hardware switches.  "Active" could mean SFP module presence (mod_def0),
optical signal detect (RX_LOS), or link-up, letting incompatible hardware
share the same DT representation.

It also leaves takes-precedence permitted on phy-handle ports even though
no activation trigger is defined for a PHY port.

> +
> +required:
> +  - compatible
> +  - port@0
> +  - port@1
> +
> +oneOf:
> +  - properties:
> +      port@0:
> +        required:
> +          - takes-precedence
> +  - properties:
> +      port@1:
> +        required:
> +          - takes-precedence
> +
> +unevaluatedProperties: false

[Severity: Medium]
Does this schema still allow a mii-mux-auto node with port@2 or higher?

Both this file and mii-mux.yaml match "^port@[0-9a-f]+$" without bounding
reg, so port@2+ children pass unevaluatedProperties: false.  Because oneOf
only checks port@0 and port@1, an extra port can also set takes-precedence
and still pass dtbs_check.

Narrowing the pattern here to "^port@[01]$" alone would not reject port@2+
because mii-mux.yaml still evaluates "^port@[0-9a-f]+$" via allOf;
constraining reg to [0, 1] (or rejecting higher ports explicitly) would
enforce both invariants.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204110622.1106492-1-maxime.chevallier@bootlin.com?part=1

  reply	other threads:[~2026-12-05 11:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 11:06 [PATCH net-next 00/12] net: phy: Introduce MII multiplexers Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 01/12] dt-bindings: net: Add Ethernet " Maxime Chevallier
2026-12-05 11:08   ` sashiko-bot [this message]
2026-12-04 11:06 ` [PATCH net-next 02/12] net: phy: Introduce phy_mux, a MII multiplexer representation Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 03/12] net: phy: Don't create the sysfs links for PHYs behind a mux Maxime Chevallier
2026-12-05 11:08   ` sashiko-bot
2026-12-04 11:06 ` [PATCH net-next 04/12] net: phy: phy_mux: Allow attaching a mux to a net_device Maxime Chevallier
2026-12-05 11:08   ` sashiko-bot
2026-12-04 11:06 ` [PATCH net-next 05/12] net: phy: phy_mux: Add port selection logic Maxime Chevallier
2026-12-05 11:08   ` sashiko-bot
2026-12-04 11:06 ` [PATCH net-next 06/12] net: phy: phy_mux: Support SFP cage ports Maxime Chevallier
2026-12-05 11:08   ` sashiko-bot
2026-12-04 11:06 ` [PATCH net-next 07/12] net: phylink: Factor out phylink_clear_phydev() Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 08/12] net: phy: phy_mux: Add phy_mux_set_mac_managed_pm() Maxime Chevallier
2026-12-04 11:06 ` [PATCH net-next 09/12] net: phylink: Support PHYs reached through a phy_mux Maxime Chevallier
2026-12-05 11:08   ` sashiko-bot
2026-12-04 11:06 ` [PATCH net-next 10/12] net: phylink: Support an SFP cage behind " Maxime Chevallier
2026-12-05 11:08   ` sashiko-bot
2026-12-04 11:06 ` [PATCH net-next 11/12] net: phy: mux: Add the mii-mux-auto driver Maxime Chevallier
2026-12-05 11:08   ` sashiko-bot
2026-12-04 11:06 ` [PATCH net-next 12/12] ARM: dts: turris-omnia: Describe the WAN port multiplexer Maxime Chevallier
2026-12-05 11:08   ` sashiko-bot

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-251442@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox