diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2024-08-21 20:28:36 +0200 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2024-08-21 20:28:36 +0200 |
commit | 2179b92ff7ccd061e09d6202e3c86a8bc5abeeda (patch) | |
tree | 70422e61e8835043f2c96585b2610a693c72e69e /SOURCES/0001-amd-pstate.patch | |
parent | dd25c2f0a6e98709106a0e9a2c1ba7ea6a26dcec (diff) | |
download | kernel-fsync-2179b92ff7ccd061e09d6202e3c86a8bc5abeeda.tar.gz kernel-fsync-2179b92ff7ccd061e09d6202e3c86a8bc5abeeda.zip |
kernel 6.10.5
Diffstat (limited to 'SOURCES/0001-amd-pstate.patch')
-rw-r--r-- | SOURCES/0001-amd-pstate.patch | 64 |
1 files changed, 6 insertions, 58 deletions
diff --git a/SOURCES/0001-amd-pstate.patch b/SOURCES/0001-amd-pstate.patch index d4986ef..c865d00 100644 --- a/SOURCES/0001-amd-pstate.patch +++ b/SOURCES/0001-amd-pstate.patch @@ -177,19 +177,6 @@ index a092b13ffbc2..804fab4ebb26 100644 u64 value = READ_ONCE(cpudata->cppc_req_cached); value &= ~GENMASK_ULL(31, 24); -@@ -304,10 +296,8 @@ static int amd_pstate_set_energy_pref_index(struct amd_cpudata *cpudata, - int epp = -EINVAL; - int ret; - -- if (!pref_index) { -- pr_debug("EPP pref_index is invalid\n"); -- return -EINVAL; -- } -+ if (!pref_index) -+ epp = cpudata->epp_default; - - if (epp == -EINVAL) - epp = epp_values[pref_index]; @@ -524,7 +514,10 @@ static inline bool amd_pstate_sample(struct amd_cpudata *cpudata) static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf, u32 des_perf, u32 max_perf, bool fast_switch, int gov_flags) @@ -521,8 +508,7 @@ index a092b13ffbc2..804fab4ebb26 100644 policy->driver_data = cpudata; -- cpudata->epp_cached = amd_pstate_get_epp(cpudata, 0); -+ cpudata->epp_cached = cpudata->epp_default = amd_pstate_get_epp(cpudata, 0); + cpudata->epp_cached = cpudata->epp_default = amd_pstate_get_epp(cpudata, 0); policy->min = policy->cpuinfo.min_freq; policy->max = policy->cpuinfo.max_freq; @@ -656,19 +642,7 @@ index a092b13ffbc2..804fab4ebb26 100644 if (!acpi_cpc_valid()) { pr_warn_once("the _CPC object is not present in SBIOS or ACPI disabled\n"); return -ENODEV; -@@ -1766,35 +1889,43 @@ static int __init amd_pstate_init(void) - /* check if this machine need CPPC quirks */ - dmi_check_system(amd_pstate_quirks_table); - -- switch (cppc_state) { -- case AMD_PSTATE_UNDEFINED: -+ /* -+ * determine the driver mode from the command line or kernel config. -+ * If no command line input is provided, cppc_state will be AMD_PSTATE_UNDEFINED. -+ * command line options will override the kernel config settings. -+ */ -+ -+ if (cppc_state == AMD_PSTATE_UNDEFINED) { +@@ -1774,11 +1899,9 @@ static int __init amd_pstate_init(void) /* Disable on the following configs by default: * 1. Undefined platforms * 2. Server platforms @@ -681,27 +655,7 @@ index a092b13ffbc2..804fab4ebb26 100644 pr_info("driver load is disabled, boot with specific mode to enable this\n"); return -ENODEV; } -- ret = amd_pstate_set_driver(CONFIG_X86_AMD_PSTATE_DEFAULT_MODE); -- if (ret) -- return ret; -- break; -+ /* get driver mode from kernel config option [1:4] */ -+ cppc_state = CONFIG_X86_AMD_PSTATE_DEFAULT_MODE; -+ } -+ -+ switch (cppc_state) { - case AMD_PSTATE_DISABLE: -+ pr_info("driver load is disabled, boot with specific mode to enable this\n"); - return -ENODEV; - case AMD_PSTATE_PASSIVE: - case AMD_PSTATE_ACTIVE: - case AMD_PSTATE_GUIDED: -+ ret = amd_pstate_set_driver(cppc_state); -+ if (ret) -+ return ret; - break; - default: - return -EINVAL; +@@ -1802,7 +1925,7 @@ static int __init amd_pstate_init(void) } /* capability check */ @@ -710,13 +664,7 @@ index a092b13ffbc2..804fab4ebb26 100644 pr_debug("AMD CPPC MSR based functionality is supported\n"); if (cppc_state != AMD_PSTATE_ACTIVE) current_pstate_driver->adjust_perf = amd_pstate_adjust_perf; -@@ -1808,13 +1939,15 @@ static int __init amd_pstate_init(void) - /* enable amd pstate feature */ - ret = amd_pstate_enable(true); - if (ret) { -- pr_err("failed to enable with return %d\n", ret); -+ pr_err("failed to enable driver mode(%d)\n", cppc_state); - return ret; +@@ -1821,8 +1944,10 @@ static int __init amd_pstate_init(void) } ret = cpufreq_register_driver(current_pstate_driver); @@ -741,11 +689,11 @@ diff --git a/drivers/cpufreq/amd-pstate.h b/drivers/cpufreq/amd-pstate.h index e6a28e7f4dbf..cc8bb2bc325a 100644 --- a/drivers/cpufreq/amd-pstate.h +++ b/drivers/cpufreq/amd-pstate.h -@@ -99,6 +99,8 @@ struct amd_cpudata { +@@ -99,7 +99,8 @@ struct amd_cpudata { u32 policy; u64 cppc_cap1_cached; bool suspended; -+ s16 epp_default; + s16 epp_default; + bool boost_state; }; |