Commit b2274ddfdf32d3561ebdd9a298c98e29da768b5a

Authored by Nishanth Menon
Committed by Afzal Mohammed
1 parent b481fea7d9
Exists in master

OMAP2+: PM: secure OPP access using rcu locks

OPP functions as described in Documentation/power/opp.txt
should be accessed under rcu_locks.

Signed-off-by: Nishanth Menon <nm@ti.com>
[vaibhav.bedia@ti.com: Pull in for AM33xx]
Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

arch/arm/mach-omap2/pm.c
... ... @@ -172,14 +172,17 @@
172 172 freq = clk->rate;
173 173 clk_put(clk);
174 174  
  175 + rcu_read_lock();
175 176 opp = opp_find_freq_ceil(dev, &freq);
176 177 if (IS_ERR(opp)) {
177   - pr_err("%s: unable to find boot up OPP for vdd_%s\n",
  178 + rcu_read_unlock();
  179 + printk(KERN_ERR "%s: unable to find boot up OPP for vdd_%s\n",
178 180 __func__, vdd_name);
179 181 goto exit;
180 182 }
181 183  
182 184 bootup_volt = opp_get_voltage(opp);
  185 + rcu_read_unlock();
183 186 if (!bootup_volt) {
184 187 pr_err("%s: unable to find voltage corresponding "
185 188 "to the bootup OPP for vdd_%s\n", __func__, vdd_name);