aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pm_domain.h
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2015-01-27 15:13:42 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-02-03 16:56:53 -0500
commitc0356db7d1b66840882744cbd9d9c5960b2d88c7 (patch)
tree98f3e89374400691135194fa4cbfdc065b96e5ed /include/linux/pm_domain.h
parente07b45cb98839aa972c099ffd5fc5eb2ff1b2e26 (diff)
PM / Domains: Eliminate the mutex for the generic_pm_domain_data
While adding devices to their PM domains, dev_pm_qos_add_notifier() was invoked while allocating the generic_pm_domain_data for the device. Since the generic_pm_domain_data's device pointer will be assigned after allocation, the ->genpd_dev_pm_qos_notifier() callback could be called prior having a valid pointer to the device. Similar scenario existed while removing a device from a genpd. To cope with these scenarios a mutex was used to protect the pointer to the device. By re-order the sequence for when dev_pm_qos_add|remove_notifier() are invoked, we make sure the ->genpd_dev_pm_qos_notifier() callback are always called with a valid device pointer available. In this way, we eliminate the need for protecting the pointer and thus we can remove the mutex from the struct generic_pm_domain_data. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/pm_domain.h')
-rw-r--r--include/linux/pm_domain.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index e160a0bba28d..080e778118ba 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -113,7 +113,6 @@ struct generic_pm_domain_data {
113 struct pm_domain_data base; 113 struct pm_domain_data base;
114 struct gpd_timing_data td; 114 struct gpd_timing_data td;
115 struct notifier_block nb; 115 struct notifier_block nb;
116 struct mutex lock;
117 int need_restore; 116 int need_restore;
118}; 117};
119 118