dt-bindings: thermal: Fix false warning with 'phandle' in trips nodes

A pattern property matching essentially anything doesn't work if there
are implicit properties such as 'phandle' which can occur on any node.
One such example popped up recently:

arch/arm64/boot/dts/qcom/sm8650-hdk.dtb: thermal-zones: gpuss0-thermal:trips:phandle: 531 is not of type 'object'
        from schema $id: http://devicetree.org/schemas/thermal/thermal-zones.yaml

Instead of a pattern property, use an "additionalProperties" schema
instead which is the fallback in case of no matching property.

Link: https://patch.msgid.link/20260410223601.1487473-2-robh@kernel.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
This commit is contained in:
Rob Herring (Arm)
2026-04-10 17:17:53 -05:00
parent 07fd339b2c
commit 5d0e969c4e

View File

@@ -129,63 +129,60 @@ patternProperties:
which the thermal framework needs to take action. The actions to which the thermal framework needs to take action. The actions to
be taken are defined in another node called cooling-maps. be taken are defined in another node called cooling-maps.
patternProperties: additionalProperties:
"^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$": type: object
type: object additionalProperties: false
properties: properties:
temperature: temperature:
$ref: /schemas/types.yaml#/definitions/int32 $ref: /schemas/types.yaml#/definitions/int32
minimum: -273000 minimum: -273000
maximum: 200000 maximum: 200000
description: description:
An integer expressing the trip temperature in millicelsius. An integer expressing the trip temperature in millicelsius.
hysteresis: hysteresis:
$ref: /schemas/types.yaml#/definitions/uint32 $ref: /schemas/types.yaml#/definitions/uint32
description: description:
An unsigned integer expressing the hysteresis delta with An unsigned integer expressing the hysteresis delta with
respect to the trip temperature property above, also in respect to the trip temperature property above, also in
millicelsius. Any cooling action initiated by the framework is millicelsius. Any cooling action initiated by the framework is
maintained until the temperature falls below maintained until the temperature falls below
(trip temperature - hysteresis). This potentially prevents a (trip temperature - hysteresis). This potentially prevents a
situation where the trip gets constantly triggered soon after situation where the trip gets constantly triggered soon after
cooling action is removed. cooling action is removed.
type: type:
$ref: /schemas/types.yaml#/definitions/string $ref: /schemas/types.yaml#/definitions/string
enum: enum:
- active # enable active cooling e.g. fans - active # enable active cooling e.g. fans
- passive # enable passive cooling e.g. throttling cpu - passive # enable passive cooling e.g. throttling cpu
- hot # send notification to driver - hot # send notification to driver
- critical # send notification to driver, trigger shutdown - critical # send notification to driver, trigger shutdown
description: | description: |
There are four valid trip types: active, passive, hot, There are four valid trip types: active, passive, hot,
critical. critical.
The critical trip type is used to set the maximum The critical trip type is used to set the maximum
temperature threshold above which the HW becomes temperature threshold above which the HW becomes
unstable and underlying firmware might even trigger a unstable and underlying firmware might even trigger a
reboot. Hitting the critical threshold triggers a system reboot. Hitting the critical threshold triggers a system
shutdown. shutdown.
The hot trip type can be used to send a notification to The hot trip type can be used to send a notification to
the thermal driver (if a .notify callback is registered). the thermal driver (if a .notify callback is registered).
The action to be taken is left to the driver. The action to be taken is left to the driver.
The passive trip type can be used to slow down HW e.g. run The passive trip type can be used to slow down HW e.g. run
the CPU, GPU, bus at a lower frequency. the CPU, GPU, bus at a lower frequency.
The active trip type can be used to control other HW to The active trip type can be used to control other HW to
help in cooling e.g. fans can be sped up or slowed down help in cooling e.g. fans can be sped up or slowed down
required: required:
- temperature - temperature
- hysteresis - hysteresis
- type - type
additionalProperties: false
additionalProperties: false
cooling-maps: cooling-maps:
type: object type: object