Commit d2805402 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

PM / Domains: Take .power_off() error code into account

Currently pm_genpd_poweroff() discards error codes returned by
the PM domain's .power_off() callback, because it's safer to always
regard the domain as inaccessible to drivers after a failing
.power_off().  Still, there are situations in which the low-level
code may want to indicate that it doesn't want to power off the
domain, so allow it to do that by returning -EBUSY from .power_off().
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarMagnus Damm <damm@opensource.se>
parent 0bc5b2de
...@@ -312,8 +312,16 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd) ...@@ -312,8 +312,16 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
} }
} }
if (genpd->power_off) if (genpd->power_off) {
genpd->power_off(genpd); ret = genpd->power_off(genpd);
if (ret == -EBUSY) {
genpd_set_active(genpd);
if (parent)
genpd_release_lock(parent);
goto out;
}
}
genpd->status = GPD_STATE_POWER_OFF; genpd->status = GPD_STATE_POWER_OFF;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment