diff options
author | Todd Poynor <toddpoynor@google.com> | 2013-04-22 16:44:58 -0700 |
---|---|---|
committer | Ziyann <jaraidaniel@gmail.com> | 2014-11-20 17:15:44 +0100 |
commit | fed47910ffb18f390861790cc016cb8f63daeb8c (patch) | |
tree | 2195a5ee48503847133ad16415eea64346dfba1c /drivers/cpufreq | |
parent | 9e40dcda848f68203f87a08dc162421ee3ceb8eb (diff) | |
download | kernel_samsung_tuna-fed47910ffb18f390861790cc016cb8f63daeb8c.zip kernel_samsung_tuna-fed47910ffb18f390861790cc016cb8f63daeb8c.tar.gz kernel_samsung_tuna-fed47910ffb18f390861790cc016cb8f63daeb8c.tar.bz2 |
cpufreq: interactive: handle errors from cpufreq_frequency_table_target
Add checks for error return from cpufreq_frequency_table_target, and be
less noisy on the existing call with an error check. CPU hotplug and
system shutdown may cause this call to return -EINVAL.
Bug: 8613560
Change-Id: Id78d8829920462c0db1c7e14e717d91740d6cb44
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Diffstat (limited to 'drivers/cpufreq')
-rwxr-xr-x | drivers/cpufreq/cpufreq_interactive.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c index 15f6724..8c52c83 100755 --- a/drivers/cpufreq/cpufreq_interactive.c +++ b/drivers/cpufreq/cpufreq_interactive.c @@ -201,9 +201,10 @@ static unsigned int choose_freq( * than or equal to the target load. */ - cpufreq_frequency_table_target( - pcpu->policy, pcpu->freq_table, loadadjfreq / tl, - CPUFREQ_RELATION_L, &index); + if (cpufreq_frequency_table_target( + pcpu->policy, pcpu->freq_table, loadadjfreq / tl, + CPUFREQ_RELATION_L, &index)) + break; freq = pcpu->freq_table[index].frequency; if (freq > prevfreq) { @@ -215,10 +216,11 @@ static unsigned int choose_freq( * Find the highest frequency that is less * than freqmax. */ - cpufreq_frequency_table_target( - pcpu->policy, pcpu->freq_table, - freqmax - 1, CPUFREQ_RELATION_H, - &index); + if (cpufreq_frequency_table_target( + pcpu->policy, pcpu->freq_table, + freqmax - 1, CPUFREQ_RELATION_H, + &index)) + break; freq = pcpu->freq_table[index].frequency; if (freq == freqmin) { @@ -241,10 +243,11 @@ static unsigned int choose_freq( * Find the lowest frequency that is higher * than freqmin. */ - cpufreq_frequency_table_target( - pcpu->policy, pcpu->freq_table, - freqmin + 1, CPUFREQ_RELATION_L, - &index); + if (cpufreq_frequency_table_target( + pcpu->policy, pcpu->freq_table, + freqmin + 1, CPUFREQ_RELATION_L, + &index)) + break; freq = pcpu->freq_table[index].frequency; /* @@ -342,11 +345,8 @@ static void cpufreq_interactive_timer(unsigned long data) if (cpufreq_frequency_table_target(pcpu->policy, pcpu->freq_table, new_freq, CPUFREQ_RELATION_L, - &index)) { - pr_warn_once("timer %d: cpufreq_frequency_table_target error\n", - (int) data); + &index)) goto rearm; - } new_freq = pcpu->freq_table[index].frequency; |