Skip to contentSkip to conversation

dt-bindings: opp: switch inner and outer min/maxItems rules for opp-hz

PATCH In review David Heidelberg 3 participants 6 messages Dec 29, 2023 – Mar 4, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: opp: switch inner and outer min/maxItems rules for opp-hz

Fixes issue as:

```
arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dtb: opp-table: opp-200000000:opp-hz:0: [200000000, 0, 0, 150000000, 0, 0, 0, 0, 300000000] is too long
```
Fixes 3cb16ad69bef ("dt-bindings: opp: accept array of frequencies")
---
 Documentation/devicetree/bindings/opp/opp-v2-base.yaml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/opp/opp-v2-base.yaml +2 -3
index e2f8f7af3cf4..86d3aa0eb435 100644
@@ -55,10 +55,9 @@ patternProperties:
           to relate the values to their clocks or the order in which the clocks
           need to be configured and that is left for the implementation
           specific binding.
-        minItems: 1
-        maxItems: 32
         items:
-          maxItems: 1
+          minItems: 1
+          maxItems: 32
 
       opp-microvolt:
         description: |
Signature · 1 line
2.43.0
#1 lore raw
Quoted 2 lines · David Heidelberg

Fixes issue as:
```

Drop, it's not RST, but commit msg.

Quoted 15 lines

arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dtb: opp-table: opp-200000000:opp-hz:0: [200000000, 0, 0, 150000000, 0, 0, 0, 0, 300000000] is too long ```

Fixes 3cb16ad69bef ("dt-bindings: opp: accept array of frequencies")
---
 Documentation/devicetree/bindings/opp/opp-v2-base.yaml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/opp/opp-v2-base.yaml +0 -0
index e2f8f7af3cf4..86d3aa0eb435 100644

Documentation/devicetree/bindings/opp/opp-v2-base.yaml patternProperties: · line 60

Quoted 9 lines
Documentation/devicetree/bindings/opp/opp-v2-base.yaml +2 -3
@@ -55,10 +55,9 @@ patternProperties:
           to relate the values to their clocks or the order in which the clocks
           need to be configured and that is left for the implementation
           specific binding.
-        minItems: 1
-        maxItems: 32
         items:
-          maxItems: 1
+          minItems: 1
+          maxItems: 32

This does not look like correct fix. The original code looked fine - only one item is allowed in each sub-element (array).

Best regards,
Krzysztof

maintainer
#2 lore raw
Quoted 25 lines · Krzysztof Kozlowski
Quoted 2 lines · David Heidelberg

Fixes issue as:
```

Drop, it's not RST, but commit msg.

Quoted 19 lines

arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dtb: opp-table: opp-200000000:opp-hz:0: [200000000, 0, 0, 150000000, 0, 0, 0, 0, 300000000] is too long ```

Fixes 3cb16ad69bef ("dt-bindings: opp: accept array of frequencies")
---
 Documentation/devicetree/bindings/opp/opp-v2-base.yaml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/opp/opp-v2-base.yaml +0 -1
index e2f8f7af3cf4..86d3aa0eb435 100644
@@ -55,10 +55,9 @@ patternProperties:
           to relate the values to their clocks or the order in which the clocks
           need to be configured and that is left for the implementation
           specific binding.
-        minItems: 1
Quoted 8 lines

Documentation/devicetree/bindings/opp/opp-v2-base.yaml patternProperties: · line 60

Quoted 5 lines
Documentation/devicetree/bindings/opp/opp-v2-base.yaml +2 -2
-        maxItems: 32
         items:
-          maxItems: 1
+          minItems: 1
+          maxItems: 32

This does not look like correct fix. The original code looked fine - only one item is allowed in each sub-element (array).

This one is special being 64-bit values so we have an exception in property-units.yaml. The constraints here don't get used in decoding the dtb and the default way of 1 outer element is used.

It doesn't look like opp-hz needs to be a matrix as it is really just an array. Perhaps it should just be changed to an array type. Alternatively, adding 'items: { maxItems: 1 }' to the definition in property-units.yaml fixes the issue as well.

Though we can fix this, I'm looking into if we have other cases where we need this to work as-is. There's probably some room for improvement in how matrix dimensions are handled.

Rob

maintainer
#3 lore raw
Quoted 39 lines · Rob Herring
Quoted 25 lines · Krzysztof Kozlowski
Quoted 2 lines · David Heidelberg

Fixes issue as:
```

Drop, it's not RST, but commit msg.

Quoted 19 lines

arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dtb: opp-table: opp-200000000:opp-hz:0: [200000000, 0, 0, 150000000, 0, 0, 0, 0, 300000000] is too long ```

Fixes 3cb16ad69bef ("dt-bindings: opp: accept array of frequencies")
---
 Documentation/devicetree/bindings/opp/opp-v2-base.yaml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/opp/opp-v2-base.yaml +0 -1
index e2f8f7af3cf4..86d3aa0eb435 100644
@@ -55,10 +55,9 @@ patternProperties:
           to relate the values to their clocks or the order in which the clocks
           need to be configured and that is left for the implementation
           specific binding.
-        minItems: 1
Quoted 8 lines

Documentation/devicetree/bindings/opp/opp-v2-base.yaml patternProperties: · line 60

Quoted 5 lines
Documentation/devicetree/bindings/opp/opp-v2-base.yaml +2 -2
-        maxItems: 32
         items:
-          maxItems: 1
+          minItems: 1
+          maxItems: 32

This does not look like correct fix. The original code looked fine - only one item is allowed in each sub-element (array).

This one is special being 64-bit values so we have an exception in property-units.yaml. The constraints here don't get used in decoding the dtb and the default way of 1 outer element is used.

