* [PATCH] dt-bindings: thermal: Use signed integers for coefficients
@ 2026-11-03 21:43 Daniel Lezcano
2026-11-05 10:45 ` Lukasz Luba
2026-11-06 13:03 ` Krzysztof Kozlowski
0 siblings, 2 replies; 5+ messages in thread
From: Daniel Lezcano @ 2026-11-03 21:43 UTC (permalink / raw)
To: daniel.lezcano
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
open list:THERMAL,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
The coefficients property describes the coefficients of a linear
equation used to derive a thermal zone temperature. Both the slope
and the constant offset can be negative, and the thermal core stores
them as signed integers.
Existing Device Trees already rely on signed values. OMAP4460 uses
an offset of -9301, while OMAP5 uses offsets of -1791 and -2992.
Broadcom platforms also use negative slopes. Declaring the property
as uint32-array does not represent these values correctly.
Change the property type to int32-array so schema validation decodes
the cells as signed 32-bit integers, matching their intended meaning
and the thermal implementation. The cell width and binary encoding
remain unchanged, preserving compatibility with existing Device
Trees.
Fixes: 1202a442a31f ("dt-bindings: thermal: Add yaml bindings for thermal zones")
Signed-off-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
---
Documentation/devicetree/bindings/thermal/thermal-zones.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
index 999ad40a20d5..72e419124f98 100644
--- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
+++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
@@ -101,7 +101,7 @@ patternProperties:
thermal zone.
coefficients:
- $ref: /schemas/types.yaml#/definitions/uint32-array
+ $ref: /schemas/types.yaml#/definitions/int32-array
description:
An array of integers containing the coefficients of a linear equation
that binds all the sensors listed in this thermal zone.
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dt-bindings: thermal: Use signed integers for coefficients
2026-11-03 21:43 [PATCH] dt-bindings: thermal: Use signed integers for coefficients Daniel Lezcano
@ 2026-11-05 10:45 ` Lukasz Luba
2026-11-05 15:32 ` Daniel Lezcano
2026-11-06 13:03 ` Krzysztof Kozlowski
1 sibling, 1 reply; 5+ messages in thread
From: Lukasz Luba @ 2026-11-05 10:45 UTC (permalink / raw)
To: Daniel Lezcano
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, open list:THERMAL,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
Hi Daniel,
On 11/3/26 21:43, Daniel Lezcano wrote:
> The coefficients property describes the coefficients of a linear
> equation used to derive a thermal zone temperature. Both the slope
> and the constant offset can be negative, and the thermal core stores
> them as signed integers.
>
> Existing Device Trees already rely on signed values. OMAP4460 uses
> an offset of -9301, while OMAP5 uses offsets of -1791 and -2992.
> Broadcom platforms also use negative slopes. Declaring the property
> as uint32-array does not represent these values correctly.
This looks like a good argument which was missed back then (that
the negative values are possible).
>
> Change the property type to int32-array so schema validation decodes
> the cells as signed 32-bit integers, matching their intended meaning
> and the thermal implementation. The cell width and binary encoding
> remain unchanged, preserving compatibility with existing Device
> Trees.
>
> Fixes: 1202a442a31f ("dt-bindings: thermal: Add yaml bindings for thermal zones")
> Signed-off-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
> ---
> Documentation/devicetree/bindings/thermal/thermal-zones.yaml | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> index 999ad40a20d5..72e419124f98 100644
> --- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> +++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> @@ -101,7 +101,7 @@ patternProperties:
> thermal zone.
>
> coefficients:
> - $ref: /schemas/types.yaml#/definitions/uint32-array
> + $ref: /schemas/types.yaml#/definitions/int32-array
> description:
> An array of integers containing the coefficients of a linear equation
> that binds all the sensors listed in this thermal zone.
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Regards,
Lukasz
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dt-bindings: thermal: Use signed integers for coefficients
2026-11-05 10:45 ` Lukasz Luba
@ 2026-11-05 15:32 ` Daniel Lezcano
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Lezcano @ 2026-11-05 15:32 UTC (permalink / raw)
To: Lukasz Luba
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, open list:THERMAL,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
Hi Lukasz,
On 11/5/26 11:45, Lukasz Luba wrote:
> Hi Daniel,
>
> On 11/3/26 21:43, Daniel Lezcano wrote:
>> The coefficients property describes the coefficients of a linear
>> equation used to derive a thermal zone temperature. Both the slope
>> and the constant offset can be negative, and the thermal core stores
>> them as signed integers.
>>
>> Existing Device Trees already rely on signed values. OMAP4460 uses
>> an offset of -9301, while OMAP5 uses offsets of -1791 and -2992.
>> Broadcom platforms also use negative slopes. Declaring the property
>> as uint32-array does not represent these values correctly.
>
> This looks like a good argument which was missed back then (that
> the negative values are possible).
>
>>
>> Change the property type to int32-array so schema validation decodes
>> the cells as signed 32-bit integers, matching their intended meaning
>> and the thermal implementation. The cell width and binary encoding
>> remain unchanged, preserving compatibility with existing Device
>> Trees.
>>
>> Fixes: 1202a442a31f ("dt-bindings: thermal: Add yaml bindings for
>> thermal zones")
>> Signed-off-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
>> ---
>> Documentation/devicetree/bindings/thermal/thermal-zones.yaml | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/thermal/thermal-
>> zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
>> index 999ad40a20d5..72e419124f98 100644
>> --- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
>> +++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
>> @@ -101,7 +101,7 @@ patternProperties:
>> thermal zone.
>> coefficients:
>> - $ref: /schemas/types.yaml#/definitions/uint32-array
>> + $ref: /schemas/types.yaml#/definitions/int32-array
>> description:
>> An array of integers containing the coefficients of a
>> linear equation
>> that binds all the sensors listed in this thermal zone.
>
> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Thanks for the review
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dt-bindings: thermal: Use signed integers for coefficients
2026-11-03 21:43 [PATCH] dt-bindings: thermal: Use signed integers for coefficients Daniel Lezcano
2026-11-05 10:45 ` Lukasz Luba
@ 2026-11-06 13:03 ` Krzysztof Kozlowski
2026-11-06 20:07 ` Rob Herring
1 sibling, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-06 13:03 UTC (permalink / raw)
To: Daniel Lezcano
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
open list:THERMAL,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
On Tue, Nov 03, 2026 at 10:43:57PM +0100, Daniel Lezcano wrote:
> The coefficients property describes the coefficients of a linear
> equation used to derive a thermal zone temperature. Both the slope
> and the constant offset can be negative, and the thermal core stores
> them as signed integers.
>
> Existing Device Trees already rely on signed values. OMAP4460 uses
> an offset of -9301, while OMAP5 uses offsets of -1791 and -2992.
> Broadcom platforms also use negative slopes. Declaring the property
> as uint32-array does not represent these values correctly.
>
> Change the property type to int32-array so schema validation decodes
> the cells as signed 32-bit integers, matching their intended meaning
> and the thermal implementation. The cell width and binary encoding
> remain unchanged, preserving compatibility with existing Device
> Trees.
>
> Fixes: 1202a442a31f ("dt-bindings: thermal: Add yaml bindings for thermal zones")
> Signed-off-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
> ---
> Documentation/devicetree/bindings/thermal/thermal-zones.yaml | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/thermal_of.c still uses u32. Maybe we should have
of_property_read_s32_array() wrapper so the binding can match the ABI
code exactly?
Rob?
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dt-bindings: thermal: Use signed integers for coefficients
2026-11-06 13:03 ` Krzysztof Kozlowski
@ 2026-11-06 20:07 ` Rob Herring
0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2026-11-06 20:07 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Daniel Lezcano, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Krzysztof Kozlowski, Conor Dooley,
open list:THERMAL,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
On Fri, Nov 06, 2026 at 02:03:24PM +0100, Krzysztof Kozlowski wrote:
> On Tue, Nov 03, 2026 at 10:43:57PM +0100, Daniel Lezcano wrote:
> > The coefficients property describes the coefficients of a linear
> > equation used to derive a thermal zone temperature. Both the slope
> > and the constant offset can be negative, and the thermal core stores
> > them as signed integers.
> >
> > Existing Device Trees already rely on signed values. OMAP4460 uses
> > an offset of -9301, while OMAP5 uses offsets of -1791 and -2992.
> > Broadcom platforms also use negative slopes. Declaring the property
> > as uint32-array does not represent these values correctly.
> >
> > Change the property type to int32-array so schema validation decodes
> > the cells as signed 32-bit integers, matching their intended meaning
> > and the thermal implementation. The cell width and binary encoding
> > remain unchanged, preserving compatibility with existing Device
> > Trees.
> >
> > Fixes: 1202a442a31f ("dt-bindings: thermal: Add yaml bindings for thermal zones")
> > Signed-off-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
> > ---
> > Documentation/devicetree/bindings/thermal/thermal-zones.yaml | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> drivers/thermal/thermal_of.c still uses u32. Maybe we should have
> of_property_read_s32_array() wrapper so the binding can match the ABI
> code exactly?
>
> Rob?
Yes, please. I did a pass fixing type mismatches so it would be good to
not add new ones.
Rob
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-06 20:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 21:43 [PATCH] dt-bindings: thermal: Use signed integers for coefficients Daniel Lezcano
2026-11-05 10:45 ` Lukasz Luba
2026-11-05 15:32 ` Daniel Lezcano
2026-11-06 13:03 ` Krzysztof Kozlowski
2026-11-06 20:07 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®