linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: mtd: fixed-partitions: Fix 'sercomm,scpart-id' schema
@ 2022-11-11 21:28 Rob Herring
  2022-11-14  9:14 ` Miquel Raynal
  2022-11-17 21:14 ` Miquel Raynal
  0 siblings, 2 replies; 3+ messages in thread
From: Rob Herring @ 2022-11-11 21:28 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Krzysztof Kozlowski
  Cc: Mikhail Zhilkin, linux-mtd, devicetree, linux-kernel

The schema for 'sercomm,scpart-id' is broken. The 'if' condition is
never true because 'compatible' is in the parent node, not the child
node the sub-schema applies to. The example passes as there are no
constraints on additional/unevaluated properties. That's a secondary
issue which is complicated due to nested partitions.

Drop the if/then schema and the unnecessary 'allOf' so that the
'sercomm,scpart-id' property is at least defined.

Cc: Mikhail Zhilkin <csharper2005@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 .../mtd/partitions/fixed-partitions.yaml      | 29 +++++++------------
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
index ad3ccd250802..39b715aad2dc 100644
--- a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
+++ b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
@@ -31,24 +31,17 @@ properties:
 
 patternProperties:
   "@[0-9a-f]+$":
-    allOf:
-      - $ref: "partition.yaml#"
-      - if:
-          properties:
-            compatible:
-              contains:
-                const: sercomm,sc-partitions
-        then:
-          properties:
-            sercomm,scpart-id:
-              description: Partition id in Sercomm partition map. Mtd
-                parser uses this id to find a record in the partition map
-                containing offset and size of the current partition. The
-                values from partition map overrides partition offset and
-                size defined in reg property of the dts. Frequently these
-                values are the same, but may differ if device has bad
-                eraseblocks on a flash.
-              $ref: /schemas/types.yaml#/definitions/uint32
+    $ref: partition.yaml#
+
+    properties:
+      sercomm,scpart-id:
+        description: Partition id in Sercomm partition map. Mtd parser
+          uses this id to find a record in the partition map containing
+          offset and size of the current partition. The values from
+          partition map overrides partition offset and size defined in
+          reg property of the dts. Frequently these values are the same,
+          but may differ if device has bad eraseblocks on a flash.
+        $ref: /schemas/types.yaml#/definitions/uint32
 
 required:
   - "#address-cells"
-- 
2.35.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] dt-bindings: mtd: fixed-partitions: Fix 'sercomm,scpart-id' schema
  2022-11-11 21:28 [PATCH] dt-bindings: mtd: fixed-partitions: Fix 'sercomm,scpart-id' schema Rob Herring
@ 2022-11-14  9:14 ` Miquel Raynal
  2022-11-17 21:14 ` Miquel Raynal
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2022-11-14  9:14 UTC (permalink / raw)
  To: Rob Herring
  Cc: Richard Weinberger, Vignesh Raghavendra, Krzysztof Kozlowski,
	Mikhail Zhilkin, linux-mtd, devicetree, linux-kernel

Hi Rob,

robh@kernel.org wrote on Fri, 11 Nov 2022 15:28:24 -0600:

> The schema for 'sercomm,scpart-id' is broken. The 'if' condition is
> never true because 'compatible' is in the parent node, not the child
> node the sub-schema applies to. The example passes as there are no
> constraints on additional/unevaluated properties. That's a secondary
> issue which is complicated due to nested partitions.
> 
> Drop the if/then schema and the unnecessary 'allOf' so that the
> 'sercomm,scpart-id' property is at least defined.
> 
> Cc: Mikhail Zhilkin <csharper2005@gmail.com>
> Signed-off-by: Rob Herring <robh@kernel.org>

Mmmh right, I've missed that in my little rework. I'll apply it with
the big series "[PATCH v3 00/17]  Improve MTD bindings" as soon as the
last remaining patch gets reviewed.

> ---
>  .../mtd/partitions/fixed-partitions.yaml      | 29 +++++++------------
>  1 file changed, 11 insertions(+), 18 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
> index ad3ccd250802..39b715aad2dc 100644
> --- a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
> +++ b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
> @@ -31,24 +31,17 @@ properties:
>  
>  patternProperties:
>    "@[0-9a-f]+$":
> -    allOf:
> -      - $ref: "partition.yaml#"
> -      - if:
> -          properties:
> -            compatible:
> -              contains:
> -                const: sercomm,sc-partitions
> -        then:
> -          properties:
> -            sercomm,scpart-id:
> -              description: Partition id in Sercomm partition map. Mtd
> -                parser uses this id to find a record in the partition map
> -                containing offset and size of the current partition. The
> -                values from partition map overrides partition offset and
> -                size defined in reg property of the dts. Frequently these
> -                values are the same, but may differ if device has bad
> -                eraseblocks on a flash.
> -              $ref: /schemas/types.yaml#/definitions/uint32
> +    $ref: partition.yaml#
> +
> +    properties:
> +      sercomm,scpart-id:
> +        description: Partition id in Sercomm partition map. Mtd parser
> +          uses this id to find a record in the partition map containing
> +          offset and size of the current partition. The values from
> +          partition map overrides partition offset and size defined in
> +          reg property of the dts. Frequently these values are the same,
> +          but may differ if device has bad eraseblocks on a flash.
> +        $ref: /schemas/types.yaml#/definitions/uint32
>  
>  required:
>    - "#address-cells"


Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] dt-bindings: mtd: fixed-partitions: Fix 'sercomm,scpart-id' schema
  2022-11-11 21:28 [PATCH] dt-bindings: mtd: fixed-partitions: Fix 'sercomm,scpart-id' schema Rob Herring
  2022-11-14  9:14 ` Miquel Raynal
@ 2022-11-17 21:14 ` Miquel Raynal
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2022-11-17 21:14 UTC (permalink / raw)
  To: Rob Herring, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Krzysztof Kozlowski
  Cc: Mikhail Zhilkin, linux-mtd, devicetree, linux-kernel

On Fri, 2022-11-11 at 21:28:24 UTC, Rob Herring wrote:
> The schema for 'sercomm,scpart-id' is broken. The 'if' condition is
> never true because 'compatible' is in the parent node, not the child
> node the sub-schema applies to. The example passes as there are no
> constraints on additional/unevaluated properties. That's a secondary
> issue which is complicated due to nested partitions.
> 
> Drop the if/then schema and the unnecessary 'allOf' so that the
> 'sercomm,scpart-id' property is at least defined.
> 
> Cc: Mikhail Zhilkin <csharper2005@gmail.com>
> Signed-off-by: Rob Herring <robh@kernel.org>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2022-11-17 21:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-11 21:28 [PATCH] dt-bindings: mtd: fixed-partitions: Fix 'sercomm,scpart-id' schema Rob Herring
2022-11-14  9:14 ` Miquel Raynal
2022-11-17 21:14 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).