All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Larson <blarson@amd.com>
To: <krzysztof.kozlowski@linaro.org>
Cc: <adrian.hunter@intel.com>, <alcooperx@gmail.com>,
	<andy.shevchenko@gmail.com>, <arnd@arndb.de>, <blarson@amd.com>,
	<brad@pensando.io>, <brijeshkumar.singh@amd.com>,
	<broonie@kernel.org>, <catalin.marinas@arm.com>,
	<devicetree@vger.kernel.org>, <fancer.lancer@gmail.com>,
	<gerg@linux-m68k.org>, <gsomlo@gmail.com>, <krzk@kernel.org>,
	<krzysztof.kozlowski+dt@linaro.org>, <lee.jones@linaro.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linux-mmc@vger.kernel.org>,
	<p.yadav@ti.com>, <p.zabel@pengutronix.de>, <piotrs@cadence.com>,
	<rdunlap@infradead.org>, <robh@kernel.org>, <samuel@sholland.org>,
	<suravee.suthikulpanit@amd.com>, <thomas.lendacky@amd.com>,
	<ulf.hansson@linaro.org>, <will@kernel.org>,
	<yamada.masahiro@socionext.com>
Subject: Re: [PATCH v8 06/17] dt-bindings: mfd: amd,pensando-elbasr: Add AMD Pensando Elba System Resource chip
Date: Mon, 6 Feb 2023 15:43:51 -0800	[thread overview]
Message-ID: <20230206234351.38278-1-blarson@amd.com> (raw)
In-Reply-To: <039986bb-a3e0-2482-9853-30532df10ff8@linaro.org>

Hi Krzysztof,

On 01/02/2023 10:57, Krzysztof Kozlowski wrote:
>On 30/01/2023 20:12, Brad Larson wrote:
...
>> This has been changed to one device and four chip selects. This binding error
>> is occuring for snps,dw-apb-ssi.yaml using reg for the chip selects.  Any
>> guidance on how to fix? 
>> 
>> $ make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
>>   LINT    Documentation/devicetree/bindings
>>   CHKDT   Documentation/devicetree/bindings/processed-schema.json
>>   SCHEMA  Documentation/devicetree/bindings/processed-schema.json
>>   DTC_CHK arch/arm64/boot/dts/amd/elba-asic.dtb
>> /home/brad/linux.v10/arch/arm64/boot/dts/amd/elba-asic.dtb: spi@2800: system-controller@0:reg: [[0], [1], [2], [3]] is too long
>> 	From schema: /home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
>
> Maybe this would work in snps,dw-apb-ssi for children:
>
> reg:
>   items:
>     minimum: 0
>     maximum: 3

With the above change here in snps,dw-apb-ssi.yaml:

  - if:
      properties:
        compatible:
          contains:
            const: amd,pensando-elba-spi
    then:
      properties:
        reg:
          items:
            minimum: 0
            maximum: 3
      required:
        - amd,pensando-elba-syscon
    else:
      properties:
        amd,pensando-elba-syscon: false

this is the result:

$ make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
  LINT    Documentation/devicetree/bindings
  CHKDT   Documentation/devicetree/bindings/processed-schema.json
  SCHEMA  Documentation/devicetree/bindings/processed-schema.json
  DTC_CHK arch/arm64/boot/dts/amd/elba-asic.dtb
/home/brad/linux.v10/arch/arm64/boot/dts/amd/elba-asic.dtb: spi@2800: reg:0: [0, 10240, 0, 256] is too long
	From schema: /home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
/home/brad/linux.v10/arch/arm64/boot/dts/amd/elba-asic.dtb: spi@2800: system-controller@0:reg: [[0], [1], [2], [3]] is too long
	From schema: /home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml

The binding snps,dw-apb-ssi.yaml has patternProperties defined this way:

patternProperties:
  "^.*@[0-9a-f]+$":
    type: object
    properties:
      reg:
        minimum: 0
        maximum: 3

- Removing patternProperties makes the error go away indicating an issue with minimum/maximum regex check
and the number of items in the reg property which shouldn't be related.

- Changing patternProperties to this makes the error go away.
patternProperties:
  "^.*@[0-9a-f]+$":
    type: object
    properties:
      reg:
        maxItems: 4

- Using spmi.yaml as a reference and changing patternProperties to the following:
patternProperties:
  "^.*@[0-9a-f]+$":
    type: object
    properties:
      reg:
        items:
          - maxItems: 4
            items:
              - minimum: 0
              - maximum: 3
    required:
      - reg

results in:

$ make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
arch/arm64/Makefile:36: Detected assembler with broken .inst; disassembly will be unreliable
  LINT    Documentation/devicetree/bindings
  CHKDT   Documentation/devicetree/bindings/processed-schema.json
/home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml: patternProperties:^.*@[0-9a-f]+$:properties:reg:items: 'oneOf' conditional failed, one must be fixed:
	[{'maxItems': 4, 'items': [{'minimum': 0}, {'maximum': 3}]}] is not of type 'object'
	{'maxItems': 4, 'items': [{'minimum': 0}, {'maximum': 3}]} should not be valid under {'required': ['maxItems']}
		hint: "maxItems" is not needed with an "items" list
	from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
  SCHEMA  Documentation/devicetree/bindings/processed-schema.json
  DTC_CHK arch/arm64/boot/dts/amd/elba-asic.dtb


