From: Andre Przywara <andre.przywara@arm.com>
To: rajanyadav0307@gmail.com, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Chen-Yu Tsai <wens@kernel.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: dts: allwinner: a100: Add CPU thermal trips and cooling maps
Date: Tue, 3 Nov 2026 11:49:27 +0100 [thread overview]
Message-ID: <85dc4135-4684-4e17-95e4-833cf8753b64@arm.com> (raw)
In-Reply-To: <20261103-a100-thermal-trips-v1-1-73bce7ff0767@gmail.com>
Hi Rajan,
many thanks for sending this!
On 11/3/26 10:09, Rajan Yadav via B4 Relay wrote:
> From: Rajan Yadav <rajanyadav0307@gmail.com>
>
> The CPU thermal zone in sun50i-a100.dtsi has a sensor but no trip
> points, so nothing throttles the CPU as it heats up and nothing shuts
> the system down before it overheats. On a KickPi K5C (A133) without a
> heatsink, the CPU reaches 90 C within minutes of full load.
>
> Add a passive trip at 90 C that throttles all four cores through
> cpufreq, and a critical trip at 110 C, using the same layout as
> sun50i-h6.dtsi.
>
> The temperatures come from the Allwinner BSP (sun50iw10p1.dtsi). The
> BSP drives this zone with the power allocator governor: control starts
> at 70 C, the target is 90 C, and 110 C is critical. The power
> allocator needs a power model of the CPUs (dynamic-power-coefficient),
> which the A100 does not have in mainline, so here the 90 C target
> becomes a step_wise passive trip, and the 110 C critical trip is kept.
> 110 C is also the highest working junction temperature in the
> recommended operating conditions of the A133 datasheet (rev 1.5,
> table 5-2). The absolute maximum is 125 C.
Thanks for the explaining where the temperature values come from!
> The GPU and DDR zones are left without trips, as in the BSP.
>
> Polling stays disabled: the sensor raises an interrupt every 250 ms
> and the driver updates the zone from it, as on the H6.
>
> Tested on a KickPi K5C (A133, no heatsink):
> - one hour of full load on all cores held the CPU at about 90 C, with
> short throttling to 1.32 GHz
> - with thermal emulation, a rising temperature lowers the limit one
> OPP at a time down to 408 MHz, the limit is released below 88 C, and
> 111 C triggers the hardware protection shutdown
>
> Signed-off-by: Rajan Yadav <rajanyadav0307@gmail.com>
Looks good to me, compared to what we have in the H6 and H616, and
confirming the 110C number from the datasheet.
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Cheers,
Andre
P.S. Since you have a device and have been looking at this: can you
check the CPU speed bin selection? I think it's quite wrong for the
A133. The original contribution was just for the A100, using A100
specific ID values. I briefly checked and think they don't make too much
sense on the A133. Also definitely the OPPs are for the A100 only: we
are surely missing the nominal 1.6GHz OPP for the A133, and I think the
other parts (A133P) go even higher.
There are several lists and numbers floating around on the net, and I
think BSP code should have a better way to identify the bins and dies.
I would be grateful if you could dig into this and come up with OPP
updates. Many thanks!
> ---
> arm64: dts: allwinner: a100: Add CPU thermal trips and cooling maps
> ---
> arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi | 29 ++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
> index ba6020989..fce91dc2c 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
> @@ -8,6 +8,7 @@
> #include <dt-bindings/clock/sun50i-a100-r-ccu.h>
> #include <dt-bindings/reset/sun50i-a100-ccu.h>
> #include <dt-bindings/reset/sun50i-a100-r-ccu.h>
> +#include <dt-bindings/thermal/thermal.h>
>
> / {
> interrupt-parent = <&gic>;
> @@ -24,6 +25,7 @@ cpu0: cpu@0 {
> reg = <0x0>;
> enable-method = "psci";
> clocks = <&ccu CLK_CPUX>;
> + #cooling-cells = <2>;
> };
>
> cpu1: cpu@1 {
> @@ -32,6 +34,7 @@ cpu1: cpu@1 {
> reg = <0x1>;
> enable-method = "psci";
> clocks = <&ccu CLK_CPUX>;
> + #cooling-cells = <2>;
> };
>
> cpu2: cpu@2 {
> @@ -40,6 +43,7 @@ cpu2: cpu@2 {
> reg = <0x2>;
> enable-method = "psci";
> clocks = <&ccu CLK_CPUX>;
> + #cooling-cells = <2>;
> };
>
> cpu3: cpu@3 {
> @@ -48,6 +52,7 @@ cpu3: cpu@3 {
> reg = <0x3>;
> enable-method = "psci";
> clocks = <&ccu CLK_CPUX>;
> + #cooling-cells = <2>;
> };
> };
>
> @@ -659,6 +664,30 @@ cpu-thermal {
> polling-delay-passive = <0>;
> polling-delay = <0>;
> thermal-sensors = <&ths 0>;
> +
> + trips {
> + cpu_alert: cpu-alert {
> + temperature = <90000>;
> + hysteresis = <2000>;
> + type = "passive";
> + };
> +
> + cpu-crit {
> + temperature = <110000>;
> + hysteresis = <0>;
> + type = "critical";
> + };
> + };
> +
> + cooling-maps {
> + map0 {
> + trip = <&cpu_alert>;
> + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> + };
> + };
> };
>
> ddr-thermal {
>
> ---
> base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
> change-id: 20261103-a100-thermal-trips-be14e8047b0a
>
> Best regards,
> --
> Rajan Yadav <rajanyadav0307@gmail.com>
next prev parent reply other threads:[~2026-11-03 10:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 9:09 Rajan Yadav via B4 Relay
2026-11-03 9:40 ` Rajan Yadav
2026-11-03 10:49 ` Andre Przywara [this message]
2026-11-03 11:07 ` Chen-Yu Tsai
2026-11-03 14:45 ` Rajan Yadav
2026-11-03 14:47 ` Rajan Yadav
2026-11-03 15:32 ` Chen-Yu Tsai
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=85dc4135-4684-4e17-95e4-833cf8753b64@arm.com \
--to=andre.przywara@arm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jernej.skrabec@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=rajanyadav0307@gmail.com \
--cc=robh@kernel.org \
--cc=samuel@sholland.org \
--cc=wens@kernel.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®