2024-03-11 22:25:44

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Rob Herring <[email protected]>
---
.../bindings/dma/snps,dma-spear1340.yaml | 38 +++++++++----------
1 file changed, 17 insertions(+), 21 deletions(-)

diff --git a/Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml b/Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml
index 5da8291a7de0..7b0ff4afcaa1 100644
--- a/Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml
+++ b/Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml
@@ -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
--
2.43.0



2024-03-12 06:04:41

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: dma: snps,dma-spear1340: Fix data{-,_}width schema

On 11-03-24, 16:25, Rob Herring wrote:
> '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.
>
> Signed-off-by: Rob Herring <[email protected]>
> ---
> .../bindings/dma/snps,dma-spear1340.yaml | 38 +++++++++----------
> 1 file changed, 17 insertions(+), 21 deletions(-)

Acked-by: Viresh Kumar <[email protected]>

--
viresh

2024-03-12 09:39:23

by Serge Semin

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: dma: snps,dma-spear1340: Fix data{-,_}width schema

On Mon, Mar 11, 2024 at 04:25:22PM -0600, Rob Herring wrote:
> '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.

Reviewed-by: Serge Semin <[email protected]>

-Serge(y)

>
> Signed-off-by: Rob Herring <[email protected]>
> ---
> .../bindings/dma/snps,dma-spear1340.yaml | 38 +++++++++----------
> 1 file changed, 17 insertions(+), 21 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml b/Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml
> index 5da8291a7de0..7b0ff4afcaa1 100644
> --- a/Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml
> +++ b/Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml
> @@ -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
> --
> 2.43.0
>
>

2024-03-12 13:49:15

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: dma: snps,dma-spear1340: Fix data{-,_}width schema


On Mon, 11 Mar 2024 16:25:22 -0600, Rob Herring wrote:
> '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.
>
> Signed-off-by: Rob Herring <[email protected]>
> ---
> .../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.


2024-03-12 15:33:20

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: dma: snps,dma-spear1340: Fix data{-,_}width schema

On Tue, Mar 12, 2024 at 07:49:05AM -0600, Rob Herring wrote:
> On Mon, 11 Mar 2024 16:25:22 -0600, Rob Herring wrote:

..

> My bot found errors

Well done! :-)

--
With Best Regards,
Andy Shevchenko



2024-03-12 17:17:18

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: dma: snps,dma-spear1340: Fix data{-,_}width schema

On Tue, Mar 12, 2024 at 9:33 AM Andy Shevchenko
<[email protected]> wrote:
>
> On Tue, Mar 12, 2024 at 07:49:05AM -0600, Rob Herring wrote:
> > On Mon, 11 Mar 2024 16:25:22 -0600, Rob Herring wrote:
>
> ...
>
> > 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

2024-04-07 13:04:18

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: dma: snps,dma-spear1340: Fix data{-,_}width schema

On 11-03-24, 16:25, Rob Herring wrote:
> '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?

>
> Signed-off-by: Rob Herring <[email protected]>
> ---
> .../bindings/dma/snps,dma-spear1340.yaml | 38 +++++++++----------
> 1 file changed, 17 insertions(+), 21 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml b/Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml
> index 5da8291a7de0..7b0ff4afcaa1 100644
> --- a/Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml
> +++ b/Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml
> @@ -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
> --
> 2.43.0

--
~Vinod

2024-04-07 13:06:06

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: dma: snps,dma-spear1340: Fix data{-,_}width schema

On 07-04-24, 18:34, Vinod Koul wrote:
> On 11-03-24, 16:25, Rob Herring wrote:
> > '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

--
~Vinod

2024-04-07 16:41:34

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: dma: snps,dma-spear1340: Fix data{-,_}width schema


On Mon, 11 Mar 2024 16:25:22 -0600, Rob Herring wrote:
> '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,
--
~Vinod