Re: [PATCH v23 06/13] dt-bindings: arm: Document reboot mode magic

[email protected]
Newsgroups dev.linux.lists.mfd,org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The dt-schema constraints for the reboot mode cells are applied to the outer tuple array rather than the individual 32-bit cells within the tuple, silently bypassing the 0x80000000 minimum value check.
- [Medium] Incorrect use of `additionalProperties: false` alongside `$ref` inside the `reboot-mode` node definition.
--

--- Patch [6]: [PATCH v23 06/13] dt-bindings: arm: Document reboot mode magic ---
commit a9e970af5fba06441f5c9bf2192c866e245aed96
Author: Shivendra Pratap <[email protected]>

dt-bindings: arm: Document reboot mode magic

Add bindings to describe vendor-specific reboot modes. Values here
correspond to valid parameters to vendor-specific reset types in PSCI
SYSTEM_RESET2 call.

> diff --git a/Documentation/devicetree/bindings/arm/psci.yaml b/Documentation/devicetree/bindings/arm/psci.yaml
> index 6e2e0c5518411..11b90e8affb32 100644
> --- a/Documentation/devicetree/bindings/arm/psci.yaml
> +++ b/Documentation/devicetree/bindings/arm/psci.yaml
> @@ -98,6 +98,37 @@ properties:
>        [1] Kernel documentation - ARM idle states bindings
>          Documentation/devicetree/bindings/cpu/idle-states.yaml
>  
> +  reboot-mode:
> +    type: object
> +    $ref: /schemas/power/reset/reboot-mode.yaml#
> +    additionalProperties: false

[Severity: Medium]
Should this use unevaluatedProperties: false instead?

Using additionalProperties: false alongside a $ref does not consider
properties defined by the inherited schema (reboot-mode.yaml) or standard
properties injected by the dt-schema core (such as status or phandle).

This can cause dt_binding_check to incorrectly fail on valid device trees
that include standard properties.

> +    properties:
> +      # "mode-normal" is just SYSTEM_RESET
> +      mode-normal: false
> +    patternProperties:
> +      "^mode-.*$":
> +        minItems: 1
> +        maxItems: 3
> +        items:
> +          - description: arg1 (vendor-specific SYSTEM_RESET2 reset_type)
> +            minimum: 0x80000000

[Severity: Medium]
Does this correctly apply the minimum constraint to the 32-bit cell?

In dt-schema, uint32-array properties are parsed as a 2D array (an array
of tuples). Because items is placed directly under the property definition
here, it applies the minimum: 0x80000000 constraint to the first tuple
(which is an array) instead of the first cell (which is an integer).

Since JSON schema ignores numeric constraints on arrays, this silently
bypasses the check and allows invalid vendor-specific reset types.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260714-arm-psci-system_reset2-vendor-reboots-v23-0-e7453c548c21@oss.qualcomm.com?part=6
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.