From: Nishanth Menon <nm@ti.com>
To: linux-pm <linux-pm@vger.kernel.org>
Cc: Rafael <rjw@sisk.pl>, Kevin <khilman@deeprootsystems.com>,
MyungJoo Ham <myungjoo.ham@samsung.com>,
lkml <linux-kernel@vger.kernel.org>,
lo <linux-omap@vger.kernel.org>, Jack <jack@embed.me.uk>,
Alexander <holler@ahsoftware.de>, Nishanth Menon <nm@ti.com>
Subject: [PATCH 3/4] PM / devfreq: add locking documentation for recommended_opp
Date: Fri, 18 Jan 2013 13:52:34 -0600 [thread overview]
Message-ID: <1358538755-29109-4-git-send-email-nm@ti.com> (raw)
In-Reply-To: <1358538755-29109-1-git-send-email-nm@ti.com>
OPP pointers are protected by RCU locks, the pointer validity is
permissible only under the section of rcu_read_lock to rcu_read_unlock
Add documentation to the effect.
Signed-off-by: Nishanth Menon <nm@ti.com>
---
drivers/devfreq/devfreq.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 53766f3..3b36797 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -994,6 +994,11 @@ module_exit(devfreq_exit);
* @freq: The frequency given to target function
* @flags: Flags handed from devfreq framework.
*
+ * Locking: This function must be called under rcu_read_lock(). opp is a rcu
+ * protected pointer. The reason for the same is that the opp pointer which is
+ * returned will remain valid for use with opp_get_{voltage, freq} only while
+ * under the locked area. The pointer returned must be used prior to unlocking
+ * with rcu_read_unlock() to maintain the integrity of the pointer.
*/
struct opp *devfreq_recommended_opp(struct device *dev, unsigned long *freq,
u32 flags)
--
1.7.9.5
next prev parent reply other threads:[~2013-01-18 19:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-18 19:52 [PATCH 0/4] OPP usage fixes for RCU locking Nishanth Menon
2013-01-18 19:52 ` [PATCH 1/4] cpufreq: OMAP: use RCU locks around usage of OPP Nishanth Menon
2013-01-18 19:52 ` [PATCH 2/4] cpufreq: cpufreq-cpu0: " Nishanth Menon
2013-01-18 19:52 ` Nishanth Menon [this message]
2013-01-18 19:52 ` [PATCH 4/4] PM / devfreq: exynos4_bus: honor RCU lock usage Nishanth Menon
2013-01-18 22:28 ` [PATCH 0/4] OPP usage fixes for RCU locking Rafael J. Wysocki
2013-01-21 5:45 ` MyungJoo Ham
2013-01-21 12:40 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1358538755-29109-4-git-send-email-nm@ti.com \
--to=nm@ti.com \
--cc=holler@ahsoftware.de \
--cc=jack@embed.me.uk \
--cc=khilman@deeprootsystems.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=rjw@sisk.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®