Raspberry Pi -- no freq scaling on archlinuxarm's kernel 5.4

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Raspberry Pi -- no freq scaling on archlinuxarm's kernel 5.4

Postby zertyz » Fri May 29, 2020 11:12 pm

Hi, friends.

I don't know if here is the right place to report this kind of problem (kernel related) -- please direct me if not.

the new 5.4.? kernels (ArchLinux version) don't allow the CPU & friends to scale up either on rPi 1 and rPi 2.

On rPi2 the issue is silent, but on rPi1, I get the following on dmesg, early on boot:

[ 9.512249] WARNING: CPU: 0 PID: 1 at drivers/cpufreq/cpufreq-dt.c:69 find_supply_name+0x84/0xa0
[ 9.517444] Modules linked in:
(...)
-- currently I am on 5.4.42-1-ARCH, but this also happened on 5.4.40.

and the rPi1 stays at:
[root@PinkPi ~]# /opt/vc/bin/vcgencmd measure_clock core
frequency(1)=250000000
[root@PinkPi ~]# /opt/vc/bin/vcgencmd measure_clock arm
frequency(48)=700074000

no metter what is the load -- despite my config.txt is:

# maximum turbo for rPi1
arm_freq=1000
gpu_freq=500
sdram_freq=600
over_voltage=6
over_voltage_sdram=6
initial_turbo=60

NOTE: this config works fine on kernels 4.19.x on rPi1 (and a similar one also works on rPi2).


I also posted on the Raspberry Pi kernel's git repository, where I attached the config.gz and dmesg -- https://github.com/raspberrypi/linux/issues/3637

... They said it is due to the kernel configs the ArchLinuxARM teams use...
zertyz
 
Posts: 1
Joined: Thu May 28, 2020 2:30 pm

Re: Raspberry Pi -- no freq scaling on archlinuxarm's kernel

Postby keithspg » Fri Aug 07, 2020 3:06 pm

Just updated to 5.4.51-1 and this is still present.

I built a 'default RPi' config and compared it to the Arch one in the linux-raspberrypi and see that there are some differences. Below is a diff snippet. I do not know what all this means, but it appears that some of these config settings may have been pulled from 4.19.y and are not relevant in 5.4.y? I'd love to hear form someone that knows more than I do. I also do not know how to notify the maintainer of this package that there is a problem. It has been here since the first 5.4 kernel. I may make a WAG at the config and build this kernel and see if the problem goes away.

Code: Select all
Arch Config                             Rpi official
CONFIG_CPU_FREQ=y                       CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y          CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y            CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_STAT=y                  CONFIG_CPU_FREQ_STAT=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMA  # CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMA
NCE is not set                          NCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAV  CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=
E is not set                            y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPAC  # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPAC
E is not set                            E is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y  # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
                                         is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVA  # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVA
TIVE is not set                         TIVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTI
L is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y       CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y         CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y         CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y          CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y      CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

#                                       #
# CPU frequency scaling drivers         # CPU frequency scaling drivers
#                                       #
CONFIG_CPUFREQ_DT=y                     # CONFIG_CPUFREQ_DT is not set
CONFIG_CPUFREQ_DT_PLATDEV=y
# CONFIG_ARM_BIG_LITTLE_CPUFREQ is not  # CONFIG_ARM_RASPBERRYPI_CPUFREQ is no
 set                                    t set
CONFIG_ARM_RASPBERRYPI_CPUFREQ=y
CONFIG_ARM_BCM2835_CPUFREQ=y            CONFIG_ARM_BCM2835_CPUFREQ=y
# CONFIG_QORIQ_CPUFREQ is not set       # CONFIG_QORIQ_CPUFREQ is not set
# end of CPU Frequency scaling          # end of CPU Frequency scaling
keithspg
 
Posts: 96
Joined: Mon Feb 23, 2015 4:14 pm

Re: Raspberry Pi -- no freq scaling on archlinuxarm's kernel

Postby keithspg » Fri Aug 07, 2020 5:55 pm

SO. I built the kernel and commented 2 lines out and I no longer get the message, though I do not know if it scales CPU freq any more...
my config looks like this:
Code: Select all
#
# CPU frequency scaling drivers
#
# CONFIG_CPUFREQ_DT is not set
CONFIG_CPUFREQ_DT_PLATDEV=y
# CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set
# CONFIG_ARM_RASPBERRYPI_CPUFREQ is not set
CONFIG_ARM_BCM2835_CPUFREQ=y
# CONFIG_QORIQ_CPUFREQ is not set
# end of CPU Frequency scaling
keithspg
 
Posts: 96
Joined: Mon Feb 23, 2015 4:14 pm

Re: Raspberry Pi -- no freq scaling on archlinuxarm's kernel

Postby keithspg » Sat Aug 08, 2020 9:40 pm

Checked the arm freq
# /opt/vc/bin/vcgencmd get_config arm_freq
arm_freq=1000

then went to the config.txt file and put this in:
arm_freq=950
core_freq=450
sdram_freq=450
over_voltage=6

Then checked the arm freq:
# /opt/vc/bin/vcgencmd get_config arm_freq
arm_freq=950

so it does seem to work. and I no longer get the kernel panic at boot. I wonder how to get through to the maintainer.
keithspg
 
Posts: 96
Joined: Mon Feb 23, 2015 4:14 pm

Re: Raspberry Pi -- no freq scaling on archlinuxarm's kernel

Postby keithspg » Tue Aug 18, 2020 10:31 pm

Still messing with this. Would like some (any?) input.
I know this has been noticed by others.
This is the error in DMESG on a Pi1/PiZeroW:
Code: Select all
 WARNING: CPU: 0 PID: 1 at drivers/cpufreq/cpufreq-dt.c:69 find_supply_name+0x84/0xa0

PRi2/3/4 with armv7 do not show this error but also do not scale. Not 100% certain that my aarch64 scales, either. The RPi guys claim it does and showed CLI evidence.

I have tried posting on the RPi board and what I got back was this:
cpufreq-dt.c looks like there is a missing device tree node

Looking through the PKGBUILD, it does not appear Arch is modifying these at all, but we do have a substantially different config. My guess is there is some config setting that is messing this up. AFAIK, it has been there for all builds of 5.4.x for Pi1.

If I use the Arch config, I do not seem to get kernel CPU scaling with load. AM I doing something wrong? I get this with every version of 5.4.y that I have built. I have done some quick tests and this seems to be the case for the RPi2 as well. I can set the freq with the config.txt, but it does not seem to scale up when it is hit with load. Isn't it supposed to do this?

RPi is now at 5.4.58. I built this with the Arch config and get no scaling. I am re-building with the RPi config and will test again. Once it works with armv6, I'll move to Armv7.
Any help appreciated.
keithspg
 
Posts: 96
Joined: Mon Feb 23, 2015 4:14 pm

Re: Raspberry Pi -- no freq scaling on archlinuxarm's kernel

Postby keithspg » Sat Aug 22, 2020 1:13 pm

So I spent a bit more time on this. It appears that the same config is used for both armv6 and armv7 kernels. I was able to set the governor to 'ondemand' and saw that the frequency scales for the armv7 kernel but not for the armv6. I used the RPi kernel tree and used defconfig and generated an RPi config for the armv6 using the current current kernel (5.4.51-2) and rebuilt. Very small kernel. Lost of different settings, etc. Loaded and I can scale CPU freq and I do not get a dmesg at boot, perfect. So I was thinking (hoping?) that this was a bug that may be resolved by a later commit. I grabbed a later kernel by git pull and it updated to 5.4.58-1 and then used this commit and rebuilt the kernel using the Arch config.
Code: Select all
~# uname -r
5.4.58-1-ARCH

Same deal no frequency scaling and a message at boot:
Code: Select all
Aug 08 11:49:16 runeaudio kernel: ------------[ cut here ]------------
Aug 08 11:49:16 runeaudio kernel: WARNING: CPU: 0 PID: 1 at drivers/cpufreq/cpufreq-dt.c:69 find_supply_name+0x84/0xa0
Aug 08 11:49:16 runeaudio kernel: Modules linked in:
Aug 08 11:49:16 runeaudio kernel: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.58-1-ARCH #1
Aug 08 11:49:16 runeaudio kernel: Hardware name: BCM2835
Aug 08 11:49:16 runeaudio kernel: [<80111304>] (unwind_backtrace) from [<8010c6a4>] (show_stack+0x10/0x14)
Aug 08 11:49:16 runeaudio kernel: [<8010c6a4>] (show_stack) from [<80bf8c88>] (dump_stack+0xc4/0xec)
Aug 08 11:49:16 runeaudio kernel: [<80bf8c88>] (dump_stack) from [<8012e72c>] (__warn+0xc0/0xf8)
Aug 08 11:49:16 runeaudio kernel: [<8012e72c>] (__warn) from [<8012eae4>] (warn_slowpath_fmt+0x5c/0xc0)
Aug 08 11:49:16 runeaudio kernel: [<8012eae4>] (warn_slowpath_fmt) from [<80a39364>] (find_supply_name+0x84/0xa0)
Aug 08 11:49:16 runeaudio kernel: [<80a39364>] (find_supply_name) from [<80a393b8>] (dt_cpufreq_probe+0x38/0x114)
Aug 08 11:49:16 runeaudio kernel: [<80a393b8>] (dt_cpufreq_probe) from [<808a89c4>] (platform_drv_probe+0x48/0x98)
Aug 08 11:49:16 runeaudio kernel: [<808a89c4>] (platform_drv_probe) from [<808a6eb0>] (really_probe+0x1d8/0x344)
Aug 08 11:49:16 runeaudio kernel: [<808a6eb0>] (really_probe) from [<808a718c>] (driver_probe_device+0x5c/0x168)
Aug 08 11:49:16 runeaudio kernel: [<808a718c>] (driver_probe_device) from [<808a531c>] (bus_for_each_drv+0x80/0xcc)
Aug 08 11:49:16 runeaudio kernel: [<808a531c>] (bus_for_each_drv) from [<808a6c5c>] (__device_attach+0xd4/0x148)
Aug 08 11:49:16 runeaudio kernel: [<808a6c5c>] (__device_attach) from [<808a5ff0>] (bus_probe_device+0x84/0x8c)
Aug 08 11:49:16 runeaudio kernel: [<808a5ff0>] (bus_probe_device) from [<808a2ef4>] (device_add+0x34c/0x60c)
Aug 08 11:49:16 runeaudio kernel: [<808a2ef4>] (device_add) from [<808a8780>] (platform_device_add+0xe4/0x200)
Aug 08 11:49:16 runeaudio kernel: [<808a8780>] (platform_device_add) from [<808a926c>] (platform_device_register_full+0xd4/0x11c)
Aug 08 11:49:16 runeaudio kernel: [<808a926c>] (platform_device_register_full) from [<80a398cc>] (raspberrypi_cpufreq_probe+0x130/0x1e8)
Aug 08 11:49:16 runeaudio kernel: [<80a398cc>] (raspberrypi_cpufreq_probe) from [<808a89c4>] (platform_drv_probe+0x48/0x98)
Aug 08 11:49:16 runeaudio kernel: [<808a89c4>] (platform_drv_probe) from [<808a6eb0>] (really_probe+0x1d8/0x344)
Aug 08 11:49:16 runeaudio kernel: [<808a6eb0>] (really_probe) from [<808a718c>] (driver_probe_device+0x5c/0x168)
Aug 08 11:49:16 runeaudio kernel: [<808a718c>] (driver_probe_device) from [<808a7438>] (device_driver_attach+0x58/0x60)
Aug 08 11:49:16 runeaudio kernel: [<808a7438>] (device_driver_attach) from [<808a7498>] (__driver_attach+0x58/0xcc)
Aug 08 11:49:16 runeaudio kernel: [<808a7498>] (__driver_attach) from [<808a5240>] (bus_for_each_dev+0x74/0xbc)
Aug 08 11:49:16 runeaudio kernel: [<808a5240>] (bus_for_each_dev) from [<808a6240>] (bus_add_driver+0x150/0x1dc)
Aug 08 11:49:16 runeaudio kernel: [<808a6240>] (bus_add_driver) from [<808a7a84>] (driver_register+0x74/0x108)
Aug 08 11:49:16 runeaudio kernel: [<808a7a84>] (driver_register) from [<80102dfc>] (do_one_initcall+0x40/0x2ac)
Aug 08 11:49:16 runeaudio kernel: [<80102dfc>] (do_one_initcall) from [<81101130>] (kernel_init_freeable+0x1a8/0x278)
Aug 08 11:49:16 runeaudio kernel: [<81101130>] (kernel_init_freeable) from [<80c0fc38>] (kernel_init+0x8/0x110)
Aug 08 11:49:16 runeaudio kernel: [<80c0fc38>] (kernel_init) from [<801010d8>] (ret_from_fork+0x14/0x3c)
Aug 08 11:49:16 runeaudio kernel: Exception stack(0x99c9ffb0 to 0x99c9fff8)
Aug 08 11:49:16 runeaudio kernel: ffa0:                                     00000000 00000000 00000000 00000000
Aug 08 11:49:16 runeaudio kernel: ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Aug 08 11:49:16 runeaudio kernel: ffe0: 00000000 00000000 00000000 00000000 00000013 00000000
Aug 08 11:49:16 runeaudio kernel: ---[ end trace 0d368378af121e59 ]---
Aug 08 11:49:16 runeaudio kernel: ------------[ cut here ]------------

If I were a betting man, I'd think that the config has some conflict that is causing this. If I re-build and unset the cpu_freq_dt, all is well. My next test is to use the RPi config and enable those 2 config settings and see if the bare bones RPi will build with this feature and run w/o the error at boot and will scale frequency...
keithspg
 
Posts: 96
Joined: Mon Feb 23, 2015 4:14 pm

Re: Raspberry Pi -- no freq scaling on archlinuxarm's kernel

Postby keithspg » Sat Aug 22, 2020 4:02 pm

I just re-built the 5.4.58 kernel and with no other changes to the RPi config other than making the cpu frequency bit look the same as the Arch config. I get the same result. No freq scaling and the same error message at boot. Somehow, these config options cause the issue, or so it appears. It is a bit strange as the same config on armv7 does not lock the cpu frequency nor triggers an error at boot.

I'll post to the RPi kernel git issue and see if I can get any clarity. Any ideas, here?

Code: Select all
#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_STAT=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

#
# CPU frequency scaling drivers
#
CONFIG_CPUFREQ_DT=y
CONFIG_CPUFREQ_DT_PLATDEV=y
# CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set
CONFIG_ARM_RASPBERRYPI_CPUFREQ=y
CONFIG_ARM_BCM2835_CPUFREQ=y
# CONFIG_QORIQ_CPUFREQ is not set
# end of CPU Frequency scaling
keithspg
 
Posts: 96
Joined: Mon Feb 23, 2015 4:14 pm


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 1 guest