lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 6 Feb 2023 15:43:51 -0800
From:   Brad Larson <blarson@....com>
To:     <krzysztof.kozlowski@...aro.org>
CC:     <adrian.hunter@...el.com>, <alcooperx@...il.com>,
        <andy.shevchenko@...il.com>, <arnd@...db.de>, <blarson@....com>,
        <brad@...sando.io>, <brijeshkumar.singh@....com>,
        <broonie@...nel.org>, <catalin.marinas@....com>,
        <devicetree@...r.kernel.org>, <fancer.lancer@...il.com>,
        <gerg@...ux-m68k.org>, <gsomlo@...il.com>, <krzk@...nel.org>,
        <krzysztof.kozlowski+dt@...aro.org>, <lee.jones@...aro.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <linux-mmc@...r.kernel.org>,
        <p.yadav@...com>, <p.zabel@...gutronix.de>, <piotrs@...ence.com>,
        <rdunlap@...radead.org>, <robh@...nel.org>, <samuel@...lland.org>,
        <suravee.suthikulpanit@....com>, <thomas.lendacky@....com>,
        <ulf.hansson@...aro.org>, <will@...nel.org>,
        <yamada.masahiro@...ionext.com>
Subject: Re: [PATCH v8 06/17] dt-bindings: mfd: amd,pensando-elbasr: Add AMD Pensando Elba System Resource chip

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@...0: 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@...0: 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@...0: 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@...0: 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