public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 07/12] cpufreq: amd_pstate: map desired perf into pstate scope for powersave governor
@ 2022-07-07 17:00 Perry Yuan
  2022-07-07 19:56 ` Nathan Fontenot
  0 siblings, 1 reply; 3+ messages in thread
From: Perry Yuan @ 2022-07-07 17:00 UTC (permalink / raw)
  To: rafael.j.wysocki, viresh.kumar, Ray.Huang, Huang Rui,
	Rafael J. Wysocki, linux-pm, linux-kernel
  Cc: Deepak.Sharma, Mario.Limonciello, Nathan.Fontenot,
	Alexander.Deucher, Jinzhou.Su, Xinmei.Huang, Xiaojian.Du, Li.Meng,
	Perry Yuan

The patch will fix the invalid desired perf value for powersave
governor. This issue is found when testing on one AMD EPYC system, the
actual des_perf is smaller than the min_perf value, that is invalid
value. because the min_perf is the lowest_perf system can support in
idle state.

Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
---
 drivers/cpufreq/amd-pstate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 7c51f4125263..154eed849f38 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -317,6 +317,7 @@ static int amd_pstate_target(struct cpufreq_policy *policy,
 	des_perf = DIV_ROUND_CLOSEST(target_freq * cap_perf,
 				     cpudata->max_freq);
 
+	des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf);
 	cpufreq_freq_transition_begin(policy, &freqs);
 	amd_pstate_update(cpudata, min_perf, des_perf,
 			  max_perf, false);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-09  8:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-07 17:00 [PATCH 07/12] cpufreq: amd_pstate: map desired perf into pstate scope for powersave governor Perry Yuan
2022-07-07 19:56 ` Nathan Fontenot
2022-07-09  8:49   ` Yuan, Perry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox