Fan speed control not working on Pi 5 under Ubuntu 23.10

Bug #2041741 reported by Steve Pringle
90
This bug affects 12 people
Affects Status Importance Assigned to Milestone
linux-raspi (Ubuntu)
Confirmed
High
Unassigned
Mantic
Confirmed
High
Unassigned

Bug Description

The fan speed control when running Ubuntu 23.10 on a Raspberry Pi 5 does not appear to be working. The fan runs at near maximum speed all the time and the cur_state in /sys/class/thermal/cooling_device0/ is stuck at the value of 4 no matter what the CPU temperature. I suspect it is related to this fault reported on Raspberry Pi OS: https://forums.raspberrypi.com/viewtopic.php?t=356881

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Libera.chat.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/2041741/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
affects: ubuntu → linux-raspi (Ubuntu)
Juerg Haefliger (juergh)
tags: added: kern-8417
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux-raspi (Ubuntu):
status: New → Confirmed
Revision history for this message
Jürgen Kreileder (jk) wrote :

This affects at least the pwm-fan and gpio-fan overlays as both are using the step_wise governor.

The problem supposedly has been fixed in raspberrypi rpi-6.5.y: https://github.com/raspberrypi/linux/commit/51c8b070cbf3f5df97a633c5203f729013ab60d0

Jürgen Kreileder (jk)
summary: - Fan speed Control not working on RASPERRY PI 5 RUNNING UBUNTU 23.10
+ Fan speed Control not working on RASPERRY PI RUNNING UBUNTU 23.10
Dave Jones (waveform)
Changed in linux-raspi (Ubuntu):
importance: Undecided → High
Changed in linux-raspi (Ubuntu Mantic):
status: New → Confirmed
importance: Undecided → High
summary: - Fan speed Control not working on RASPERRY PI RUNNING UBUNTU 23.10
+ Fan speed control not working on Pi 5 under Ubuntu 23.10
Revision history for this message
Dave Jones (waveform) wrote :

The step-wise governor certainly appears to have some issues. It would appear our version is reading trip_temp before it is ever initialized (https://git.launchpad.net/ubuntu/+source/linux-raspi/tree/drivers/thermal/gov_step_wise.c#n82). The patch linked from the forum post in the description corrects this; will build a test kernel to see if this fixes the issue.

Revision history for this message
Dave Jones (waveform) wrote :

Incidentally, a work-around to make things more bearable until this can be fixed is as follows:

  $ echo 2 | sudo tee /sys/class/thermal/cooling_device0/cur_state

Where 2 is a medium (and in my opinion, largely silent) fan speed. Valid values are between 0 (off) and 4 (full speed).

Revision history for this message
Dave Jones (waveform) wrote :

@juergh Confirmed that the patch to drivers/thermal/gov_step_wise.c is indeed the root cause. In thermal_zone_trip_update, I changed:

  hyst_temp = trip.temperature

To:

  hyst_temp = trip_temp = trip.temperature;

This ensures trip_temp is not uninitialized when it's read. Also removed the (redundantly added) second call to get_tz_trend; fan operated correctly after installing recompiled kernel.

Revision history for this message
Dave Jones (waveform) wrote :

I've applied the patch to a kernel build in ppa:waveform/fan-fix (https://launchpad.net/~waveform/+archive/ubuntu/fan-fix) which should serve as a temporary fix until the next kernel release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.