diff options
author | Amit Daniel Kachhap <amit.daniel@samsung.com> | 2013-04-21 18:24:37 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-04-21 18:24:37 -0400 |
commit | 70eb0855b2f8fcf61f9f47626b9fa70e7b45ab06 (patch) | |
tree | d9575a15b953827d0b01dde943c051ecde938ab3 /drivers/cpufreq | |
parent | c77896693da9ad75bd999fd86dd81a3da747e267 (diff) |
cpufreq: exynos5440: Protect OPP search calls with RCU lock
As per the OPP library documentation(Documentation/power/opp.txt) all
OPP find/get calls should be protected by RCU locks.
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/exynos5440-cpufreq.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c index ead7ed43e238..0c74018eda47 100644 --- a/drivers/cpufreq/exynos5440-cpufreq.c +++ b/drivers/cpufreq/exynos5440-cpufreq.c | |||
@@ -120,11 +120,13 @@ static int init_div_table(void) | |||
120 | int i = 0; | 120 | int i = 0; |
121 | struct opp *opp; | 121 | struct opp *opp; |
122 | 122 | ||
123 | rcu_read_lock(); | ||
123 | for (i = 0; freq_tbl[i].frequency != CPUFREQ_TABLE_END; i++) { | 124 | for (i = 0; freq_tbl[i].frequency != CPUFREQ_TABLE_END; i++) { |
124 | 125 | ||
125 | opp = opp_find_freq_exact(dvfs_info->dev, | 126 | opp = opp_find_freq_exact(dvfs_info->dev, |
126 | freq_tbl[i].frequency * 1000, true); | 127 | freq_tbl[i].frequency * 1000, true); |
127 | if (IS_ERR(opp)) { | 128 | if (IS_ERR(opp)) { |
129 | rcu_read_unlock(); | ||
128 | dev_err(dvfs_info->dev, | 130 | dev_err(dvfs_info->dev, |
129 | "failed to find valid OPP for %u KHZ\n", | 131 | "failed to find valid OPP for %u KHZ\n", |
130 | freq_tbl[i].frequency); | 132 | freq_tbl[i].frequency); |
@@ -159,6 +161,7 @@ static int init_div_table(void) | |||
159 | __raw_writel(tmp, dvfs_info->base + XMU_PMU_P0_7 + 4 * i); | 161 | __raw_writel(tmp, dvfs_info->base + XMU_PMU_P0_7 + 4 * i); |
160 | } | 162 | } |
161 | 163 | ||
164 | rcu_read_unlock(); | ||
162 | return 0; | 165 | return 0; |
163 | } | 166 | } |
164 | 167 | ||