Skip to contentSkip to conversation

dt-bindings: mmc: dwcmshc-sdhci: Fix resets array validation

PATCH Superseded [email protected] 2 participants 4 messages Feb 11 – Feb 12

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: mmc: dwcmshc-sdhci: Fix resets array validation

From: Huan He <[email protected]>

The binding defines tuple-style reset-names items for some compatibles, which implicitly enforces a fixed array length via JSON Schema.

Defining global maxItems for resets and reset-names causes these constraints to be intersected via allOf, resulting in an effective minItems equal to the global maxItems. This leads to dtbs_check failures reporting reset arrays as too short, even when the DTS provides the correct number of entries.

Remove the global maxItems constraints and let the per-compatible schema branches define the required reset array sizes explicitly.

Fixes 30009a21f257 ("dt-bindings: mmc: sdhci-of-dwcmshc: Add Eswin EIC7700")
---
 .../devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml         | 6 ------
 1 file changed, 6 deletions(-)
Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml +0 -6
index 7e7c55dc2440..8af55a53b569 100644
@@ -49,12 +49,6 @@ properties:
   power-domains:
     maxItems: 1
 
-  resets:
-    maxItems: 5
-
-  reset-names:
-    maxItems: 5
-
   rockchip,txclk-tapnum:
     description: Specify the number of delay for tx sampling.
     $ref: /schemas/types.yaml#/definitions/uint8
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 27 lines · On Wed, Feb 11, 2026 at 05:47:36PM +0800, [email protected] wrote:

From: Huan He <[email protected]>

The binding defines tuple-style reset-names items for some compatibles, which implicitly enforces a fixed array length via JSON Schema.

Defining global maxItems for resets and reset-names causes these constraints to be intersected via allOf, resulting in an effective minItems equal to the global maxItems. This leads to dtbs_check failures reporting reset arrays as too short, even when the DTS provides the correct number of entries.

Remove the global maxItems constraints and let the per-compatible schema branches define the required reset array sizes explicitly.

Fixes 30009a21f257 ("dt-bindings: mmc: sdhci-of-dwcmshc: Add Eswin EIC7700")
---
 .../devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml         | 6 ------
 1 file changed, 6 deletions(-)
Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml +0 -0
index 7e7c55dc2440..8af55a53b569 100644

Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml properties: · line 56

Quoted 8 lines
Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml +0 -5
@@ -49,12 +49,6 @@ properties:
   power-domains:
     maxItems: 1
 
-  resets:
-    maxItems: 5
-
-  reset-names:
-    maxItems: 5

No, add 'minItems' that covers the whole range needed.

author
#2 lore raw
Quoted 28 lines
Quoted 28 lines

The binding defines tuple-style reset-names items for some compatibles, which implicitly enforces a fixed array length via JSON Schema.

Defining global maxItems for resets and reset-names causes these constraints to be intersected via allOf, resulting in an effective minItems equal to the global maxItems. This leads to dtbs_check failures reporting reset arrays as too short, even when the DTS provides the correct number of entries.

Remove the global maxItems constraints and let the per-compatible schema branches define the required reset array sizes explicitly.

Fixes 30009a21f257 ("dt-bindings: mmc: sdhci-of-dwcmshc: Add Eswin EIC7700")
---
 .../devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml         | 6 ------
 1 file changed, 6 deletions(-)
Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml +0 -0
index 7e7c55dc2440..8af55a53b569 100644
@@ -49,12 +49,6 @@ properties:
   power-domains:
     maxItems: 1
 
Quoted 7 lines

Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml properties: · line 56

Quoted 5 lines
Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml +0 -5
-  resets:
-    maxItems: 5
-
-  reset-names:
-    maxItems: 5

No, add 'minItems' that covers the whole range needed.

Thank you very much for taking the time to review the patch and for your valuable feedback.

I have checked other vendors in the kernel that use the resets property. The minimum number in actual use is 4 (Eswin uses 4, others use 5).

Is it reasonable to add "minItems: 1"?

Best regards,
Huan He

maintainer
#3 lore raw
Quoted 37 lines · Huan He
Quoted 29 lines
Quoted 29 lines

The binding defines tuple-style reset-names items for some compatibles, which implicitly enforces a fixed array length via JSON Schema.

Defining global maxItems for resets and reset-names causes these constraints to be intersected via allOf, resulting in an effective minItems equal to the global maxItems. This leads to dtbs_check failures reporting reset arrays as too short, even when the DTS provides the correct number of entries.

Remove the global maxItems constraints and let the per-compatible schema branches define the required reset array sizes explicitly.

Fixes 30009a21f257 ("dt-bindings: mmc: sdhci-of-dwcmshc: Add Eswin EIC7700")
---
 .../devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml         | 6 ------
 1 file changed, 6 deletions(-)
Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml +0 -0
index 7e7c55dc2440..8af55a53b569 100644
@@ -49,12 +49,6 @@ properties:
   power-domains:
     maxItems: 1
 
Quoted 7 lines

Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml properties: · line 56

Quoted 5 lines
Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml +0 -5
-  resets:
-    maxItems: 5
-
-  reset-names:
-    maxItems: 5

No, add 'minItems' that covers the whole range needed.

Quoted 7 lines

Thank you very much for taking the time to review the patch and for your valuable feedback.

I have checked other vendors in the kernel that use the resets property. The minimum number in actual use is 4 (Eswin uses 4, others use 5).

Is it reasonable to add "minItems: 1"?

No, if 4 is the min, then you use 'minItems: 4'.

Rob