mbox series

[0/2] Add support for "Requested CPU Min Frequency" BIOS option

Message ID 20250415102118.694999-1-dhananjay.ugwekar@amd.com (mailing list archive)
Headers show
Series Add support for "Requested CPU Min Frequency" BIOS option | expand

Message

Dhananjay Ugwekar April 15, 2025, 10:21 a.m. UTC
Zen 4 AMD EPYC systems and above have a "Requested CPU Min Frequency" 
BIOS option which allows the user to set an initial lower frequency 
limit. This limit can later be overridden by the user by writing to the
sysfs file "scaling_min_freq".

Initialize lower frequency limit to the "Requested CPU Min frequency" 
BIOS option (if it is set) value as part of the driver->init() 
callback. The BIOS specified value is passed as min_perf in the CPPC_REQ 
MSR. To ensure that we don't mistake a stale min_perf value in CPPC_REQ 
value as the "Requested CPU Min frequency" during a kexec wakeup, reset 
the CPPC_REQ.min_perf value back to the BIOS specified one in the offline,
exit and suspend callbacks. 

amd_pstate_target() and amd_pstate_epp_update_limit() which are invoked 
as part of the resume() and online() callbacks will take care of restoring
the CPPC_REQ back to the last sane values.

Dhananjay Ugwekar (2):
  cpufreq/amd-pstate: Add offline, online and suspend callbacks for
    amd_pstate_driver
  cpufreq/amd-pstate: Add support for the "Requested CPU Min frequency"
    BIOS option

 drivers/cpufreq/amd-pstate.c | 79 ++++++++++++++++++++++++++----------
 drivers/cpufreq/amd-pstate.h |  2 +
 2 files changed, 60 insertions(+), 21 deletions(-)