Skip to contentSkip to conversation

dt-bindings: dma: snps,dma-spear1340: Fix data{-,_}width schema

PATCH Applied Rob Herring 5 participants 9 messages Mar 11, 2024 – Apr 7, 2024

Subsystems (3)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: dma: snps,dma-spear1340: Fix data{-,_}width schema

'data-width' and 'data_width' properties are defined as arrays, but the schema is defined as a matrix. That works currently since everything gets decoded in to matrices, but that is internal to dtschema and could change.

---
 .../bindings/dma/snps,dma-spear1340.yaml      | 38 +++++++++----------
 1 file changed, 17 insertions(+), 21 deletions(-)
Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml +17 -21
index 5da8291a7de0..7b0ff4afcaa1 100644
@@ -93,10 +93,9 @@ properties:
   data-width:
     $ref: /schemas/types.yaml#/definitions/uint32-array
     description: Data bus width per each DMA master in bytes.
+    maxItems: 4
     items:
-      maxItems: 4
-      items:
-        enum: [4, 8, 16, 32]
+      enum: [4, 8, 16, 32]
 
   data_width:
     $ref: /schemas/types.yaml#/definitions/uint32-array
@@ -106,28 +105,26 @@ properties:
       deprecated. It' usage is discouraged in favor of data-width one. Moreover
       the property incorrectly permits to define data-bus width of 8 and 16
       bits, which is impossible in accordance with DW DMAC IP-core data book.
+    maxItems: 4
     items:
-      maxItems: 4
-      items:
-        enum:
-          - 0 # 8 bits
-          - 1 # 16 bits
-          - 2 # 32 bits
-          - 3 # 64 bits
-          - 4 # 128 bits
-          - 5 # 256 bits
-        default: 0
+      enum:
+        - 0 # 8 bits
+        - 1 # 16 bits
+        - 2 # 32 bits
+        - 3 # 64 bits
+        - 4 # 128 bits
+        - 5 # 256 bits
+      default: 0
 
   multi-block:
     $ref: /schemas/types.yaml#/definitions/uint32-array
     description: |
       LLP-based multi-block transfer supported by hardware per
       each DMA channel.
+    maxItems: 8
     items:
-      maxItems: 8
-      items:
-        enum: [0, 1]
-        default: 1
+      enum: [0, 1]
+      default: 1
 
   snps,max-burst-len:
     $ref: /schemas/types.yaml#/definitions/uint32-array
@@ -138,11 +135,10 @@ properties:
       will be from 1 to max-burst-len words. It's an array property with one
       cell per channel in the units determined by the value set in the
       CTLx.SRC_TR_WIDTH/CTLx.DST_TR_WIDTH fields (data width).
+    maxItems: 8
     items:
-      maxItems: 8
-      items:
-        enum: [4, 8, 16, 32, 64, 128, 256]
-        default: 256
+      enum: [4, 8, 16, 32, 64, 128, 256]
+      default: 256
 
   snps,dma-protection-control:
     $ref: /schemas/types.yaml#/definitions/uint32
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Rob Herring

'data-width' and 'data_width' properties are defined as arrays, but the schema is defined as a matrix. That works currently since everything gets decoded in to matrices, but that is internal to dtschema and could change.

---
 .../bindings/dma/snps,dma-spear1340.yaml      | 38 +++++++++----------
 1 file changed, 17 insertions(+), 21 deletions(-)
Signature · 1 line
viresh
Reviewed-by on v1 1/1
#2 lore raw
In reply to Rob Herring
Quoted 3 lines · Rob Herring

'data-width' and 'data_width' properties are defined as arrays, but the schema is defined as a matrix. That works currently since everything gets decoded in to matrices, but that is internal to dtschema and could change.

Can't remember now why I didn't implement that that way initially. Probably because something didn't work back then during the DT-bindings check procedure. Anyway thanks for fixing the schema.

-Serge(y)

