42 lines
1.3 KiB
Diff
42 lines
1.3 KiB
Diff
From 476817b414eddbf798161c3b33ef1209098bdf50 Mon Sep 17 00:00:00 2001
|
|
From: Mario Limonciello <superm1@kernel.org>
|
|
Date: Thu, 27 Feb 2025 14:09:08 -0600
|
|
Subject: cpufreq/amd-pstate: fix warning noticed by kernel test robot
|
|
|
|
Reported-by: kernel test robot <lkp@intel.com>
|
|
Closes: https://lore.kernel.org/oe-kbuild-all/202502272001.nafS0qXq-lkp@intel.com/
|
|
Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>
|
|
---
|
|
drivers/cpufreq/amd-pstate.c | 13 ++++++-------
|
|
1 file changed, 6 insertions(+), 7 deletions(-)
|
|
|
|
--- a/drivers/cpufreq/amd-pstate.c
|
|
+++ b/drivers/cpufreq/amd-pstate.c
|
|
@@ -903,20 +903,19 @@ static int amd_pstate_init_freq(struct a
|
|
return ret;
|
|
perf = READ_ONCE(cpudata->perf);
|
|
|
|
+ if (quirks && quirks->nominal_freq)
|
|
+ nominal_freq = quirks->nominal_freq;
|
|
+ else
|
|
+ nominal_freq = cppc_perf.nominal_freq;
|
|
+ nominal_freq *= 1000;
|
|
+
|
|
if (quirks && quirks->lowest_freq) {
|
|
min_freq = quirks->lowest_freq;
|
|
perf.lowest_perf = freq_to_perf(perf, nominal_freq, min_freq);
|
|
WRITE_ONCE(cpudata->perf, perf);
|
|
} else
|
|
min_freq = cppc_perf.lowest_freq;
|
|
-
|
|
- if (quirks && quirks->nominal_freq)
|
|
- nominal_freq = quirks->nominal_freq;
|
|
- else
|
|
- nominal_freq = cppc_perf.nominal_freq;
|
|
-
|
|
min_freq *= 1000;
|
|
- nominal_freq *= 1000;
|
|
|
|
WRITE_ONCE(cpudata->nominal_freq, nominal_freq);
|
|
|