Skip to content

Commit 1c14967

Browse files
storulfrafaeljw
authored andcommitted
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 <[email protected]> Reviewed-by: Viresh Kumar <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Bartlomiej Zolnierkiewicz <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent ffaa42e commit 1c14967

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/base/power/domain.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,8 @@ static void genpd_sync_power_off(struct generic_pm_domain *genpd, bool use_lock,
767767

768768
/* Choose the deepest state when suspending */
769769
genpd->state_idx = genpd->state_count - 1;
770-
_genpd_power_off(genpd, false);
770+
if (_genpd_power_off(genpd, false))
771+
return;
771772

772773
genpd->status = GPD_STATE_POWER_OFF;
773774

0 commit comments

Comments
 (0)