Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sebastian Capella and committed by
Rafael J. Wysocki
2c730785 4881f603

+4 -2
+4 -2
kernel/power/hibernate.c
··· 599 599 case HIBERNATION_PLATFORM: 600 600 hibernation_platform_enter(); 601 601 case HIBERNATION_SHUTDOWN: 602 - kernel_power_off(); 602 + if (pm_power_off) 603 + kernel_power_off(); 603 604 break; 604 605 #ifdef CONFIG_SUSPEND 605 606 case HIBERNATION_SUSPEND: ··· 628 627 * corruption after resume. 629 628 */ 630 629 printk(KERN_CRIT "PM: Please power down manually\n"); 631 - while(1); 630 + while (1) 631 + cpu_relax(); 632 632 } 633 633 634 634 /**