Linux CAN drivers development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: Quchaosheng <quchaosheng000406@163.com>
Cc: devicetree@vger.kernel.org,
	"Marc Kleine-Budde" <mkl@pengutronix.de>,
	robh@kernel.org, "Vincent Mailhol" <mailhol@kernel.org>,
	"Oleksij Rempel" <o.rempel@pengutronix.de>,
	conor+dt@kernel.org, "Oliver Hartkopp" <socketcan@hartkopp.net>,
	linux-can@vger.kernel.org
Subject: Re: [PATCH] dt-bindings: net: can: fsl,mpc5xxx-mscan: Convert to DT schema
Date: Mon, 14 Sep 2026 03:12:10 +0000	[thread overview]
Message-ID: <20260914031210.B9DDF1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260914030215.437602-4-quchaosheng000406@163.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The schema omits the `fsl,mpc5200b-mscan` fallback compatible string used in existing device trees, causing schema validation failures.
- [Medium] The schema is missing conditional `if-then` blocks, globally allowing properties that are invalid for MPC5200, and failing to mandate required properties for MPC5121.
--

commit dee9e6a0d172cc57e05eeda41cfef5b093d00d22
Author: Quchaosheng <quchaosheng000406@163.com>

dt-bindings: net: can: fsl,mpc5xxx-mscan: Convert to DT schema

Converts the Freescale MPC5xxx MSCAN controller binding from free-form text
to DT schema. It specifies compatible strings, clocks, clock names, and
mscan clock properties.

> diff --git a/Documentation/devicetree/bindings/net/can/fsl,mpc5xxx-mscan.yaml b/Documentation/devicetree/bindings/net/can/fsl,mpc5xxx-mscan.yaml
> new file mode 100644
> index 0000000000000..108f225f91963
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/can/fsl,mpc5xxx-mscan.yaml
> @@ -0,0 +1,87 @@
[ ... ]
> +properties:
> +  compatible:
> +    enum:
> +      - fsl,mpc5200-mscan
> +      - fsl,mpc5121-mscan

[Severity: Medium]
Will this strict enum cause validation failures for existing device trees?

Existing device trees, such as arch/powerpc/boot/dts/mpc5200b.dtsi, use a
fallback array pattern:

    compatible = "fsl,mpc5200b-mscan", "fsl,mpc5200-mscan";

Should the schema allow fsl,mpc5200b-mscan as well, perhaps using an items
list to support the fallback?

[ ... ]
> +  fsl,mscan-clock-source:
> +    description:
> +      Clock source used for the controller. Valid values are "ip" for the IP
> +      bus clock, "ref" for the reference clock (XTAL) and "sys" for the
> +      system clock. "sys" is only available on MPC5121. When the property is
> +      absent, an optimal clock source based on the system clock is selected,
> +      falling back to the reference clock.
> +    enum: [ip, ref, sys]

[Severity: Medium]
Should the sys value be restricted to the MPC5121 variant?

The schema currently allows sys globally, even though it is invalid for
the MPC5200. An if-then block could be used to restrict this.

> +
> +  fsl,mscan-clock-divider:
> +    description:
> +      Additional clock divider for the reference and system clock sources.
> +      Defaults to 1 when not specified.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    default: 1

[Severity: Medium]
Does this allow the fsl,mscan-clock-divider property on the MPC5200 variant
where it does not exist?

An if-then conditional block could also restrict this property to the MPC5121
variant to prevent it from silently passing validation on MPC5200 nodes.

> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts

[Severity: Medium]
Should clocks and clock-names be required for the MPC5121 variant?

The driver probe requires these clocks for MPC5121. Without an if-then block
requiring them, incomplete nodes will silently pass schema validation but fail
at runtime.

> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    can@1300 {
> +        compatible = "fsl,mpc5121-mscan";
> +        reg = <0x1300 0x80>;
> +        interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
> +        interrupt-parent = <&ipic>;
> +    };

[Severity: Medium]
Since the clocks and clock-names properties are strictly required by the
driver for MPC5121, does this example represent a functionally broken
configuration?

Because the schema does not strictly require the clock properties, this
example passes validation, which demonstrates that the schema accepts
invalid configurations.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260914030215.437602-4-quchaosheng000406@163.com?part=1

  reply	other threads:[~2026-09-14  3:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14  3:02 [PATCH] dt-bindings: net: can: bosch,cc770: Convert to DT schema Quchaosheng
2026-09-14  3:02 ` [PATCH] net: can: cc770: update the binding file reference in the driver comment Quchaosheng
2026-09-14  3:06   ` sashiko-bot
2026-09-14  3:02 ` [PATCH] dt-bindings: net: can: holt,hi3110: Convert to DT schema Quchaosheng
2026-09-14  3:12   ` sashiko-bot
2026-09-15 10:52   ` Krzysztof Kozlowski
2026-09-17  9:21     ` Quchaosheng
2026-09-14  3:02 ` [PATCH] dt-bindings: net: can: fsl,mpc5xxx-mscan: " Quchaosheng
2026-09-14  3:12   ` sashiko-bot [this message]
2026-09-14  3:09 ` [PATCH] dt-bindings: net: can: bosch,cc770: " sashiko-bot
2026-09-23  2:30 ` Quchaosheng

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=20260914031210.B9DDF1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=mailhol@kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=o.rempel@pengutronix.de \
    --cc=quchaosheng000406@163.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=socketcan@hartkopp.net \
    /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