- With this version for patternProperties, to retain minimum/maximum, the original error occurs:
patternProperties:
  "^.*@[0-9a-f]+$":
    type: object
    properties:
      reg:
        items:
          - minItems: 1
            items:
              - minimum: 0
              - maximum: 3
    required:
      - reg

$ make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
arch/arm64/Makefile:36: Detected assembler with broken .inst; disassembly will be unreliable
  LINT    Documentation/devicetree/bindings
  CHKDT   Documentation/devicetree/bindings/processed-schema.json
  SCHEMA  Documentation/devicetree/bindings/processed-schema.json

  DTC_CHK arch/arm64/boot/dts/amd/elba-asic.dtb
/home/brad/linux.v10/arch/arm64/boot/dts/amd/elba-asic.dtb: spi@2800: system-controller@0:reg: [[0], [1], [2], [3]] is too long
	From schema: /home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml

Regards,
Brad

WARNING: multiple messages have this Message-ID (diff)
From: Brad Larson <blarson@amd.com>
To: <krzysztof.kozlowski@linaro.org>
Cc: <adrian.hunter@intel.com>, <alcooperx@gmail.com>,
	<andy.shevchenko@gmail.com>, <arnd@arndb.de>, <blarson@amd.com>,
	<brad@pensando.io>, <brijeshkumar.singh@amd.com>,
	<broonie@kernel.org>, <catalin.marinas@arm.com>,
	<devicetree@vger.kernel.org>, <fancer.lancer@gmail.com>,
	<gerg@linux-m68k.org>, <gsomlo@gmail.com>, <krzk@kernel.org>,
	<krzysztof.kozlowski+dt@linaro.org>, <lee.jones@linaro.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linux-mmc@vger.kernel.org>,
	<p.yadav@ti.com>, <p.zabel@pengutronix.de>, <piotrs@cadence.com>,
	<rdunlap@infradead.org>, <robh@kernel.org>, <samuel@sholland.org>,
	<suravee.suthikulpanit@amd.com>, <thomas.lendacky@amd.com>,
	<ulf.hansson@linaro.org>, <will@kernel.org>,
	<yamada.masahiro@socionext.com>
Subject: Re: [PATCH v8 06/17] dt-bindings: mfd: amd,pensando-elbasr: Add AMD Pensando Elba System Resource chip
Date: Mon, 6 Feb 2023 15:43:51 -0800	[thread overview]
Message-ID: <20230206234351.38278-1-blarson@amd.com> (raw)
In-Reply-To: <039986bb-a3e0-2482-9853-30532df10ff8@linaro.org>

Hi Krzysztof,

On 01/02/2023 10:57, Krzysztof Kozlowski wrote:
>On 30/01/2023 20:12, Brad Larson wrote:
...
>> This has been changed to one device and four chip selects. This binding error
>> is occuring for snps,dw-apb-ssi.yaml using reg for the chip selects.  Any
>> guidance on how to fix? 
>> 
>> $ make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
>>   LINT    Documentation/devicetree/bindings
>>   CHKDT   Documentation/devicetree/bindings/processed-schema.json
>>   SCHEMA  Documentation/devicetree/bindings/processed-schema.json
>>   DTC_CHK arch/arm64/boot/dts/amd/elba-asic.dtb
>> /home/brad/linux.v10/arch/arm64/boot/dts/amd/elba-asic.dtb: spi@2800: system-controller@0:reg: [[0], [1], [2], [3]] is too long
>> 	From schema: /home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
>
> Maybe this would work in snps,dw-apb-ssi for children:
>
> reg:
>   items:
>     minimum: 0
>     maximum: 3

With the above change here in snps,dw-apb-ssi.yaml:

  - if:
      properties:
        compatible:
          contains:
            const: amd,pensando-elba-spi
    then:
      properties:
        reg:
          items:
            minimum: 0
            maximum: 3
      required:
        - amd,pensando-elba-syscon
    else:
      properties:
        amd,pensando-elba-syscon: false

this is the result:

$ make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
  LINT    Documentation/devicetree/bindings
  CHKDT   Documentation/devicetree/bindings/processed-schema.json
  SCHEMA  Documentation/devicetree/bindings/processed-schema.json
  DTC_CHK arch/arm64/boot/dts/amd/elba-asic.dtb
/home/brad/linux.v10/arch/arm64/boot/dts/amd/elba-asic.dtb: spi@2800: reg:0: [0, 10240, 0, 256] is too long
	From schema: /home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
/home/brad/linux.v10/arch/arm64/boot/dts/amd/elba-asic.dtb: spi@2800: system-controller@0:reg: [[0], [1], [2], [3]] is too long
	From schema: /home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml

The binding snps,dw-apb-ssi.yaml has patternProperties defined this way:

