linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] omap: add rcu_locking to omap2_set_init_voltage.
@ 2011-12-30  1:33 NeilBrown
  2012-01-06 19:07 ` Kevin Hilman
  0 siblings, 1 reply; 5+ messages in thread
From: NeilBrown @ 2011-12-30  1:33 UTC (permalink / raw)
  To: Kevin Hilman, Tony Lindgren; +Cc: linux-omap

[-- Attachment #1: Type: text/plain, Size: 861 bytes --]


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

Signed-off-by: NeilBrown <neilb@suse.de>

diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 00bff46..470976e 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -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);

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] omap: add rcu_locking to omap2_set_init_voltage.
  2011-12-30  1:33 [PATCH] omap: add rcu_locking to omap2_set_init_voltage NeilBrown
@ 2012-01-06 19:07 ` Kevin Hilman
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Hilman @ 2012-01-06 19:07 UTC (permalink / raw)
  To: NeilBrown; +Cc: Tony Lindgren, linux-omap

NeilBrown <neilb@suse.de> writes:

> opp_find_freq_ceil and opp_get_voltage are documented as requiring
> rcu_lock to be held.  So hold it.
>
> Signed-off-by: NeilBrown <neilb@suse.de>

Looks good, thanks for the patch.

Do you mind reposting with linux-arm-kernel@lists.infradead.org in CC,
and also use the 'ARM:' prefix in the subject as requested by the
arm-soc maintainers.

After that, I'll queue it as a fix for v3.3,

Thanks,

Kevin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] omap: add rcu_locking to omap2_set_init_voltage.
@ 2012-01-09  2:14 NeilBrown
  2012-01-09 23:11 ` Kevin Hilman
  0 siblings, 1 reply; 5+ messages in thread
From: NeilBrown @ 2012-01-09  2:14 UTC (permalink / raw)
  To: Kevin Hilman, Tony Lindgren; +Cc: linux-omap, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 861 bytes --]


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

Signed-off-by: NeilBrown <neilb@suse.de>

diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 00bff46..470976e 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -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);

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] omap: add rcu_locking to omap2_set_init_voltage.
  2012-01-09  2:14 NeilBrown
@ 2012-01-09 23:11 ` Kevin Hilman
  2012-01-09 23:12   ` Kevin Hilman
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Hilman @ 2012-01-09 23:11 UTC (permalink / raw)
  To: NeilBrown; +Cc: Tony Lindgren, linux-omap, linux-arm-kernel

NeilBrown <neilb@suse.de> writes:

> opp_find_freq_ceil and opp_get_voltage are documented as requiring
> rcu_lock to be held.  So hold it.
>
> Signed-off-by: NeilBrown <neilb@suse.de>

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

Thanks for the patch!

Kevin


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] omap: add rcu_locking to omap2_set_init_voltage.
  2012-01-09 23:11 ` Kevin Hilman
@ 2012-01-09 23:12   ` Kevin Hilman
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Hilman @ 2012-01-09 23:12 UTC (permalink / raw)
  To: NeilBrown; +Cc: Tony Lindgren, linux-omap, linux-arm-kernel

On 01/09/2012 03:11 PM, Kevin Hilman wrote:
> NeilBrown<neilb@suse.de>  writes:
>
>> opp_find_freq_ceil and opp_get_voltage are documented as requiring
>> rcu_lock to be held.  So hold it.
>>
>> Signed-off-by: NeilBrown<neilb@suse.de>
>
> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-09 23:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-30  1:33 [PATCH] omap: add rcu_locking to omap2_set_init_voltage NeilBrown
2012-01-06 19:07 ` Kevin Hilman
  -- strict thread matches above, loose matches on Subject: below --
2012-01-09  2:14 NeilBrown
2012-01-09 23:11 ` Kevin Hilman
2012-01-09 23:12   ` Kevin Hilman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).