linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] dt-bindings: media: nxp, imx7-mipi-csi2: Drop bad if/then schema
@ 2021-12-03 16:48 Rob Herring
  2021-12-03 17:09 ` [PATCH v2] dt-bindings: media: nxp,imx7-mipi-csi2: " Laurent Pinchart
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Herring @ 2021-12-03 16:48 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: devicetree, Rui Miguel Silva, Mauro Carvalho Chehab, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, linux-media, linux-arm-kernel

The if/then schema for 'data-lanes' doesn't work as 'compatible' is at a
different level than 'data-lanes'. To make it work, the if/then schema
would have to be moved to the top level and then whole hierarchy of
nodes down to 'data-lanes' created. I don't think it is worth the
complexity to do that, so let's just drop it.

The error in this schema is masked by a fixup in the tools causing the
'allOf' to get overwritten. Removing the fixup as part of moving to
json-schema draft 2019-09 revealed the issue:

Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.example.dt.yaml: mipi-csi@30750000: ports:port@0:endpoint:data-lanes:0: [1] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.example.dt.yaml: mipi-csi@32e30000: ports:port@0:endpoint:data-lanes:0: [1, 2, 3, 4] is too long
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml

The if condition was always true because 'compatible' did not exist in
'endpoint' node and a non-existent property is true for json-schema.

Fixes: 85b62ff2cb97 ("media: dt-bindings: media: nxp,imx7-mipi-csi2: Add i.MX8MM support")
Cc: Rui Miguel Silva <rmfrfs@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: linux-media@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
v2:
 - Add note that imx7 only supports 2 lanes
---
 .../bindings/media/nxp,imx7-mipi-csi2.yaml         | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml b/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
index 877183cf4278..1ef849dc74d7 100644
--- a/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
+++ b/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
@@ -79,6 +79,8 @@ properties:
 
             properties:
               data-lanes:
+                description:
+                  Note that 'fsl,imx7-mipi-csi2' only supports up to 2 data lines.
                 items:
                   minItems: 1
                   maxItems: 4
@@ -91,18 +93,6 @@ properties:
             required:
               - data-lanes
 
-            allOf:
-              - if:
-                  properties:
-                    compatible:
-                      contains:
-                        const: fsl,imx7-mipi-csi2
-                then:
-                  properties:
-                    data-lanes:
-                      items:
-                        maxItems: 2
-
       port@1:
         $ref: /schemas/graph.yaml#/properties/port
         description:
-- 
2.32.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] dt-bindings: media: nxp,imx7-mipi-csi2: Drop bad if/then schema
  2021-12-03 16:48 [PATCH v2] dt-bindings: media: nxp, imx7-mipi-csi2: Drop bad if/then schema Rob Herring
@ 2021-12-03 17:09 ` Laurent Pinchart
  2021-12-03 17:17   ` Rui Miguel Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Pinchart @ 2021-12-03 17:09 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Rui Miguel Silva, Mauro Carvalho Chehab, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, linux-media, linux-arm-kernel

Hi Rob,

Thank you for the patch.

On Fri, Dec 03, 2021 at 10:48:28AM -0600, Rob Herring wrote:
> The if/then schema for 'data-lanes' doesn't work as 'compatible' is at a
> different level than 'data-lanes'. To make it work, the if/then schema
> would have to be moved to the top level and then whole hierarchy of
> nodes down to 'data-lanes' created. I don't think it is worth the
> complexity to do that, so let's just drop it.
> 
> The error in this schema is masked by a fixup in the tools causing the
> 'allOf' to get overwritten. Removing the fixup as part of moving to
> json-schema draft 2019-09 revealed the issue:
> 
> Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.example.dt.yaml: mipi-csi@30750000: ports:port@0:endpoint:data-lanes:0: [1] is too short
> 	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
> Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.example.dt.yaml: mipi-csi@32e30000: ports:port@0:endpoint:data-lanes:0: [1, 2, 3, 4] is too long
> 	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
> 
> The if condition was always true because 'compatible' did not exist in
> 'endpoint' node and a non-existent property is true for json-schema.
> 
> Fixes: 85b62ff2cb97 ("media: dt-bindings: media: nxp,imx7-mipi-csi2: Add i.MX8MM support")
> Cc: Rui Miguel Silva <rmfrfs@gmail.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: NXP Linux Team <linux-imx@nxp.com>
> Cc: linux-media@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Rob Herring <robh@kernel.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> v2:
>  - Add note that imx7 only supports 2 lanes
> ---
>  .../bindings/media/nxp,imx7-mipi-csi2.yaml         | 14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml b/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
> index 877183cf4278..1ef849dc74d7 100644
> --- a/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
> +++ b/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
> @@ -79,6 +79,8 @@ properties:
>  
>              properties:
>                data-lanes:
> +                description:
> +                  Note that 'fsl,imx7-mipi-csi2' only supports up to 2 data lines.
>                  items:
>                    minItems: 1
>                    maxItems: 4
> @@ -91,18 +93,6 @@ properties:
>              required:
>                - data-lanes
>  
> -            allOf:
> -              - if:
> -                  properties:
> -                    compatible:
> -                      contains:
> -                        const: fsl,imx7-mipi-csi2
> -                then:
> -                  properties:
> -                    data-lanes:
> -                      items:
> -                        maxItems: 2
> -
>        port@1:
>          $ref: /schemas/graph.yaml#/properties/port
>          description:

-- 
Regards,

Laurent Pinchart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] dt-bindings: media: nxp,imx7-mipi-csi2: Drop bad if/then schema
  2021-12-03 17:09 ` [PATCH v2] dt-bindings: media: nxp,imx7-mipi-csi2: " Laurent Pinchart
