[RPI 3B+ AArch64] System shuts down at 80C CPU temperature

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

[RPI 3B+ AArch64] System shuts down at 80C CPU temperature

Postby r0m » Tue Nov 26, 2019 6:55 am

I've been getting random shutdowns and just found out why, the kernel has an instruction to shut down the system when the CPU temperature reaches 80C.

This threshold is too low, as the design of this board is to start throttling at 85C, meaning at a high load, the system will always shut down. Even by decreasing the temp_limit to 80C in /boot/config.txt, the problem still occurs, as it reaches 80C before it starts throttling down. I don't want to lower the temp_limit to 75C, as by design, this board can handle 85C.

Is there any way I can increase the kernel shut down threshold to 85C or above? I can't find any instruction on how to do so online. Here are the logs from journald just before the shutdown instruction:
$this->bbcode_second_pass_code('', '
Nov 26 07:30:49 arch-pi at-spi-bus-launcher[778]: dbus-daemon[987]: Successfully activated service 'org.a11y.atspi.Registry'
Nov 26 07:30:49 arch-pi at-spi-bus-launcher[778]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
Nov 26 07:32:45 arch-pi kernel: thermal thermal_zone0: critical temperature reached (80 C), shutting down
Nov 26 07:32:46 arch-pi systemd[1]: Stopping Session 1 of user rom.
Nov 26 07:32:47 arch-pi login[472]: pam_unix(login:session): session closed for user rom
Nov 26 07:32:46 arch-pi systemd[1]: Stopped target Bluetooth.
Nov 26 07:32:47 arch-pi at-spi-bus-launcher[778]: X connection to :0 broken (explicit kill or server shutdown).
Nov 26 07:32:48 arch-pi mkinitcpio[1896]: ==> Starting build: none
Nov 26 07:32:48 arch-pi mkinitcpio[1896]: -> Running build hook: [sd-shutdown]
Nov 26 07:32:46 arch-pi systemd[1]: Stopped target Graphical Interface.
Nov 26 07:32:46 arch-pi systemd[1]: Stopped target Sound Card.
Nov 26 07:32:46 arch-pi systemd[1]: Stopped target Timers.
')
r0m
 
Posts: 3
Joined: Tue Nov 26, 2019 6:44 am

Re: [RPI 3B+ AArch64] System shuts down at 80C CPU temperatu

Postby lategoodbye » Thu Nov 28, 2019 6:31 pm

There was a misunderstand during implementation of CPU trip points in mainline kernel. In case you are able to compile the DTB for your board, please try the following patch:

https://gist.github.com/lategoodbye/053 ... 1f34da4c75
lategoodbye
 
Posts: 124
Joined: Sat Dec 29, 2018 1:24 am

Re: [RPI 3B+ AArch64] System shuts down at 80C CPU temperatu

Postby r0m » Tue Dec 03, 2019 9:05 am

I have compiled the linux-aarch64 kernel with this patch and reinstalled it, yet it still shuts down at 80C. I've made sure I properly included the patch file in the PKGBUILD and it's applied during the compiling process.

The way I did this is as follows:
1. I cloned the https://github.com/archlinuxarm/PKGBUILDs repository and then went into PKGBUILDs/core/linux-aarch64
2. I made a new file called fix-cpu-temperature.patch in that directory with your code
3. In there, I edited the PKGBUILD file and added 'fix-cpu-temperature.patch' to the source list
4. I ran makepkg -s and it successfully compiled the kernel with your patch
5. Lastly, I ran pacman -U linux-aarch64-5.4.1-1-aarch64.pkg.tar.xz linux-aarch64-headers-5.4.1-1-aarch64.pkg.tar.xz

I then rebooted and stress tested the board and it shut down again at 80C.

Any ideas?
r0m
 
Posts: 3
Joined: Tue Nov 26, 2019 6:44 am

Re: [RPI 3B+ AArch64] System shuts down at 80C CPU temperatu

Postby lategoodbye » Wed Dec 04, 2019 7:06 am

Actually there is no need to replace the kernel image, because only the devicetree was affected.

Please make sure dtbs/broadcom/bcm2837-rpi-3-b-plus.dtb is updated.

I already tested the patch and it works.
lategoodbye
 
Posts: 124
Joined: Sat Dec 29, 2018 1:24 am

Re: [RPI 3B+ AArch64] System shuts down at 80C CPU temperatu

Postby r0m » Thu Dec 05, 2019 10:01 am

I see that I misunderstood it and it's simpler than I thought. The past day, I have tried to patch the /boot/dtbs/broadcom/bcm2837-rpi-3-b-plus.dtb file but unfortunately can't get it to work yet.

I think I'm doing it wrong, as I'm new to device trees and (de)compiling and patching them. I have converted the bcm2837-rpi-3-b-plus.dtb file to a dts format using the dtc command and then tried applying the patch but I get "1 out of 1 hunk FAILED -- saving rejects to file bcm2837-rpi-3-b-plus.dts.rej".

I then tried manually editing the dts file and found the line which holds the temperature limit, although the temperature was in hexadecimal "temperature = <0x13880>". I changed it to "temperature = <0x15f90>" for 90 degrees and then converted it back to dtb format. I now have a dtb file with the changed temperature, although I still get the same behaviour so it seems like I did it wrong.

Any help in patching the file would be greatly appreciated as I'm new to this.
r0m
 
Posts: 3
Joined: Tue Nov 26, 2019 6:44 am


Return to ARMv8

Who is online

Users browsing this forum: No registered users and 6 guests

cron