Devicetree
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: mfd: syscon: Make ranges required for renesas,r9a08g046-lvds-cmn
@ 2026-06-02 13:13 Biju
  2026-06-02 13:22 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Biju @ 2026-06-02 13:13 UTC (permalink / raw)
  To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm
  Cc: Biju Das, devicetree, linux-kernel, linux-renesas-soc,
	Prabhakar Mahadev Lad, Biju Das

From: Biju Das <biju.das.jz@bp.renesas.com>

Add a conditional schema rule to the syscon bindings that requires the
ranges property when the compatible string contains
renesas,r9a08g046-lvds-cmn. This ensures the LVDS common control block
on the RZ/G3L SoC correctly declares its address translation, as the
device has child nodes that need a valid ranges mapping to be described
in the device tree.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 Documentation/devicetree/bindings/mfd/syscon.yaml | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
index 9c81010d5a74..cbf83a06ae25 100644
--- a/Documentation/devicetree/bindings/mfd/syscon.yaml
+++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
@@ -269,6 +269,8 @@ properties:
   resets:
     maxItems: 1
 
+  ranges: true
+
 required:
   - compatible
   - reg
@@ -276,6 +278,18 @@ required:
 allOf:
   - $ref: syscon-common.yaml#
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: renesas,r9a08g046-lvds-cmn
+    then:
+      properties:
+        ranges: true
+
+      required:
+        - ranges
+
 unevaluatedProperties: false
 
 examples:
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dt-bindings: mfd: syscon: Make ranges required for renesas,r9a08g046-lvds-cmn
  2026-06-02 13:13 [PATCH] dt-bindings: mfd: syscon: Make ranges required for renesas,r9a08g046-lvds-cmn Biju
@ 2026-06-02 13:22 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-06-02 13:22 UTC (permalink / raw)
  To: Biju; +Cc: devicetree, conor+dt, robh, wsa+renesas

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] The conditional schema rule for `renesas,r9a08g046-lvds-cmn` is unreachable dead code due to omission from the top-level selection lists.
- [High] The schema implicitly requires child nodes and address translation for the device, but completely rejects them due to `unevaluatedProperties: false`.
- [Medium] Defining `ranges: true` globally weakens schema validation for all generic syscon devices.
--

commit a221f26520a3a09abdff9436ec38d41103c001ab
Author: Biju Das <biju.das.jz@bp.renesas.com>

dt-bindings: mfd: syscon: Make ranges required for renesas,r9a08g046-lvds-cmn

This patch adds a conditional schema rule to the syscon bindings that
requires the ranges property when the compatible string contains
renesas,r9a08g046-lvds-cmn. This ensures the LVDS common control block
on the RZ/G3L SoC correctly declares its address translation for child nodes.

> diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
> index e228670880631..088df592e7ace 100644
> --- a/Documentation/devicetree/bindings/mfd/syscon.yaml
> +++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
> @@ -268,6 +268,8 @@ properties:
>    resets:
>      maxItems: 1
>  
> +  ranges: true

[Severity: Medium]
Does adding this globally weaken schema validation for all generic syscon
devices? Since ranges is also defined conditionally below, could we remove
this top-level definition to avoid making the schema overly permissive for
over 100 other devices?

> +
>  required:
>    - compatible
>    - reg
> @@ -275,6 +277,18 @@ required:
>  allOf:
>    - $ref: syscon-common.yaml#
>  
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: renesas,r9a08g046-lvds-cmn

[Severity: High]
Is this conditional rule unreachable? The schema uses a custom select block
to limit applicability:

select:
  properties:
    compatible:
      contains:
        enum:

Because renesas,r9a08g046-lvds-cmn is not added to the select enum, dtschema
might never select syscon.yaml to validate a node with this compatible string.
Does this compatible string need to be added to the top-level selection lists
to ensure validation occurs?

> +    then:
> +      properties:
> +        ranges: true
> +
> +      required:
> +        - ranges
> +
>  unevaluatedProperties: false

[Severity: High]
Since the commit message notes the device has child nodes that need a valid
ranges mapping, will setting unevaluatedProperties to false reject them?

Using ranges to map child addresses mandates the presence of child nodes as
well as #address-cells and #size-cells. However, syscon.yaml does not define
#address-cells, #size-cells, or any child node pattern properties. Will a
correctly formed device tree node with children be incorrectly rejected by
dtbs_check with unevaluated property errors?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260602131331.90756-1-biju.das.jz@bp.renesas.com?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-02 13:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-02 13:13 [PATCH] dt-bindings: mfd: syscon: Make ranges required for renesas,r9a08g046-lvds-cmn Biju
2026-06-02 13:22 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox