BUG REPORT: 5.15.0-60-generic kernel limits CPU minimum and maximum frequency

AMD Ryzen 5 5625U CPU using the conservative CPU governor (it exhibits the same behavior with the default ondemand CPU governor).

Just updated via Software Updater application to:
Linux HP-Laptop 5.15.0-60-generic #66~20.04.1-Ubuntu SMP Wed Jan 25 09:41:30 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

It's limiting my CPU frequency to between 1.60 GHz and 2.3 GHz, but it's supposed to be able to go all the way down to 399 MHz when idle, and up to 4.399 GHz at full load.

Here's the output for CPU0 (it's the same for the other 11 CPUs):

sudo cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 4294.55 ms.
  hardware limits: 1.60 GHz - 4.39 GHz
  available frequency steps: 2.30 GHz, 1.80 GHz, 1.60 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  current policy: frequency should be within 1.60 GHz and 2.30 GHz.
                  The governor "conservative" may decide which speed to use
                  within this range.
  current CPU frequency is 1.60 GHz (asserted by call to hardware).
  cpufreq stats: 2.30 GHz:5.07%, 1.80 GHz:0.41%, 1.60 GHz:94.52%  (393)

Any ideas on how to get my CPU frequency range back to normal?

[EDIT]
It seems all manual control of CPU frequency is lost under that kernel... I couldn't set CPU frequency via cpufreq-set.

I've rolled back to Linux HP-Laptop 5.15.0-58-generic #64~20.04.1-Ubuntu SMP Fri Jan 6 16:42:31 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux. All is working normally again.

sudo cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: amd-pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 131 us.
  hardware limits: 400 MHz - 4.39 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  current policy: frequency should be within 400 MHz and 4.39 GHz.
                  The governor "conservative" may decide which speed to use
                  within this range.
  current CPU frequency is 474 MHz.
6 Likes

Truly, I request, you do not leave this forum...

I have pinned this topic for a short while to ensure all members can reference the content until this is sorted out.

5 Likes

Same thing happens on:
linux-image-5.15.0-70-lowlatency 5.15.0-70.77~20.04.1 amd64 Signed kernel image lowlatency

Everything works great except the CPU governor limiting CPU frequency... it actually boots faster than:
linux-image-5.15.0-58-lowlatency 5.15.0-58.64~20.04.1 amd64 Signed kernel image lowlatency
... which is what I've been running.

I'll work on it and see if I can get the CPU governor working properly under 5.15.0-70.

I tried cpufreq-info.

cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 4294.55 ms.
  hardware limits: 1.60 GHz - 3.60 GHz
  available frequency steps: 3.60 GHz, 2.30 GHz, 1.60 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  current policy: frequency should be within 1.60 GHz and 3.60 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 1.46 GHz.
  cpufreq stats: 3.60 GHz:4.41%, 2.30 GHz:2.97%, 1.60 GHz:92.62%  (704)
inxi
CPU: Quad Core AMD Ryzen 5 2400G with Radeon Vega Graphics (-MT MCP-) 
speed/min/max: 1419/1600/3600 MHz Kernel: 5.15.0-70-generic x86_64 Up: 4m 
Mem: 1572.7/13907.9 MiB (11.3%) Storage: 261.74 GiB (7.7% used) Procs: 285 
Shell: bash 5.0.17 inxi: 3.0.38 

Yeah, your CPU should be able to go all the way down to 400 MHz, just like mine (AMD Ryzen 5 5625 U).

Here's the problem:
driver: acpi-cpufreq
... should be:
driver: amd-pstate

I'm researching how to blacklist acpi-cpufreq and set up amd-pstate. acpi-cpufreq is a built-in module, so it can't be blacklisted in the normal manner.

We can add:
initcall_blacklist=acpi_cpufreq_init
to the line:
GRUB_CMDLINE_LINUX_DEFAULT="initcall_blacklist=acpi_cpufreq_init"
in /etc/default/grub, then issuing sudo update-grub, then rebooting.

[EDIT 1]
That gives us:

cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 4294.55 ms.

I'm editing /etc/initramfs-tools/modules to add amd_pstate, then issuing sudo update-initramfs -u.

[EDIT 2]
That doesn't change anything. I'm attempting sudo modprobe amd-pstate.

[EDIT 3]
That doesn't change anything. Last resort... I'm attempting to add amd_pstate.shared_mem=1 to the line:
GRUB_CMDLINE_LINUX_DEFAULT="amd_pstate.shared_mem=1"
in /etc/default/grub, then issuing sudo update-grub, then rebooting.

[EDIT 4]
Nope, still doesn't load the amd-pstate driver... ok, I'm rolling back to the Linux HP-Laptop 5.15.0-58-lowlatency #64~20.04.1-Ubuntu SMP PREEMPT Fri Jan 6 18:45:25 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux kernel and reverting the changes.

[EDIT 5]
Ok, I'm back on the Linux HP-Laptop 5.15.0-58-lowlatency #64~20.04.1-Ubuntu SMP PREEMPT Fri Jan 6 18:45:25 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux kernel.

cpufreq-info

cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: amd-pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 131 us.
  hardware limits: 400 MHz - 4.39 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  current policy: frequency should be within 400 MHz and 4.39 GHz.
                  The governor "conservative" may decide which speed to use
                  within this range.
  current CPU frequency is 399 MHz.

AMD CPU clock is also controlled by Cool'n'Quiet, so I tried disabling it in UEFI, but the clock is no longer displayed in cpufreq-info. Since my PC is a desktop, there is no need to significantly reduce the CPU clock, but it would be a big problem on a laptop.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.