Skip to content

RK3566 (Radxa ZERO 3): power_allocator_throttle NULL deref on soc-thermal after panfrost loads, no CPU thermal throttling #642

Open

Description

@azmi-plavaga

Environment

  • Board: Radxa ZERO 3W (Radxa ZERO 3 in DT)
  • Kernel: linux-image-6.1.84-18-rk2410-nocsf (Debian 12 bookworm, rsdk build), branch linux-6.1-stan-rkr4.1. The RK356x GPU node is unchanged in 6.1.84-19.
  • GPU driver: panfrost (CONFIG_DRM_PANFROST=m, loaded from the rootfs at about 25 s). mali_kbase is not used.
  • CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR=y

What happens

Every boot, when panfrost registers its devfreq cooling device:

[25.263970] thermal thermal_zone0: power_allocator: devfreq-fde60000.gpu is not a power actor
[25.264000] thermal thermal_zone0: power_allocator: devfreq-fde60000.gpu is not a power actor
[25.264007] thermal thermal_zone0: governor power_allocator failed to bind and the previous one (power_allocator) failed to bind again, thermal zone soc-thermal has no governor

/sys/class/thermal/thermal_zone0/policy then reads (null). Under a second later, the zone's polling work still calls into power_allocator and dereferences NULL:

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000018
Internal error: Oops: 0000000096000006 [#1] SMP
CPU: 0 PID: 38 Comm: kworker/u8:1 Tainted: G           O       6.1.84-18-rk2410-nocsf #18
Hardware name: Radxa ZERO 3 (DT)
Workqueue: events_freezable_power_ thermal_zone_device_check
pc : power_allocator_throttle+0x40/0x798
lr : thermal_zone_device_update+0x298/0x2e0
Call trace:
 power_allocator_throttle+0x40/0x798
 thermal_zone_device_update+0x298/0x2e0
 thermal_zone_device_check+0x1c/0x24
 process_one_work+0x1ac/0x25c
 worker_thread+0x1f4/0x260
 kthread+0xc0/0xd0
 ret_from_fork+0x10/0x20

The kworker dies holding the zone lock, which leads to:

  1. No CPU thermal throttling. soc-thermal's passive trips (75 °C, 85 °C) and its 115 °C critical trip never act. Only the TSADC hardware shutdown at 120 °C is left. With the fan removed under a sustained 2-camera hardware-encode load, the SoC kept climbing at the full 1.8 GHz with cpufreq-cpu0 cur_state at 0. gpu-thermal (zone1) passed 75 °C, which is roughly 81 °C on soc-thermal, still rising about 2–3 °C/min when we stopped the test.
  2. Any read of thermal_zone0/temp blocks forever in D state. That includes sensors (lm-sensors), which reads zone0 first. The blocked task can't be killed and systemctl stop times out.
  3. Load average is inflated by about 2 from boot. irq/22-rockchip_thermal and a kworker/*+events_freezable stay in D state.

zone1 (gpu-thermal) is unaffected. It has no cooling-maps, so power_allocator binds there normally. On this board it reads about 6 °C below soc-thermal under load.

Cause

The gpu@fde60000 node in rk356x.dtsi carries Rockchip's power-model subnode (simple-power-model, dynamic-coefficient = <953>) for mali_kbase. It does not carry the standard dynamic-power-coefficient property that panfrost/devfreq_cooling read. So panfrost registers the GPU cooling device without an energy model, power_allocator rejects it as "not a power actor", and soc-thermal (whose cooling-maps include the GPU) ends up with no governor. The core still calls power_allocator_throttle() with NULL governor_data, hence the oops.

This is the same situation fixed for RK3399 in #532. #616/#617 cover the related power_allocator gap for non-power-actor cooling devices on A733.

Workaround (verified on hardware)

Switching zone0 to step_wise before panfrost loads avoids the bind failure:

# /etc/modprobe.d/zz-thermal-stepwise.conf
install panfrost z=/sys/class/thermal/thermal_zone0; if [ "$(cat $z/type)" = soc-thermal ]; then echo step_wise > $z/policy; fi; /sbin/modprobe --ignore-install panfrost $CMDLINE_OPTS

With this there is no oops and no D-state threads, zone0 reads normally, and its trip points are armed. After boot the policy reads power_allocator again (bound, sustainable_power = 905); I haven't found what switches it back, but it works.

Same fan-off test with the workaround (2 × 1080p30 hardware encode, temperatures from soc-thermal):

Time soc-thermal CPU MHz cpufreq-cpu0 state
+0:00 56 °C 1800 0
+4:33 75 °C 1800 0
+6:34 84 °C 1104 2
+6:49 85 °C 816 4
+7:05 to +7:51 84–85 °C 816–1416 3–4
fan back on 83 °C 1800 0

So power_allocator holds the zone at its 85 °C control temperature and releases once the load is gone.

rsetup's set_thermal_governor can't serve as a workaround. It writes the policy after boot, when zone0 is already wedged, so the write itself blocks.

Suggested fix

Following #532, add dynamic-power-coefficient to the RK356x GPU node so panfrost registers a power actor. Rockchip's own power-model uses 953, but I haven't checked that it is on the same scale as the energy-model coefficient, so it needs validating. Separately, the thermal core probably shouldn't keep calling a governor's throttle() after its bind failed and the zone has no governor. That would turn this from an oops into a warning.

Happy to test a patch or a DT overlay on hardware.

Activity

  1. azmi-plavaga commented on Nov 12, 2026

    @azmi-plavaga
    Author

    Follow-up on the coefficient value: 953 should work as is.

    • dynamic-power-coefficient is read in _get_dt_power() (drivers/opp/of.c) as P[µW] = C · mV² · MHz / 10⁶, so C is in µW/(MHz·V²).
    • The power-model subnode's dynamic-coefficient is in pW/(Hz·V²), and pW/Hz is the same as µW/MHz.

    So the suggested change is one line in the gpu@fde60000 node of rk356x.dtsi:

    #cooling-cells = <2>;
    dynamic-power-coefficient = <953>;
    

    The node is the same in linux-6.1-stan-rkr5.1 and linux-6.12-stan-rkr1.1.

    Separately, the oops itself comes from handle_non_critical_trips() falling back to def_governor->throttle() when the zone has no governor. Here that's power_allocator_throttle() with tz->governor_data == NULL. A if (!params) return 0; guard there would turn it into just the bind warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions