lkml.org 
[lkml]   [2021]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] cpufreq_ondemand: fix bad auto calculated frequency.
Date
We can litmit cpufreq range by change min & max from cpufreq_policy.
So cpu frequency target should be in range [policy->min, policy->max].

Signed-off-by: schspa <schspa@gmail.com>
---
drivers/cpufreq/cpufreq_ondemand.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index ac361a8b1d3b..8afb2c84c38c 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -151,8 +151,8 @@ static void od_update(struct cpufreq_policy *policy)
/* Calculate the next frequency proportional to load */
unsigned int freq_next, min_f, max_f;

- min_f = policy->cpuinfo.min_freq;
- max_f = policy->cpuinfo.max_freq;
+ min_f = policy->min;
+ max_f = policy->max;
freq_next = min_f + load * (max_f - min_f) / 100;

/* No longer fully busy, reset rate_mult */
--
2.29.0
\
 
 \ /
  Last update: 2021-08-27 10:18    [W:0.045 / U:2.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site