Thread (6 messages) flat view 6 messages, 3 authors, 7d ago

Re: [PATCH v2] dt-bindings: net: can: fsl,mpc5xxx-mscan: Convert to DT schema

From: sashiko-bot@kernel.org
Date: 2026-09-14 06:03:47
Also in: linux-can

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The YAML binding fails to enforce variant-specific property constraints using conditional blocks, allowing invalid device trees to pass validation.
--

commit 92a1abcb0821a0c5c2127da5be10ac0403eb2966
Author: Quchaosheng [off-list ref]

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

This commit converts the Freescale MPC5xxx MSCAN controller binding from text
to DT schema. It also documents clock and clock-name properties that the
MPC5121 driver uses.
quoted hunk ↗ jump to hunk
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
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/can/fsl,mpc5xxx-mscan.yaml
[ ... ]
+  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]
Since "sys" is documented as only being available on MPC5121, does this global
enum allow older hardware variants like MPC5200 to pass validation if they
specify "sys"?

Could this be caught during schema validation by using an allOf / if-then
conditional block that restricts the "sys" value to just the MPC5121
compatible strings?

[ ... ]
+required:
+  - compatible
+  - reg
+  - interrupts
[Severity: Medium]
Because the description for clocks mentions that the MPC5121 driver looks up
"ipg", "ips", "sys", "ref" and "mclk" by name, should clocks and clock-names
be added to the required list specifically for MPC5121?

Without an allOf conditional block enforcing these variant-specific
properties, would an incomplete device tree node missing these clocks
silently pass validation but fail later during the driver's probe routine?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260914055608.495084-2-quchaosheng000406@163.com?part=1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help