lkml.org 
[lkml]   [2014]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] cpufreq: show the real avail freqs with the freq_table
Date
Some time, the policy's max_freq and min_freq will change, so
the avail freqs is not from the cpuinfo_min to cpuinfo_max.
Just add the check for the freq_table.

Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
drivers/cpufreq/freq_table.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c
index df14766..4f86010 100644
--- a/drivers/cpufreq/freq_table.c
+++ b/drivers/cpufreq/freq_table.c
@@ -237,7 +237,9 @@ static ssize_t show_available_freqs(struct cpufreq_policy *policy, char *buf,
* show_boost = false and driver_data != BOOST freq
* display NON BOOST freqs
*/
- if (show_boost ^ (pos->flags & CPUFREQ_BOOST_FREQ))
+ if (pos->frequency < policy->min ||
+ pos->frequency > policy->max ||
+ show_boost ^ (pos->flags & CPUFREQ_BOOST_FREQ))
continue;

count += sprintf(&buf[count], "%d ", pos->frequency);
--
1.7.12



\
 
 \ /
  Last update: 2014-11-28 04:21    [W:0.105 / U:2.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site