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>
This commit is contained in:
parent
c77896693d
commit
70eb0855b2
|
@ -120,11 +120,13 @@ static int init_div_table(void)
|
||||||
int i = 0;
|
int i = 0;
|
||||||
struct opp *opp;
|
struct opp *opp;
|
||||||
|
|
||||||
|
rcu_read_lock();
|
||||||
for (i = 0; freq_tbl[i].frequency != CPUFREQ_TABLE_END; i++) {
|
for (i = 0; freq_tbl[i].frequency != CPUFREQ_TABLE_END; i++) {
|
||||||
|
|
||||||
opp = opp_find_freq_exact(dvfs_info->dev,
|
opp = opp_find_freq_exact(dvfs_info->dev,
|
||||||
freq_tbl[i].frequency * 1000, true);
|
freq_tbl[i].frequency * 1000, true);
|
||||||
if (IS_ERR(opp)) {
|
if (IS_ERR(opp)) {
|
||||||
|
rcu_read_unlock();
|
||||||
dev_err(dvfs_info->dev,
|
dev_err(dvfs_info->dev,
|
||||||
"failed to find valid OPP for %u KHZ\n",
|
"failed to find valid OPP for %u KHZ\n",
|
||||||
freq_tbl[i].frequency);
|
freq_tbl[i].frequency);
|
||||||
|
@ -159,6 +161,7 @@ static int init_div_table(void)
|
||||||
__raw_writel(tmp, dvfs_info->base + XMU_PMU_P0_7 + 4 * i);
|
__raw_writel(tmp, dvfs_info->base + XMU_PMU_P0_7 + 4 * i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rcu_read_unlock();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue