Skip to content

Commit 2c73078

Browse files
Sebastian Capellarafaeljw
authored andcommitted
PM / hibernate: no kernel_power_off when pm_power_off NULL
Reboot logic in kernel/reboot will avoid calling kernel_power_off when pm_power_off is null, and instead uses kernel_halt. Change hibernate's power_down to follow the behavior in the reboot call. Calling the notifier twice (once for SYS_POWER_OFF and again for SYS_HALT) causes a panic during hibernation on Kirkwood Openblocks A6 board. Signed-off-by: Sebastian Capella <sebastian.capella@linaro.org> Reported-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 4881f60 commit 2c73078

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kernel/power/hibernate.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,8 @@ static void power_down(void)
599599
case HIBERNATION_PLATFORM:
600600
hibernation_platform_enter();
601601
case HIBERNATION_SHUTDOWN:
602-
kernel_power_off();
602+
if (pm_power_off)
603+
kernel_power_off();
603604
break;
604605
#ifdef CONFIG_SUSPEND
605606
case HIBERNATION_SUSPEND:
@@ -627,7 +628,8 @@ static void power_down(void)
627628
* corruption after resume.
628629
*/
629630
printk(KERN_CRIT "PM: Please power down manually\n");
630-
while(1);
631+
while (1)
632+
cpu_relax();
631633
}
632634

633635
/**

0 commit comments

Comments
 (0)