Re: [PATCH] thermal: samsung: acpm-tmu: Fix spurious CPU throttling
From: Christian Loehle
Date: Wed Nov 18 2026 - 07:06:58 EST
On 11/17/26 16:41, Christian Loehle wrote:
> On 11/17/26 15:37, Tudor Ambarus wrote:
>> Hi, Christian,
>>
>> Thanks for the patch!
>>
>> On 11/17/26 10:34 AM, Christian Loehle wrote:
>>> acpm_tmu_set_trips() supplies two thresholds, but the ACPM command
>>> writes all eight slots, zero-filling the rest. On GS101, slot 7
>>> controls autonomous CPU throttling even when its interrupt is masked.
>>> Programming it to 0 C limits all three CPU clusters to about 200 MHz
>>> on Pixel 6, while cpufreq continues to report the requested
>>> frequencies.
>>
>> Could you share how you discovered this? I don't have access to the
>> ACPM firmware sources, and the downstream driver doesn't state it
>> either.
>
> Neither do I, I discovered this randomly through running regression tests
> on Energy-Aware Scheduling on the Pixel6 and acpm-tmu (7.4-rc1) causes a
> massive energy regression (+~1000%) for the same workloads.
> The reason is this DVFS throttling.
>
>>
>> How did you measure the actual CPU frequency, given that cpufreq
>> keeps reporting the requested one?
>
> PMU counters CPU_CYCLES
>
>>
>> Do you know whether slots 2-6 have any side effects as well?
>
> I hadn't discovered any.
>
>>
>> Also note that Daniel has already queued a set of acpm-tmu fixes in
>> thermal/linux-next, so this patch will need to be reworked on top of
>> them.
>
> will rebase then!
>
>>
>>>
>>> Program slot 7 from the zone's critical trip before enabling the
>>> sensor and preserve it when updating the low/high interrupt window.
>>> Cache the three temperatures so a writable critical trip can update
>>> the hardware without changing that window.
>>
>> I think this can be handled with a smaller change: look up the
>> critical trip in .set_trips() itself. The zone lock is held there, so
>> for_each_thermal_trip() can be used. That avoids caching
>> low/high/critical, the .set_trip_temp() callback and the probe changes.
>
> Ah yep you're right, will fix and resend.
> Thanks!
Okay, maybe I'm missing something but AFAICS we have to do the set_trip_temp
because thermal core looks only at min/max and may skip set_trips() in case
these are unchanged, missing a critical update.
So the minimal I see working is making 'critical' (again, this is my
interpretation of the value, if you want it named anything else, just shoot)
non-writable by failing it's set_trip_temp()?
Or is there another way?