From: Christian Loehle <christian.loehle@arm.com>
To: Tudor Ambarus <tudor.ambarus@linaro.org>, bzolnier@gmail.com
Cc: krzk@kernel.org, rafael@kernel.org, daniel.lezcano@kernel.org,
lukasz.luba@arm.com, linux-kernel@vger.kernel.org,
linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org,
Juan Yescas <jyescas@google.com>
Subject: Re: [PATCH] thermal: samsung: acpm-tmu: Fix spurious CPU throttling
Date: Wed, 18 Nov 2026 12:06:47 +0000 [thread overview]
Message-ID: <b2b0ddc6-964f-4d8d-86d4-a0bc24d9022e@arm.com> (raw)
In-Reply-To: <56a7a762-7667-4186-973c-ca0fcb399ecc@arm.com>
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?
prev parent reply other threads:[~2026-11-18 12:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 8:34 Christian Loehle
2026-11-17 15:37 ` Tudor Ambarus
2026-11-17 16:41 ` Christian Loehle
2026-11-18 12:06 ` Christian Loehle [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b2b0ddc6-964f-4d8d-86d4-a0bc24d9022e@arm.com \
--to=christian.loehle@arm.com \
--cc=bzolnier@gmail.com \
--cc=daniel.lezcano@kernel.org \
--cc=jyescas@google.com \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=rafael@kernel.org \
--cc=tudor.ambarus@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®