Quoted 83 lines
---
 .../bindings/dma/snps,dma-spear1340.yaml      | 38 +++++++++----------
 1 file changed, 17 insertions(+), 21 deletions(-)
Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml +17 -21
index 5da8291a7de0..7b0ff4afcaa1 100644
@@ -93,10 +93,9 @@ properties:
   data-width:
     $ref: /schemas/types.yaml#/definitions/uint32-array
     description: Data bus width per each DMA master in bytes.
+    maxItems: 4
     items:
-      maxItems: 4
-      items:
-        enum: [4, 8, 16, 32]
+      enum: [4, 8, 16, 32]
 
   data_width:
     $ref: /schemas/types.yaml#/definitions/uint32-array
@@ -106,28 +105,26 @@ properties:
       deprecated. It' usage is discouraged in favor of data-width one. Moreover
       the property incorrectly permits to define data-bus width of 8 and 16
       bits, which is impossible in accordance with DW DMAC IP-core data book.
+    maxItems: 4
     items:
-      maxItems: 4
-      items:
-        enum:
-          - 0 # 8 bits
-          - 1 # 16 bits
-          - 2 # 32 bits
-          - 3 # 64 bits
-          - 4 # 128 bits
-          - 5 # 256 bits
-        default: 0
+      enum:
+        - 0 # 8 bits
+        - 1 # 16 bits
+        - 2 # 32 bits
+        - 3 # 64 bits
+        - 4 # 128 bits
+        - 5 # 256 bits
+      default: 0
 
   multi-block:
     $ref: /schemas/types.yaml#/definitions/uint32-array
     description: |
       LLP-based multi-block transfer supported by hardware per
       each DMA channel.
+    maxItems: 8
     items:
-      maxItems: 8
-      items:
-        enum: [0, 1]
-        default: 1
+      enum: [0, 1]
+      default: 1
 
   snps,max-burst-len:
     $ref: /schemas/types.yaml#/definitions/uint32-array
@@ -138,11 +135,10 @@ properties:
       will be from 1 to max-burst-len words. It's an array property with one
       cell per channel in the units determined by the value set in the
       CTLx.SRC_TR_WIDTH/CTLx.DST_TR_WIDTH fields (data width).
+    maxItems: 8
     items:
-      maxItems: 8
-      items:
-        enum: [4, 8, 16, 32, 64, 128, 256]
-        default: 256
+      enum: [4, 8, 16, 32, 64, 128, 256]
+      default: 256
 
   snps,dma-protection-control:
     $ref: /schemas/types.yaml#/definitions/uint32
Signature · 1 line
2.43.0
author maintainer
#3 lore raw
In reply to Rob Herring
Quoted 9 lines · Rob Herring

'data-width' and 'data_width' properties are defined as arrays, but the schema is defined as a matrix. That works currently since everything gets decoded in to matrices, but that is internal to dtschema and could change.

---
 .../bindings/dma/snps,dma-spear1340.yaml      | 38 +++++++++----------
 1 file changed, 17 insertions(+), 21 deletions(-)

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/dma/snps,dma-spear1340.example.dtb: dma-controller@fc000000: data-width:0: [8, 8] is too short
from schema $id: http://devicetree.org/schemas/dma/snps,dma-spear1340.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/dma/snps,dma-spear1340.example.dtb: dma-controller@fc000000: Unevaluated properties are not allowed ('data-width' was unexpected)
from schema $id: http://devicetree.org/schemas/dma/snps,dma-spear1340.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#4 lore raw
Quoted 1 line · Rob Herring

On Mon, 11 Mar 2024 16:25:22 -0600, Rob Herring wrote:

...

Quoted 1 line

My bot found errors

Well done! :-)

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author maintainer
#5 lore raw
Quoted 9 lines · Andy Shevchenko
Quoted 1 line · Rob Herring

On Mon, 11 Mar 2024 16:25:22 -0600, Rob Herring wrote:

...

Quoted 1 line

My bot found errors

Well done! :-)

Thanks. I was testing locally with some pending dtschema changes while the bot uses the current 'main' branch.

A 'minItems: 1' here should fix this, but I need to look into why the current schema doesn't have that problem. I wouldn't expect a difference.

