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]
Message-ID: <20251108175244.0b51fac6@kemnade.info>
Date: Sat, 8 Nov 2025 17:52:44 +0100
From: Andreas Kemnade <andreas@...nade.info>
To: Krzysztof Kozlowski <krzk@...nel.org>
Cc: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
 Conor Dooley <conor+dt@...nel.org>, Liam Girdwood <lgirdwood@...il.com>,
 Mark Brown <broonie@...nel.org>, Guenter Roeck <linux@...ck-us.net>,
 devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-hwmon@...r.kernel.org
Subject: Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930

On Sat, 8 Nov 2025 15:46:01 +0100
Krzysztof Kozlowski <krzk@...nel.org> wrote:

> >>> +  fiti,tdly:    
> >>
> >> No, look at datasheet. What values are there? ms.
> >>  
> > Hmm, no to what? I do not understand your comment.  
> 
> Please use proper units for the field expressed in the property name
> suffix and possible values (enum).
> https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml
> 
> You also need default.
> 
> > So I guess a bit what might be options to discuss here:
> > - put raw value for the bitfield here (what is currently done).
> > - put the ms values here (then I would expect a suffix in the property name)
> >   We have the mapping 0ms - 0, 1ms - 1, 2ms - 2, 4ms - 3, so it is
> >   not identical.  
> I don't know what has to be identical. You want here 0, 1, 2 or 4 ms.
> BTW, if you speak about driver complexity, getting register value out of
> above is absolutely trivial, so not a suitable argument.

Ok, no problem with doing that trivial conversion in the driver.

Playing around with dt-binding-check and add enums (and the -ms in a
second step):
  fitipower,tdlys:
    $ref: /schemas/types.yaml#/definitions/uint32-array
    description:
      Power up soft start delay settings tDLY1-4 bitfields in the
      POWERON_DELAY register
    default: <0 0 0 0>
    items:
      - enum:
          - 0
          - 1
          - 2
          - 4
      - enum:
          - 0
          - 1
          - 2
          - 4
      - enum:
          - 0
          - 1
          - 2
          - 4
      - enum:
          - 0
          - 1
          - 2
          - 4


dt-binding-check accepts this, including the example. But if I change it to -ms
as you requested, I get

/home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed:
	'maxItems' is a required property
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'$ref' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'default' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'items' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	Additional properties are not allowed ('$ref', 'default' were unexpected)
		hint: Arrays must be described with a combination of minItems/maxItems/items
	'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
	'<0 0 0 0>' is not of type 'integer'
	hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: '$ref' should not be valid under {'const': '$ref'}
	hint: Standard unit suffix properties don't need a type $ref
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed:
	'maxItems' is a required property
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'$ref' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'default' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'items' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	Additional properties are not allowed ('$ref', 'default' were unexpected)
		hint: Arrays must be described with a combination of minItems/maxItems/items
	'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
	'<0 0 0 0>' is not of type 'integer'
	hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: '$ref' should not be valid under {'const': '$ref'}
	hint: Standard unit suffix properties don't need a type $ref
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#

Leaving out the type $ref does not improve things much.
What is going on here?

Regards,
Andreas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