You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also downgrading to the previous 1.20211118 kernel and bootloader solves it, so something is different with this particular version 1.20220120-1. Indeed a good idea to test with official RPi OS 64-bit. Kernel, bootloader and firmware are however the same, so unless it's something in config.txt or cmdline.txt I'm not sure what could affect something like CPUFreq kernel feature, especially something which affects the RPi 3B+ 🤔 exclusively.
EDIT: Commenting/removal of initial_turbo=20 could be tried (respectively adding it on RPi OS 64-bit). I remember that it broke CPU scheduling in the past with one of the first 5.4 kernel releases.
Can confirm, commenting out initial_turbo=20 from config.txt solves it on my DietPi 8.0.2. I'm guessing initial_turbo isn't enabled by default on stock Debian, then?
Great find. Nope is it not enabled on stock RPi OS. However, it shouldn't break CPUFreq, and it's strange that it does only on RPi 3B+.
@pelwell
Any idea what may cause this what was introduced with last kernel/bootloader release and has been fixed (explicitly or implicitly by another change) in master/rpi-update?
I think we'll apply a live patch for RPi 3B+ to disable initial turbo and in case, when fixed until next DietPi release, offer to have it re-enabled during update. CPUFreq of course is much more important than the little boot time speedup with initial turbo.
@popcornmix
It seems the difference is, if you set initial_turbo=20#4875 (comment). As this is not a default value, it most probably working on plain RPi OS
Hmm, so removing initial turbo from our config solves it but adding it to RPi OS does not cause it? An issue with a combination of initial turbo and something else? There is no overclocking set on RPi 3B+, so what may be closest related is temp_limit and probably gpu_mem_*. Otherwise testing our config.txt (+ arm_64bit=1 which is added later on 64-bit image generation) on RPi OS as a whole. For comparison, here the RPi OS 64-bit config: https://github.com/RPi-Distro/pi-gen/blob/arm64/stage1/00-boot-files/files/config.txt
Sadly I have no 3B+ here for testing. While the issue is solved with next LTS and we have a workaround until then, investigating the underlying reason may still be valuable, probably there is some specific timing involved which may reappear any time later when other things change.
Another question is whether only the 64-bit kernel is affected or whether the same issue appears when using the ARMv6 (Raspbian-based) or ARMv7 (Debian-based) image on RPi 3B+.
So it seems to be only on DietPi, only with 5.10.92-v8+/ARM64, only on the Pi 3B+, and only when Initial Turbo is enabled. And it magically fixed itself with the 5.15.21-v8+ kernel.
As long as it doesn't magically break itself again with the next kernel after that I guess that's good enough...
Steps for further debugging could be: #4875 (comment)
Either commenting other config.txt settings on DietPi which are present only on DietPi by default, while leaving initial turbo enabled, or adding those settings on RPi OS, in addition to initial turbo.
Booting a 3B+ from a RPiOS image with 5.10.92 kernal and the DietPi config.txt (+arm_64bit=1 because the 32-bit kernel is still present) gives a working cpufreq.
Otherwise what shall affect sysfs/whether CPUFreq is loaded or not, given we use the official raspberrypi-kernel, raspberrypi-bootloader, libraspberrypi0, libraspberrypi-bin and raspberrypi-sys-mods from archive.raspberrypi.org without any other modification to the contained files or configs 🤔?
We use different (no) filesystem feature flags on image generation, while pi-gen seems to at least disable huge_file, not sure whether metadata_csum and 64bit are still disabled? Present on one script but not in the others, seems to be only set by pi-gen when USE_QCOW2 env var was set explicitly. However, I cannot imaging how this shall affect anything related. Partitioning and filesystems are otherwise is exactly the same, regarding type, offset and flags.
@AdvancedFollower
Could you paste another full dmesg output from DietPi, with initial turbo set? A serial console really would be helpful 🤔.
I am having this exact issue, no cpu governor. However, changing turbo to 60 didn't fix it, commenting it out of config.txt solved the issue for me and brought back the governors. Below you will find the same commands from the others above, but with a big difference of being on a Pi4B:
Hardware : BCM2835
Revision : c03111
Serial : 100000007138d936
Model : Raspberry Pi 4 Model B Rev 1.1
initial_turbo=20
dietpi@Taskmaster:~$ uname -a
Linux Taskmaster 5.10.92-v8+ #1514 SMP PREEMPT Mon Jan 17 17:39:38 GMT 2022 aarch64 GNU/Linux
dietpi@Taskmaster:~$ vcgencmd version
Jan 20 2022 13:56:48
Copyright (c) 2012 Broadcom
version bd88f66f8952d34e4e0613a85c7a6d3da49e13e2 (clean) (release) (start)
dietpi@Taskmaster:~$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
dietpi@Taskmaster:~$ ls /sys/devices/system/cpu/cpu0
cpu_capacity of_node power regs subsystem topology uevent
dietpi@Taskmaster:~$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
cat: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor: No such file or directory
dietpi@Taskmaster:~$ vcgencmd measure_clock arm
dietpi@Taskmaster:~$ echo performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
tee: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor: No such file or directory
performance
dietpi@Taskmaster:~$ vcgencmd measure_clock arm
frequency(48)=300111328
No Turbo (working)
dietpi@Taskmaster:~$ uname -a
Linux Taskmaster 5.10.92-v8+ #1514 SMP PREEMPT Mon Jan 17 17:39:38 GMT 2022 aarch64 GNU/Linux
dietpi@Taskmaster:~$ vcgencmd version
Jan 20 2022 13:56:48
Copyright (c) 2012 Broadcom
version bd88f66f8952d34e4e0613a85c7a6d3da49e13e2 (clean) (release) (start)
dietpi@Taskmaster:~$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
dietpi@Taskmaster:~$ ls /sys/devices/system/cpu/cpu0
cpu_capacity cpufreq of_node power regs subsystem topology uevent
dietpi@Taskmaster:~$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
conservative
dietpi@Taskmaster:~$ vcgencmd measure_clock arm
frequency(48)=300058592
dietpi@Taskmaster:~$ echo performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
performance
dietpi@Taskmaster:~$ vcgencmd measure_clock arm
frequency(48)=1500345728
Very confusing, we have a bunch of RPi 4 systems where this issue does clearly not appear, probably the specific PCB revision 1.1?
However, to me this points more into the direction that there is a general issue with how firmware and CPUFreq play together, triggered by specific timings (or so) about what is when (not) loaded during boot, which are not met in most cases.
Does apt install rpi-update && rpi-update solve it as well in your case?
Thanks, it makes me feel better when it is not limited to DietPi 😅. Is initial_turbo set on OpenWRT by default, so that this is one combining element for triggering the issue?
vcgencmd version I don't collect (but will do so next time such an event occurs if it helps)... I have posted the git commit hash above that you'd have to extrapolate from
or maybe I do?
[ 0.000000] Linux version 5.10.92 (builder@buildhost) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 11.2.0 r18609-266b5c83c3) 11.2.0, GNU ld (GNU Binutils) 2.37) #0 SMP Mon Jan 17 11:38:43 2022
[ 0.000000] Machine model: Raspberry Pi 4 Model B Rev 1.1
dca632 /usbstick 55°# cat _zPREMOVED/pdmesg-202201181413-5.0.19-7.log | grep firmware
[ 0.049993] raspberrypi-firmware soc:firmware: Attached to firmware from 2022-01-17T19:20:34, variant start
[ 0.060003] raspberrypi-firmware soc:firmware: Firmware hash is bd34f55ef7b01b0a367f131060b561a2a58b80bb
[ 0.368364] cpu cpu0: Cannot get clock for CPU0
[ 0.368386] raspberrypi-cpufreq: probe of raspberrypi-cpufreq failed with error -2
Activity
pelwell commentedon Feb 7, 2022
It's working for me, running the current 64-bit Raspberry Pi OS release:
Joulinar commentedon Feb 7, 2022
@pelwell
Did you tried on RPi3B+? Because for me it looks like this.
scaling_governordoesn't seems to exist.pelwell commentedon Feb 7, 2022
Yes - that output is from a 3B+.
Please try the official 64-bit image, not DietPi.
Joulinar commentedon Feb 7, 2022
interesting point, running
rpi-updateon the very same system, seems to bring backscaling_governor@MichaIng
maybe you like to have a look as well.
MichaIng commentedon Feb 7, 2022
Also downgrading to the previous 1.20211118 kernel and bootloader solves it, so something is different with this particular version 1.20220120-1. Indeed a good idea to test with official RPi OS 64-bit. Kernel, bootloader and firmware are however the same, so unless it's something in config.txt or cmdline.txt I'm not sure what could affect something like CPUFreq kernel feature, especially something which affects the RPi 3B+ 🤔 exclusively.
EDIT: Commenting/removal of
initial_turbo=20could be tried (respectively adding it on RPi OS 64-bit). I remember that it broke CPU scheduling in the past with one of the first 5.4 kernel releases.AdvancedFollower commentedon Feb 8, 2022
Can confirm, commenting out initial_turbo=20 from config.txt solves it on my DietPi 8.0.2. I'm guessing initial_turbo isn't enabled by default on stock Debian, then?
MichaIng commentedon Feb 8, 2022
Great find. Nope is it not enabled on stock RPi OS. However, it shouldn't break CPUFreq, and it's strange that it does only on RPi 3B+.
@pelwell
Any idea what may cause this what was introduced with last kernel/bootloader release and has been fixed (explicitly or implicitly by another change) in master/rpi-update?
I think we'll apply a live patch for RPi 3B+ to disable initial turbo and in case, when fixed until next DietPi release, offer to have it re-enabled during update. CPUFreq of course is much more important than the little boot time speedup with initial turbo.
pelwell commentedon Feb 8, 2022
This is more @popcornmix's domain.
popcornmix commentedon Feb 8, 2022
I've run what I believe @Joulinar ran on RpiOS bullseye with the same firmware and kernel and it appeared to behave as expected.
Joulinar commentedon Feb 8, 2022
@popcornmix
It seems the difference is, if you set
initial_turbo=20#4875 (comment). As this is not a default value, it most probably working on plain RPi OSpopcornmix commentedon Feb 8, 2022
Yes, I had added that.
cpufreq governor is still working. Also tried with initial_turbo=60 and it works.
MichaIng commentedon Feb 8, 2022
Hmm, so removing initial turbo from our config solves it but adding it to RPi OS does not cause it? An issue with a combination of initial turbo and something else? There is no overclocking set on RPi 3B+, so what may be closest related is
temp_limitand probablygpu_mem_*. Otherwise testing our config.txt (+arm_64bit=1which is added later on 64-bit image generation) on RPi OS as a whole. For comparison, here the RPi OS 64-bit config: https://github.com/RPi-Distro/pi-gen/blob/arm64/stage1/00-boot-files/files/config.txtSadly I have no 3B+ here for testing. While the issue is solved with next LTS and we have a workaround until then, investigating the underlying reason may still be valuable, probably there is some specific timing involved which may reappear any time later when other things change.
MichaIng commentedon Feb 8, 2022
Another question is whether only the 64-bit kernel is affected or whether the same issue appears when using the ARMv6 (Raspbian-based) or ARMv7 (Debian-based) image on RPi 3B+.
AdvancedFollower commentedon Feb 9, 2022
@MichaIng
Yes, it works on DietPi ARMv7, just did a fresh install of https://dietpi.com/downloads/images/DietPi_RPi-ARMv7-Bullseye.7z on my 3B+
uname -a
Linux DietPi 5.10.92-v7+ #1514 SMP Mon Jan 17 17:36:39 GMT 2022 armv7l GNU/Linux
vcgencmd version
Jan 20 2022 13:58:39
Copyright (c) 2012 Broadcom
version bd88f66f8952d34e4e0613a85c7a6d3da49e13e2 (clean) (release) (start_cd)
cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
ls /sys/devices/system/cpu/cpu0
cpu_capacity cpufreq of_node power subsystem topology uevent
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
schedutil
vcgencmd measure_clock arm
frequency(48)=900096000
vcgencmd get_config initial_turbo
initial_turbo=20
echo performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
performance
vcgencmd measure_clock arm
frequency(48)=1400000000
pelwell commentedon Feb 9, 2022
Same here - cpufreq is working fine running the most recent 64-bit kernel (5.15.21-v8+) on a 3B+ with initial_turbo=60.
AdvancedFollower commentedon Feb 9, 2022
So it seems to be only on DietPi, only with 5.10.92-v8+/ARM64, only on the Pi 3B+, and only when Initial Turbo is enabled. And it magically fixed itself with the 5.15.21-v8+ kernel.
As long as it doesn't magically break itself again with the next kernel after that I guess that's good enough...
pelwell commentedon Feb 9, 2022
Rewinding to rpi-5.10.92-v8+ (
sudo rpi-update b4145cfaa) on 3B+ with initial_turbo=60 and RPiOS still works.MichaIng commentedon Feb 9, 2022
Steps for further debugging could be: #4875 (comment)
Either commenting other config.txt settings on DietPi which are present only on DietPi by default, while leaving initial turbo enabled, or adding those settings on RPi OS, in addition to initial turbo.
pelwell commentedon Feb 9, 2022
Booting a 3B+ from a RPiOS image with 5.10.92 kernal and the DietPi config.txt (+
arm_64bit=1because the 32-bit kernel is still present) gives a working cpufreq.It's not the config.txt settings.
MichaIng commentedon Feb 9, 2022
I cannot imagine at all that something from cmdline.txt may cause this:
Otherwise what shall affect sysfs/whether CPUFreq is loaded or not, given we use the official raspberrypi-kernel, raspberrypi-bootloader, libraspberrypi0, libraspberrypi-bin and raspberrypi-sys-mods from
archive.raspberrypi.orgwithout any other modification to the contained files or configs 🤔?We use different (no) filesystem feature flags on image generation, while
pi-genseems to at least disablehuge_file, not sure whethermetadata_csumand64bitare still disabled? Present on one script but not in the others, seems to be only set by pi-gen whenUSE_QCOW2env var was set explicitly. However, I cannot imaging how this shall affect anything related. Partitioning and filesystems are otherwise is exactly the same, regarding type, offset and flags.@AdvancedFollower
Could you paste another full
dmesgoutput from DietPi, with initial turbo set? A serial console really would be helpful 🤔.v8.1
Live patch 2 v8.1 (#5257)
V1d1o7 commentedon Feb 24, 2022
I am having this exact issue, no cpu governor. However, changing turbo to 60 didn't fix it, commenting it out of config.txt solved the issue for me and brought back the governors. Below you will find the same commands from the others above, but with a big difference of being on a Pi4B:
initial_turbo=20
No Turbo (working)
MichaIng commentedon Feb 24, 2022
Very confusing, we have a bunch of RPi 4 systems where this issue does clearly not appear, probably the specific PCB revision 1.1?
However, to me this points more into the direction that there is a general issue with how firmware and CPUFreq play together, triggered by specific timings (or so) about what is when (not) loaded during boot, which are not met in most cases.
Does
apt install rpi-update && rpi-updatesolve it as well in your case?wulfy23 commentedon Feb 24, 2022
https://forum.openwrt.org/t/rpi4-community-build/69998/1986?u=wulfy23
https://forum.openwrt.org/t/rpi4-community-build/69998/1991?u=wulfy23
165bd7bc5622ee1c721aa5da9af68935075abedd + kernel 5.10.92-ish
edit: hash above was wrong re-tested with 5.10.100
reverting to some 6months older elf-dat resolved...
MichaIng commentedon Feb 24, 2022
Thanks, it makes me feel better when it is not limited to DietPi 😅. Is
initial_turboset on OpenWRT by default, so that this is one combining element for triggering the issue?wulfy23 commentedon Feb 24, 2022
nope... this is all 5.10.92 and the newer firmware from around that date...
(approx 100 users of identical code with all sorts of config.txt stuff and all had the issue)
popcornmix commentedon Feb 24, 2022
@wulfy23 posting output of
vcgencmd version
uname -a
and contents of config.txt and cmdline.txt would be useful (when cpufreq governor is missing).
wulfy23 commentedon Feb 24, 2022
config.txt or cmdline.txt play no role as discussed...
vcgencmd version I don't collect (but will do so next time such an event occurs if it helps)... I have posted the git commit hash above that you'd have to extrapolate from
or maybe I do?
and should you need the image in question;
http://rpi4.wulfy23.info/builds/devel/rpi-4_snapshot_5.0.19-7_r18609_extra_popcornmix/rpi4.64-snapshot-27266-5.0.19-7-r18609-ext4-fac.img.gz
(allow 3mins for the device to initialize on firstboot, web-ui/ssh is accessible at 192.168.1.1 from dhcp enabled client)