diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-20 23:39:50 +0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-20 23:39:50 +0400 |
commit | 75a4161a58dd157a2bd2dc8e9986e45b62ac46cf (patch) | |
tree | 7826f64f3e826b398caf7725070d5a25f2b52cef /drivers/cpufreq/exynos-cpufreq.c | |
parent | 382e1596197be46b73aed08be05acf5b5ae8ce49 (diff) | |
parent | a9144436271583115a2230db15d0b6ae2c481d3c (diff) | |
download | linux-75a4161a58dd157a2bd2dc8e9986e45b62ac46cf.tar.xz |
Merge branch 'pm-cpufreq'
* pm-cpufreq:
cpufreq: Fix sysfs deadlock with concurrent hotplug/frequency switch
EXYNOS: bugfix on retrieving old_index from freqs.old
Diffstat (limited to 'drivers/cpufreq/exynos-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/exynos-cpufreq.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index b243a7ee01f6..af2d81e10f71 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c @@ -62,8 +62,18 @@ static int exynos_target(struct cpufreq_policy *policy, goto out; } - if (cpufreq_frequency_table_target(policy, freq_table, - freqs.old, relation, &old_index)) { + /* + * The policy max have been changed so that we cannot get proper + * old_index with cpufreq_frequency_table_target(). Thus, ignore + * policy and get the index from the raw freqeuncy table. + */ + for (old_index = 0; + freq_table[old_index].frequency != CPUFREQ_TABLE_END; + old_index++) + if (freq_table[old_index].frequency == freqs.old) + break; + + if (freq_table[old_index].frequency == CPUFREQ_TABLE_END) { ret = -EINVAL; goto out; } |