patternProperties:
  "^.*@[0-9a-f]+$":
    type: object
    properties:
      reg:
        minimum: 0
        maximum: 3

- Removing patternProperties makes the error go away indicating an issue with minimum/maximum regex check
and the number of items in the reg property which shouldn't be related.

- Changing patternProperties to this makes the error go away.
patternProperties:
  "^.*@[0-9a-f]+$":
    type: object
    properties:
      reg:
        maxItems: 4

- Using spmi.yaml as a reference and changing patternProperties to the following:
patternProperties:
  "^.*@[0-9a-f]+$":
    type: object
    properties:
      reg:
        items:
          - maxItems: 4
            items:
              - minimum: 0
              - maximum: 3
    required:
      - reg

results in:

$ make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
arch/arm64/Makefile:36: Detected assembler with broken .inst; disassembly will be unreliable
  LINT    Documentation/devicetree/bindings
  CHKDT   Documentation/devicetree/bindings/processed-schema.json
/home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml: patternProperties:^.*@[0-9a-f]+$:properties:reg:items: 'oneOf' conditional failed, one must be fixed:
	[{'maxItems': 4, 'items': [{'minimum': 0}, {'maximum': 3}]}] is not of type 'object'
	{'maxItems': 4, 'items': [{'minimum': 0}, {'maximum': 3}]} should not be valid under {'required': ['maxItems']}
		hint: "maxItems" is not needed with an "items" list
	from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
  SCHEMA  Documentation/devicetree/bindings/processed-schema.json
  DTC_CHK arch/arm64/boot/dts/amd/elba-asic.dtb


- With this version for patternProperties, to retain minimum/maximum, the original error occurs:
patternProperties:
  "^.*@[0-9a-f]+$":
    type: object
    properties:
      reg:
        items:
          - minItems: 1
            items:
              - minimum: 0
              - maximum: 3
    required:
      - reg

$ make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
arch/arm64/Makefile:36: Detected assembler with broken .inst; disassembly will be unreliable
  LINT    Documentation/devicetree/bindings
  CHKDT   Documentation/devicetree/bindings/processed-schema.json
  SCHEMA  Documentation/devicetree/bindings/processed-schema.json

  DTC_CHK arch/arm64/boot/dts/amd/elba-asic.dtb
/home/brad/linux.v10/arch/arm64/boot/dts/amd/elba-asic.dtb: spi@2800: system-controller@0:reg: [[0], [1], [2], [3]] is too long
	From schema: /home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml

Regards,
Brad

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

  reply	other threads:[~2023-02-06 23:44 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16  1:04 [PATCH v7 06/17] dt-bindings: mfd: amd,pensando-elbasr: Add AMD Pensando Elba System Resource chip Brad Larson
2022-11-16  1:04 ` Brad Larson
2022-11-16  8:45 ` Krzysztof Kozlowski
2022-11-16  8:45   ` Krzysztof Kozlowski
2022-11-16  8:46 ` Krzysztof Kozlowski
2022-11-16  8:46   ` Krzysztof Kozlowski
2022-11-16 19:39   ` [PATCH v8 " Brad Larson
2022-11-16 19:39     ` Brad Larson
2022-11-16 22:30     ` Rob Herring
2022-11-16 22:30       ` Rob Herring
2022-11-17  0:41       ` Larson, Bradley
2022-11-17  0:41         ` Larson, Bradley
2022-11-17 12:33         ` Krzysztof Kozlowski
2022-11-17 12:33           ` Krzysztof Kozlowski
2022-11-17 13:14         ` Rob Herring
2022-11-17 13:14           ` Rob Herring
2022-11-17 18:37         ` Larson, Bradley
2022-11-17 18:37           ` Larson, Bradley
2022-11-18  8:42           ` Geert Uytterhoeven
2022-11-18  8:42             ` Geert Uytterhoeven
2022-11-18 18:29             ` Larson, Bradley
2022-11-18 18:29               ` Larson, Bradley
2023-01-30 19:12       ` Brad Larson
2023-01-30 19:12         ` Brad Larson
2023-02-01  9:57         ` Krzysztof Kozlowski
2023-02-01  9:57           ` Krzysztof Kozlowski
2023-02-06 23:43           ` Brad Larson [this message]
2023-02-06 23:43             ` Brad Larson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230206234351.38278-1-blarson@amd.com \
    --to=blarson@amd.com \
    --cc=adrian.hunter@intel.com \
    --cc=alcooperx@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=arnd@arndb.de \
    --cc=brad@pensando.io \
    --cc=brijeshkumar.singh@amd.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fancer.lancer@gmail.com \
    --cc=gerg@linux-m68k.org \
    --cc=gsomlo@gmail.com \
    --cc=krzk@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=p.yadav@ti.com \
    --cc=p.zabel@pengutronix.de \
    --cc=piotrs@cadence.com \
    --cc=rdunlap@infradead.org \
    --cc=robh@kernel.org \
    --cc=samuel@sholland.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=thomas.lendacky@amd.com \
    --cc=ulf.hansson@linaro.org \
    --cc=will@kernel.org \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.