diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2017-03-20 06:19:22 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-03-28 18:11:34 -0400 |
commit | 1c14967c6ea0deb3db4a974b1de519f5a5593ef4 (patch) | |
tree | 37685d825177673bcb3d82c577ee36fefc1eac01 | |
parent | ffaa42e8a40b7f1041e36b022cd28b7c45e2b564 (diff) |
PM / Domains: Respect errors from genpd's ->power_off() callback
The current code in genpd_sync_power_off(), doesn't care about potential
errors being returned from genpd's ->power_off() callback.
Obviously this behaviour could lead to problems, such as incorrectly
setting the genpd's status to GPD_STATE_POWER_OFF, but also to incorrectly
decrease the subdomain count for the masters, which potentially allows them
to be powered off in the next recursive call to genpd_sync_power_off().
Let's fix this behaviour by bailing out when the ->power_off() callback
returns an error code.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/base/power/domain.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index c71a7ef08b05..c0318c130396 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
@@ -767,7 +767,8 @@ static void genpd_sync_power_off(struct generic_pm_domain *genpd, bool use_lock, | |||
767 | 767 | ||
768 | /* Choose the deepest state when suspending */ | 768 | /* Choose the deepest state when suspending */ |
769 | genpd->state_idx = genpd->state_count - 1; | 769 | genpd->state_idx = genpd->state_count - 1; |
770 | _genpd_power_off(genpd, false); | 770 | if (_genpd_power_off(genpd, false)) |
771 | return; | ||
771 | 772 | ||
772 | genpd->status = GPD_STATE_POWER_OFF; | 773 | genpd->status = GPD_STATE_POWER_OFF; |
773 | 774 | ||