pftf / RPi4

Raspberry Pi 4 UEFI Firmware Images
https://rpi4-uefi.dev
Other
1.16k stars 138 forks source link

no cpufreq with debian 11 #230

Closed chriss-de closed 1 year ago

chriss-de commented 1 year ago

As the title says .

I'm using Debain 11 and this EFI on a RPi4b 8GB. The system is running with the default freq you can set in the EFI und RPi Configuration > CPU The OS cpufreq driver does not detect a CPU that it can work with? I'm not really sure who is to blame - maybe just myself :D

I searched the internet up and down but could just find one other guy who mentioned/asked it.


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. analyzing CPU 1: no or unknown cpufreq driver is active on this CPU maximum transition latency: 4294.55 ms. analyzing CPU 2: no or unknown cpufreq driver is active on this CPU maximum transition latency: 4294.55 ms. analyzing CPU 3: no or unknown cpufreq driver is active on this CPU maximum transition latency: 4294.55 ms.

TheMindVirus commented 1 year ago

I'm just going to leave this here, mumble mumble: https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface#set-clock-rate

Part of it is due to Pi4 UEFI not being a full emulation, just the essential changes required to boot custom built OS versions. I tested this mechanism and it didn't seem to actually change the CPU frequency for all clocks, only some of them. There are differences between Pi3 and Pi4 that prevent existing code from completing the request successfully and reliably.

Chances are that the Linux kernel source used to compile your Debian 11 image does not have the changes to this mechanism. A custom version of either the Linux kernel has to be rebuilt or every piece of software has to have an edge case workaround for every slight hardware reconfiguration and mechanical difference that exists between different versions of the platform.

I would be keen to know if this issue also affects Raspberry Pi OS running on UEFI vs. Standalone, Hardware vs. Virtual Machine.

TheMindVirus commented 1 year ago

Below is the output from Raspberry Pi OS which seems to have a Device Tree Driver called cpufreq-dt in the backend:

cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: cpufreq-dt
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0 1 2 3
  maximum transition latency: 0.97 ms.
  hardware limits: 600 MHz - 1.40 GHz
  available frequency steps: 600 MHz, 700 MHz, 800 MHz, 900 MHz, 1000 MHz, 1.10 GHz, 1.20 GHz, 1.30 GHz, 1.40 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  current policy: frequency should be within 600 MHz and 1.40 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 1.40 GHz.
  cpufreq stats: 600 MHz:10.42%, 700 MHz:1.55%, 800 MHz:0.85%, 900 MHz:0.83%, 1000 MHz:0.85%, 1.10 GHz:0.00%, 1.20 GHz:0.00%, 1.30 GHz:0.00%, 1.40 GHz:85.50%  (236)
analyzing CPU 1:
  driver: cpufreq-dt
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0 1 2 3
  maximum transition latency: 0.97 ms.
  hardware limits: 600 MHz - 1.40 GHz
  available frequency steps: 600 MHz, 700 MHz, 800 MHz, 900 MHz, 1000 MHz, 1.10 GHz, 1.20 GHz, 1.30 GHz, 1.40 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  current policy: frequency should be within 600 MHz and 1.40 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 1.40 GHz.
  cpufreq stats: 600 MHz:10.42%, 700 MHz:1.55%, 800 MHz:0.85%, 900 MHz:0.83%, 1000 MHz:0.85%, 1.10 GHz:0.00%, 1.20 GHz:0.00%, 1.30 GHz:0.00%, 1.40 GHz:85.50%  (236)
analyzing CPU 2:
  driver: cpufreq-dt
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0 1 2 3
  maximum transition latency: 0.97 ms.
  hardware limits: 600 MHz - 1.40 GHz
  available frequency steps: 600 MHz, 700 MHz, 800 MHz, 900 MHz, 1000 MHz, 1.10 GHz, 1.20 GHz, 1.30 GHz, 1.40 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  current policy: frequency should be within 600 MHz and 1.40 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 1.40 GHz.
  cpufreq stats: 600 MHz:10.42%, 700 MHz:1.55%, 800 MHz:0.85%, 900 MHz:0.83%, 1000 MHz:0.85%, 1.10 GHz:0.00%, 1.20 GHz:0.00%, 1.30 GHz:0.00%, 1.40 GHz:85.50%  (236)
analyzing CPU 3:
  driver: cpufreq-dt
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0 1 2 3
  maximum transition latency: 0.97 ms.
  hardware limits: 600 MHz - 1.40 GHz
  available frequency steps: 600 MHz, 700 MHz, 800 MHz, 900 MHz, 1000 MHz, 1.10 GHz, 1.20 GHz, 1.30 GHz, 1.40 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  current policy: frequency should be within 600 MHz and 1.40 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 1.40 GHz.
  cpufreq stats: 600 MHz:10.42%, 700 MHz:1.55%, 800 MHz:0.85%, 900 MHz:0.83%, 1000 MHz:0.85%, 1.10 GHz:0.00%, 1.20 GHz:0.00%, 1.30 GHz:0.00%, 1.40 GHz:85.50%  (236)

The information is slightly questionable as the hardware limits stated have already been broken numerous times.

chriss-de commented 1 year ago

Thank you for that insight. I'm closing the issue for me.