Skip to contentSkip to conversation

omap: add rcu_locking to omap2_set_init_voltage.

PATCH New NeilBrown 2 participants 3 messages Jan 9, 2012

Subsystems (4)
lore
Share & tools
lore

NeilBrown

author
#0 lore raw

PATCH 1/1 omap: add rcu_locking to omap2_set_init_voltage.

opp_find_freq_ceil and opp_get_voltage are documented as requiring rcu_lock to be held. So hold it.

arch/arm/mach-omap2/pm.c +3 -0
index 00bff46..470976e 100644
@@ -174,14 +174,17 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
 	freq = clk->rate;
 	clk_put(clk);
 
+	rcu_read_lock();
 	opp = opp_find_freq_ceil(dev, &freq);
 	if (IS_ERR(opp)) {
+		rcu_read_unlock();
 		pr_err("%s: unable to find boot up OPP for vdd_%s\n",
 			__func__, vdd_name);
 		goto exit;
 	}
 
 	bootup_volt = opp_get_voltage(opp);
+	rcu_read_unlock();
 	if (!bootup_volt) {
 		pr_err("%s: unable to find voltage corresponding "
 			"to the bootup OPP for vdd_%s\n", __func__, vdd_name);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120109/0cd918f9/attachment.sig>

#1 lore raw

PATCH 1/1 omap: add rcu_locking to omap2_set_init_voltage.

Quoted 4 lines · NeilBrown

opp_find_freq_ceil and opp_get_voltage are documented as requiring rcu_lock to be held. So hold it.

Missing 'ARM: ' prefix, but I added it locally and queued as a fix for v3.3.

Thanks for the patch!

Kevin

#2 lore raw

PATCH 1/1 omap: add rcu_locking to omap2_set_init_voltage.

Quoted 9 lines · Kevin Hilman
Quoted 4 lines · NeilBrown

opp_find_freq_ceil and opp_get_voltage are documented as requiring rcu_lock to be held. So hold it.

Missing 'ARM: ' prefix, but I added it locally and queued as a fix for v3.3.

oops, sent this before I saw your updated version.

Kevin