Board / kernel: Firefly AIBOX-K3, Firefly Bianbu 4.0.8 image, linux-image-6.18.3-generic 6.18.3-1.0.0.4 (k3/firefly-6.18: cb266e72a599/260924). Fan on the CTF2301 controller, driven by the kernel thermal framework from the thermal_cluster0 zone.
Symptom: sitting idle on the desktop at 36-37 °C, the fan spins up to 2400-5100 rpm for 1-4 seconds every 1-3 minutes, then slows down over a minute and stops, and repeats. Nothing is running; the temperature does not move.
What is happening (from a 1 Hz hwmon log and a kernel thermal trace):
-
In
k3-firefly-common.dtsithe first fan trip ofthermal_cluster0is 35 °C (fan 0-50/255) and the second is 40 °C (fan 64-75). The box idles at 36-37 °C, so the step_wise governor is permanently “throttling” the first trip and every 1 °C flicker of the sensor moves the fan state. -
The ctf2301 driver in this kernel truncates the PWM value to the chip’s 46 steps and reports the truncated value back, so step_wise’s +1/-1 steps always end up lower than before. The state ratchets down to 0 in about a minute whichever way the temperature flickers. State 0 writes PWM register 0, which stops the chip’s PWM engine.
-
At 0, with the trip still throttled, step_wise computes “state - 1” in an unsigned variable, wraps, and clamps to the top of the map (50). Restarting the PWM engine from 0 makes the CTF2301 do a full-speed spin-up pulse. That pulse is the noise. Trace excerpt:
fan target 45 -> 43 after temp 37->36 (DROPPING) fan target 43 -> 39 after temp 36->37 (RAISING) ... fan target 4 -> 1 after temp 36->37 (RAISING) fan target 1 -> 50 after temp 37->36 (DROPPING) <- burst
Already fixed in your tree, not in the shipped kernel: commit d07ff3b789c5 “hwmon: ctf2301: fixed the issue of sudden changes in PWM output” (28 Sep 2026) on k3/firefly-6.18 caches the logical PWM value and never writes PWM 0 in normal operation (idle 8/255). It landed four days after the 6.18.3-1.0.0.4 build, and the driver is built in, so the image still has the bug.
Requests:
- Please publish a
linux-image-6.18.3-genericbuild with d07ff3b789c5 for AIBOX-K3 users. - Please revisit the
thermal_cluster0curve: a first fan trip at 35 °C is below this box’s idle temperature. A first trip around 45 °C and a non-zero lower bound on the first cooling map would keep the governor stable even with the old driver.
Workaround I am using until then: a oneshot systemd unit at boot writes 120000 to trip_point_0_temp (parking the only trip whose map starts at 0, which is the one that can ratchet to 0) and 60000 / 62000 / 66000 to trip_point_1_temp / trip_point_2_temp / trip_point_3_temp of the thermal_cluster0 zone (/sys/class/thermal/thermal_zone3 on this image). The fan then stays off at idle and comes on steadily at 25 % from 60 °C. Note that simply raising the first trip (I tried 45 °C) does not help: the trip hysteresis is read-only, and with the fan off the box sits inside the 40-45 °C band, so the kicks just moved there. I have filed the same report with full details on the Firefly-spacemit-linux/linux-6.18 GitHub issue tracker.