Re: [PATCH v1 06/12] thermal: core: Calculate aggregated thermal zone temperatures
From: Daniel Lezcano
Date: Thu Nov 19 2026 - 10:23:01 EST
Hi Anvesh,
On 11/19/26 16:14, Anvesh Jain P wrote:
On 11/19/2026 3:16 PM, Daniel Lezcano wrote:
Replace the aggregate temperature placeholder with a signed fixed-point
affine calculation. Accumulate source temperatures multiplied by their
coefficients using checked 64-bit arithmetic, divide once by the scale
of 1000, and add the existing offset from thermal_zone_params. Reject
arithmetic overflow and results outside the int range without modifying
the output on failure.
Read each source under its zone lock and preserve temperature emulation
and error handling. Use nonblocking lock acquisition to return -EAGAIN
rather than wait for another zone lock while holding the aggregate lock.
Reject exiting sources and invalid temperature readings.
Keep initialization-time checks in the aggregation validator. Require
validated, initialized entries and stable source references
throughout each read. Aggregations of aggregated zones are not supported
yet; source lifetime and detachment synchronization will be integrated
in subsequent changes.
Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxxxxxxxx>
---
[ ... ]
Tested the aggregation series on Glymur CRD with a few local DT
additions for the aggregate zone.
Tested-by: Anvesh Jain P <anvesh.p@xxxxxxxxxxxxxxxx>
Thanks for testing