summaryrefslogtreecommitdiff
path: root/drivers/base/power/opp/opp.h
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2017-01-23 10:11:41 +0530
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-01-30 09:22:20 +0100
commit37a73ec0c9bbd712d24cc2035696893e5b6119a5 (patch)
treef26471abf34316fc58ea9fbb19e5eaba2f4f0d78 /drivers/base/power/opp/opp.h
parentb6160e26936bcf1b9181bb34ad4f420ccd3f39f0 (diff)
PM / OPP: Add per OPP table mutex
Add per OPP table lock to protect opp_table->opp_list. Note that at few places opp_list is used under the rcu_read_lock() and so a mutex can't be added there for now. This will be fixed by a later patch. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base/power/opp/opp.h')
-rw-r--r--drivers/base/power/opp/opp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/base/power/opp/opp.h b/drivers/base/power/opp/opp.h
index 0a5eb4d1e8f7..105243b06373 100644
--- a/drivers/base/power/opp/opp.h
+++ b/drivers/base/power/opp/opp.h
@@ -131,6 +131,7 @@ enum opp_table_access {
* @rcu_head: RCU callback head used for deferred freeing
* @dev_list: list of devices that share these OPPs
* @opp_list: table of opps
+ * @lock: mutex protecting the opp_list.
* @np: struct device_node pointer for opp's DT node.
* @clock_latency_ns_max: Max clock latency in nanoseconds.
* @shared_opp: OPP is shared between multiple devices.
@@ -163,6 +164,7 @@ struct opp_table {
struct rcu_head rcu_head;
struct list_head dev_list;
struct list_head opp_list;
+ struct mutex lock;
struct device_node *np;
unsigned long clock_latency_ns_max;