Rob

maintainer
#6 lore raw
In reply to Rob Herring
Quoted 3 lines · Rob Herring

'data-width' and 'data_width' properties are defined as arrays, but the schema is defined as a matrix. That works currently since everything gets decoded in to matrices, but that is internal to dtschema and could change.

This fails to apply on dmaengine/next.

Can you please rebase?

Quoted 81 lines
---
 .../bindings/dma/snps,dma-spear1340.yaml      | 38 +++++++++----------
 1 file changed, 17 insertions(+), 21 deletions(-)
Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml +17 -21
index 5da8291a7de0..7b0ff4afcaa1 100644
@@ -93,10 +93,9 @@ properties:
   data-width:
     $ref: /schemas/types.yaml#/definitions/uint32-array
     description: Data bus width per each DMA master in bytes.
+    maxItems: 4
     items:
-      maxItems: 4
-      items:
-        enum: [4, 8, 16, 32]
+      enum: [4, 8, 16, 32]
 
   data_width:
     $ref: /schemas/types.yaml#/definitions/uint32-array
@@ -106,28 +105,26 @@ properties:
       deprecated. It' usage is discouraged in favor of data-width one. Moreover
       the property incorrectly permits to define data-bus width of 8 and 16
       bits, which is impossible in accordance with DW DMAC IP-core data book.
+    maxItems: 4
     items:
-      maxItems: 4
-      items:
-        enum:
-          - 0 # 8 bits
-          - 1 # 16 bits
-          - 2 # 32 bits
-          - 3 # 64 bits
-          - 4 # 128 bits
-          - 5 # 256 bits
-        default: 0
+      enum:
+        - 0 # 8 bits
+        - 1 # 16 bits
+        - 2 # 32 bits
+        - 3 # 64 bits
+        - 4 # 128 bits
+        - 5 # 256 bits
+      default: 0
 
   multi-block:
     $ref: /schemas/types.yaml#/definitions/uint32-array
     description: |
       LLP-based multi-block transfer supported by hardware per
       each DMA channel.
+    maxItems: 8
     items:
-      maxItems: 8
-      items:
-        enum: [0, 1]
-        default: 1
+      enum: [0, 1]
+      default: 1
 
   snps,max-burst-len:
     $ref: /schemas/types.yaml#/definitions/uint32-array
@@ -138,11 +135,10 @@ properties:
       will be from 1 to max-burst-len words. It's an array property with one
       cell per channel in the units determined by the value set in the
       CTLx.SRC_TR_WIDTH/CTLx.DST_TR_WIDTH fields (data width).
+    maxItems: 8
     items:
-      maxItems: 8
-      items:
-        enum: [4, 8, 16, 32, 64, 128, 256]
-        default: 256
+      enum: [4, 8, 16, 32, 64, 128, 256]
+      default: 256
 
   snps,dma-protection-control:
     $ref: /schemas/types.yaml#/definitions/uint32
Signature · 1 line
2.43.0
Signature · 1 line
~Vinod
maintainer
#7 lore raw
Quoted 8 lines · Vinod Koul
Quoted 3 lines · Rob Herring

'data-width' and 'data_width' properties are defined as arrays, but the schema is defined as a matrix. That works currently since everything gets decoded in to matrices, but that is internal to dtschema and could change.

This fails to apply on dmaengine/next.

Can you please rebase?

Never mind, the v2 worked just fine

Signature · 1 line
~Vinod
maintainer Applied
#8 lore raw
In reply to Rob Herring
Quoted 5 lines · Rob Herring

'data-width' and 'data_width' properties are defined as arrays, but the schema is defined as a matrix. That works currently since everything gets decoded in to matrices, but that is internal to dtschema and could change.

Applied, thanks!

[1/1] dt-bindings: dma: snps,dma-spear1340: Fix data{-,_}width schema

      commit: 7eccb5a5b224be42431c8087c9c9e016636ff3b5

Best regards,

Signature · 1 line
~Vinod