Devicetree
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: filipp.dunsky@gmail.com
Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, andrew@lunn.ch, hkallweit1@gmail.com,
	linux@armlinux.org.uk, andrew+netdev@lunn.ch,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/3] dt-bindings: net: Add Cortina CS7542 MDIO controller
Date: Tue, 24 Nov 2026 19:07:25 +0000	[thread overview]
Message-ID: <179554724588.3135.13754934088283070222@kernel.org> (raw)
In-Reply-To: <20261123-b4-cs7542-mdio-v1-1-626d0a0e3b4d@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The binding states the CS7542 MDIO block has an MDC prescaler.
- [Low] The CS7542 MDIO binding
  (Documentation/devicetree/bindings/net/cortina,cs7542-mdio.yaml)…

--

dt-bindings: net: Add Cortina CS7542 MDIO controller

This adds a YAML binding for the Cortina CS7542 Clause 22 MDIO controller.
The binding references mdio.yaml and requires compatible, reg and the cell
properties. It disallows clock-frequency and suppress-preamble because the
MDC prescaler set by firmware is kept as is.

> diff --git a/Documentation/devicetree/bindings/net/cortina,cs7542-mdio.yaml b/Documentation/devicetree/bindings/net/cortina,cs7542-mdio.yaml
> new file mode 100644
> index 0000000000000..77b5e2f09f423
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/cortina,cs7542-mdio.yaml
> @@ -0,0 +1,48 @@

[ ... ]

> +description:
> +  Clause 22 MDIO controller. Firmware configures the MDC prescaler before
> +  the operating system starts; the driver retains this setting.
> +
> +allOf:
> +  - $ref: mdio.yaml#
> +
> +properties:
> +  compatible:
> +    const: cortina,cs7542-mdio
> +
> +  reg:
> +    maxItems: 1
> +
> +  clock-frequency: false
> +  suppress-preamble: false

[Severity: Low]
Do these two false constraints describe a hardware limit, or only what the
current driver does?

The description talks about what "the driver retains". The MDC prescaler
also looks like a programmable register. cs75xx_mdio_probe() in
drivers/net/mdio/mdio-cs75xx.c, added later in this series, reads it and
writes it back:

    cfg = readl(priv->base + PER_MDIO_CFG);
    /* The firmware configures the MDC rate; retain its prescaler. */
    cfg |= MDIO_CFG_MANUAL;
    writel(cfg, priv->base + PER_MDIO_CFG);

So the hardware seems able to set the MDC rate. Rejecting clock-frequency
then only reflects that the Linux driver doesn't implement it. Nothing in
the binding says the hardware can't suppress the preamble either.

Documentation/devicetree/bindings/writing-bindings.rst says bindings should
not refer to Linux or "device driver". It also says they should be based on
what the hardware has, not on what an OS and driver currently support.

With this binding, a board whose PHYs need a different MDC rate has no
valid way to say so. dt_binding_check also rejects these standard
mdio.yaml properties.

The commit message has the same problem:

  clock-frequency and preamble suppression are not supported.

This reads like a hardware limitation.

Could the description be reworded to describe the hardware? And could the
false entries be dropped unless the hardware really lacks these features?

> +
> +required:
> +  - compatible
> +  - reg
> +  - "#address-cells"
> +  - "#size-cells"
> +
> +unevaluatedProperties: false

[Severity: Medium]
Is this schema missing an input clock, and possibly a reset?

The description says the block has an MDC prescaler, which means it
divides some input clock. The schema only adds compatible and reg on top of
mdio.yaml. With unevaluatedProperties: false, any DT node that has a clocks
or resets property fails validation.

writing-bindings.rst asks for complete bindings in this case:

  - DO attempt to make bindings complete even if a driver doesn't support
    some features.

cs75xx_mdio_probe(), added later in the series, never gets or enables a
clock:

    priv->base = devm_platform_ioremap_resource(pdev, 0);
    ...
    return devm_of_mdiobus_register(dev, bus, dev->of_node);

What if a Linux clock driver manages the parent clock? clk_disable_unused()
could gate it at late_initcall. Every access would then time out in the
readl_poll_timeout_atomic() call in cs75xx_mdio_wait(), and the attached
PHYs would be unusable.

A rate change on a shared parent clock would also change MDC without
notice, since the driver keeps the firmware divider and never recomputes
it. That could push MDC above the 2.5 MHz Clause 22 limit.

There is no CS7542 clock driver or DTS in the tree yet. So the runtime
failure depends on whether that clock can actually be gated or changed.

If a required clocks property is added later, though, existing DTs written
against this binding would stop validating.

Would it be better to describe the clock now?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261123-b4-cs7542-mdio-v1-0-626d0a0e3b4d%40gmail.com

  parent reply	other threads:[~2026-11-24 19:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 18:41 [PATCH net-next 0/3] Add Cortina Systems CS7542 MDIO controller support Fil Dunsky via B4 Relay
2026-11-23 18:41 ` [PATCH net-next 1/3] dt-bindings: net: Add Cortina CS7542 MDIO controller Fil Dunsky via B4 Relay
2026-11-24 18:42   ` sashiko-bot
2026-11-24 19:07   ` netdev-bot+sashiko [this message]
2026-11-23 18:41 ` [PATCH net-next 2/3] net: mdio: Add Cortina CS7542 bus controller Fil Dunsky via B4 Relay
2026-11-23 19:40   ` Andrew Lunn
2026-11-23 20:41     ` Fil Dunsky
2026-11-24 18:42   ` sashiko-bot
2026-11-24 19:07   ` netdev-bot+sashiko
2026-11-23 18:41 ` [PATCH net-next 3/3] MAINTAINERS: Add Cortina CS7542 MDIO controller entry Fil Dunsky via B4 Relay
2026-11-23 19:41   ` Andrew Lunn

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=179554724588.3135.13754934088283070222@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=filipp.dunsky@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    /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