Re: [PATCH v24 05/12] dt-bindings: arm: Document reboot mode magic

[email protected]
Newsgroups org.kernel.vger.linux-devicetree,dev.linux.lists.mfd
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Incorrect tuple validation of a 2D `uint32-array`, applying outer array constraints and invalid property-level type `$ref`s to inner elements, breaking validation and dropping the `minimum` constraint.
--

--- Patch [5]: [PATCH v24 05/12] dt-bindings: arm: Document reboot mode magic ---
commit 27b283c27fa751f1b79c98734e61c56bbcfb0f0f
Author: Shivendra Pratap <[email protected]>

dt-bindings: arm: Document reboot mode magic

This commit adds bindings to describe vendor-specific reboot modes in the PSCI
SYSTEM_RESET2 call. The values defined here correspond to valid parameters
for vendor-specific reset types.

> diff --git a/Documentation/devicetree/bindings/arm/psci.yaml b/Documentation/devicetree/bindings/arm/psci.yaml
> index 6e2e0c5518411..7d6a86690a2e5 100644
> --- a/Documentation/devicetree/bindings/arm/psci.yaml
> +++ b/Documentation/devicetree/bindings/arm/psci.yaml
> @@ -98,6 +98,41 @@ properties:
[ ... ]
> +    patternProperties:
> +      "^mode-.*$":
> +        minItems: 1
> +        maxItems: 3
> +        items:
> +          - description: arg1 (vendor-specific SYSTEM_RESET2 reset_type)
> +            allOf:
> +              - $ref: /schemas/types.yaml#/definitions/uint32
> +              - minimum: 0x80000000
> +          - description: arg2 (cookie_lo in 2-cell form, cookie_hi in 3-cell form)
> +            $ref: /schemas/types.yaml#/definitions/uint32
> +          - description: arg3 (cookie_lo in 3-cell form)
> +            $ref: /schemas/types.yaml#/definitions/uint32

[Severity: Medium]
Will this schema correctly validate the property values?

Since dt-schema parses device tree arrays as 2D arrays, applying JSON Schema
items list validation to the outer array evaluates the entire inner tuple as a
single element against the schema for arg1.

This regression can cause dt_binding_check to reject valid device trees because
it ends up validating a 1xN array against uint32, which expects a 1x1 matrix.

Because JSON Schema ignores minimum constraints when applied to an array, is it
possible this silently bypasses the minimum constraint of 0x80000000?

Should this pattern property reference /schemas/types.yaml#/definitions/uint32-array
with the element constraints applied natively under it?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com?part=5
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.