aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2015-09-02 04:16:13 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-09-02 20:53:53 -0400
commit29e47e2173349ee06bd339f7753821c720d50923 (patch)
treec384b54f97ee0a47d125d21637948d1a47525897
parent8bb6944e5aabaf9b7977502667a6981733564f85 (diff)
PM / Domains: Try power off masters in error path of __pm_genpd_poweron()
While powering up a genpd, its domain masters are first being powered up. In the error path of __pm_genpd_poweron(), we didn't care to try power off these domain masters. Let's deal with that to avoid leaving unused PM domains powered. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/base/power/domain.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 416720159e96..62f757250235 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -213,6 +213,18 @@ static int genpd_power_off(struct generic_pm_domain *genpd, bool timed)
213} 213}
214 214
215/** 215/**
216 * genpd_queue_power_off_work - Queue up the execution of pm_genpd_poweroff().
217 * @genpd: PM domait to power off.
218 *
219 * Queue up the execution of pm_genpd_poweroff() unless it's already been done
220 * before.
221 */
222static void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
223{
224 queue_work(pm_wq, &genpd->power_off_work);
225}
226
227/**
216 * __pm_genpd_poweron - Restore power to a given PM domain and its masters. 228 * __pm_genpd_poweron - Restore power to a given PM domain and its masters.
217 * @genpd: PM domain to power up. 229 * @genpd: PM domain to power up.
218 * 230 *
@@ -259,8 +271,12 @@ static int __pm_genpd_poweron(struct generic_pm_domain *genpd)
259 return 0; 271 return 0;
260 272
261 err: 273 err:
262 list_for_each_entry_continue_reverse(link, &genpd->slave_links, slave_node) 274 list_for_each_entry_continue_reverse(link,
275 &genpd->slave_links,
276 slave_node) {
263 genpd_sd_counter_dec(link->master); 277 genpd_sd_counter_dec(link->master);
278 genpd_queue_power_off_work(link->master);
279 }
264 280
265 return ret; 281 return ret;
266} 282}
@@ -349,18 +365,6 @@ static int genpd_dev_pm_qos_notifier(struct notifier_block *nb,
349} 365}
350 366
351/** 367/**
352 * genpd_queue_power_off_work - Queue up the execution of pm_genpd_poweroff().
353 * @genpd: PM domait to power off.
354 *
355 * Queue up the execution of pm_genpd_poweroff() unless it's already been done
356 * before.
357 */
358static void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
359{
360 queue_work(pm_wq, &genpd->power_off_work);
361}
362
363/**
364 * pm_genpd_poweroff - Remove power from a given PM domain. 368 * pm_genpd_poweroff - Remove power from a given PM domain.
365 * @genpd: PM domain to power down. 369 * @genpd: PM domain to power down.
366 * 370 *