@ 2021-12-03 17:17   ` Rui Miguel Silva
  0 siblings, 0 replies; 3+ messages in thread
From: Rui Miguel Silva @ 2021-12-03 17:17 UTC (permalink / raw)
  To: Laurent Pinchart, Rob Herring
  Cc: devicetree, Mauro Carvalho Chehab, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	linux-media, linux-arm-kernel

Hi both,
FWIW,
On Fri Dec 3, 2021 at 5:09 PM WET, Laurent Pinchart wrote:

> Hi Rob,
>
> Thank you for the patch.
>
> On Fri, Dec 03, 2021 at 10:48:28AM -0600, Rob Herring wrote:
> > The if/then schema for 'data-lanes' doesn't work as 'compatible' is at a
> > different level than 'data-lanes'. To make it work, the if/then schema
> > would have to be moved to the top level and then whole hierarchy of
> > nodes down to 'data-lanes' created. I don't think it is worth the
> > complexity to do that, so let's just drop it.
> > 
> > The error in this schema is masked by a fixup in the tools causing the
> > 'allOf' to get overwritten. Removing the fixup as part of moving to
> > json-schema draft 2019-09 revealed the issue:
> > 
> > Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.example.dt.yaml: mipi-csi@30750000: ports:port@0:endpoint:data-lanes:0: [1] is too short
> > 	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
> > Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.example.dt.yaml: mipi-csi@32e30000: ports:port@0:endpoint:data-lanes:0: [1, 2, 3, 4] is too long
> > 	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
> > 
> > The if condition was always true because 'compatible' did not exist in
> > 'endpoint' node and a non-existent property is true for json-schema.
> > 
> > Fixes: 85b62ff2cb97 ("media: dt-bindings: media: nxp,imx7-mipi-csi2: Add i.MX8MM support")
> > Cc: Rui Miguel Silva <rmfrfs@gmail.com>
> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> > Cc: Shawn Guo <shawnguo@kernel.org>
> > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
> > Cc: Fabio Estevam <festevam@gmail.com>
> > Cc: NXP Linux Team <linux-imx@nxp.com>
> > Cc: linux-media@vger.kernel.org
> > Cc: linux-arm-kernel@lists.infradead.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>

Cheers,
     Rui
>
> > ---
> > v2:
> >  - Add note that imx7 only supports 2 lanes
> > ---
> >  .../bindings/media/nxp,imx7-mipi-csi2.yaml         | 14 ++------------
> >  1 file changed, 2 insertions(+), 12 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml b/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
> > index 877183cf4278..1ef849dc74d7 100644
> > --- a/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
> > +++ b/Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
> > @@ -79,6 +79,8 @@ properties:
> >  
> >              properties:
> >                data-lanes:
> > +                description:
> > +                  Note that 'fsl,imx7-mipi-csi2' only supports up to 2 data lines.
> >                  items:
> >                    minItems: 1
> >                    maxItems: 4
> > @@ -91,18 +93,6 @@ properties:
> >              required:
> >                - data-lanes
> >  
> > -            allOf:
> > -              - if:
> > -                  properties:
> > -                    compatible:
> > -                      contains:
> > -                        const: fsl,imx7-mipi-csi2
> > -                then:
> > -                  properties:
> > -                    data-lanes:
> > -                      items:
> > -                        maxItems: 2
> > -
> >        port@1:
> >          $ref: /schemas/graph.yaml#/properties/port
> >          description:
>
> -- 
> Regards,
>
> Laurent Pinchart




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-12-03 17:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-03 16:48 [PATCH v2] dt-bindings: media: nxp, imx7-mipi-csi2: Drop bad if/then schema Rob Herring
2021-12-03 17:09 ` [PATCH v2] dt-bindings: media: nxp,imx7-mipi-csi2: " Laurent Pinchart
2021-12-03 17:17   ` Rui Miguel Silva

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).