Quoted 8 lines

It doesn't look like opp-hz needs to be a matrix as it is really just an array. Perhaps it should just be changed to an array type. Alternatively, adding 'items: { maxItems: 1 }' to the definition in property-units.yaml fixes the issue as well.

Though we can fix this, I'm looking into if we have other cases where we need this to work as-is. There's probably some room for improvement in how matrix dimensions are handled.

I've made some improvements on matrix dimensions, but this one is still an issue. Can you respin this dropping 'items: {maxItems: 1}'. I'm going to change the definition in property-units.yaml to uint64-array.

Rob

#4 lore raw
Quoted 42 lines · Rob Herring
Quoted 41 lines · Rob Herring
Quoted 15 lines · Krzysztof Kozlowski
Quoted 2 lines · David Heidelberg

Fixes issue as:
```

Drop, it's not RST, but commit msg.

Quoted 10 lines

arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dtb: opp-table: opp-200000000:opp-hz:0: [200000000, 0, 0, 150000000, 0, 0, 0, 0, 300000000] is too long ```

Fixes 3cb16ad69bef ("dt-bindings: opp: accept array of frequencies")
---
  Documentation/devicetree/bindings/opp/opp-v2-base.yaml | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
Quoted 16 lines
Quoted 5 lines
Documentation/devicetree/bindings/opp/opp-v2-base.yaml +0 -0
index e2f8f7af3cf4..86d3aa0eb435 100644

Documentation/devicetree/bindings/opp/opp-v2-base.yaml patternProperties: · line 60

Quoted 9 lines
Documentation/devicetree/bindings/opp/opp-v2-base.yaml +2 -3
@@ -55,10 +55,9 @@ patternProperties:
            to relate the values to their clocks or the order in which the clocks
            need to be configured and that is left for the implementation
            specific binding.
-        minItems: 1
-        maxItems: 32
          items:
-          maxItems: 1
+          minItems: 1
+          maxItems: 32

This does not look like correct fix. The original code looked fine - only one item is allowed in each sub-element (array).

This one is special being 64-bit values so we have an exception in property-units.yaml. The constraints here don't get used in decoding the dtb and the default way of 1 outer element is used.

It doesn't look like opp-hz needs to be a matrix as it is really just an array. Perhaps it should just be changed to an array type. Alternatively, adding 'items: { maxItems: 1 }' to the definition in property-units.yaml fixes the issue as well.

Quoted 6 lines
Quoted 3 lines

Though we can fix this, I'm looking into if we have other cases where we need this to work as-is. There's probably some room for improvement in how matrix dimensions are handled.

I've made some improvements on matrix dimensions, but this one is still an issue. Can you respin this dropping 'items: {maxItems: 1}'. I'm going to change the definition in property-units.yaml to uint64-array.

Keeping the rest of my changes still generates warnings (today dt-schema git) even with maxItems dropped.

The only working scenario is when I do only the dropping of items: {maxItems: 1} from the original code.

Is it the standalone change of just dropping this what did you desired? If yes, I have the patch prepared.

David

Quoted 2 lines

Rob

Signature · 1 line
David Heidelberg
maintainer
#5 lore raw
Quoted 51 lines · David Heidelberg
Quoted 42 lines · Rob Herring
Quoted 41 lines · Rob Herring
Quoted 15 lines · Krzysztof Kozlowski
Quoted 2 lines · David Heidelberg

Fixes issue as:
```

Drop, it's not RST, but commit msg.

Quoted 10 lines

arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dtb: opp-table: opp-200000000:opp-hz:0: [200000000, 0, 0, 150000000, 0, 0, 0, 0, 300000000] is too long ```

Fixes 3cb16ad69bef ("dt-bindings: opp: accept array of frequencies")
---
  Documentation/devicetree/bindings/opp/opp-v2-base.yaml | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
Quoted 16 lines
Quoted 5 lines
Documentation/devicetree/bindings/opp/opp-v2-base.yaml +0 -0
index e2f8f7af3cf4..86d3aa0eb435 100644

Documentation/devicetree/bindings/opp/opp-v2-base.yaml patternProperties: · line 60

Quoted 9 lines
Documentation/devicetree/bindings/opp/opp-v2-base.yaml +2 -3
@@ -55,10 +55,9 @@ patternProperties:
            to relate the values to their clocks or the order in which the clocks
            need to be configured and that is left for the implementation
            specific binding.
-        minItems: 1
-        maxItems: 32
          items:
-          maxItems: 1
+          minItems: 1
+          maxItems: 32

This does not look like correct fix. The original code looked fine - only one item is allowed in each sub-element (array).

This one is special being 64-bit values so we have an exception in property-units.yaml. The constraints here don't get used in decoding the dtb and the default way of 1 outer element is used.

It doesn't look like opp-hz needs to be a matrix as it is really just an array. Perhaps it should just be changed to an array type. Alternatively, adding 'items: { maxItems: 1 }' to the definition in property-units.yaml fixes the issue as well.

Quoted 6 lines
Quoted 3 lines

Though we can fix this, I'm looking into if we have other cases where we need this to work as-is. There's probably some room for improvement in how matrix dimensions are handled.

I've made some improvements on matrix dimensions, but this one is still an issue. Can you respin this dropping 'items: {maxItems: 1}'. I'm going to change the definition in property-units.yaml to uint64-array.

Quoted 8 lines

Keeping the rest of my changes still generates warnings (today dt-schema git) even with maxItems dropped.

The only working scenario is when I do only the dropping of `items:
{maxItems: 1}` from the original code.

Is it the standalone change of just dropping this what did you desired? If yes, I have the patch prepared.

Yes. I still need to look at changing the type, but that shouldn't hold up the kernel change.

Rob