Skip to content

Commit

Permalink
PM / hibernate: no kernel_power_off when pm_power_off NULL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sebastian Capella authored and Rafael J. Wysocki committed Apr 30, 2014
1 parent 4881f60 commit 2c73078
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/power/hibernate.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ static void power_down(void)
case HIBERNATION_PLATFORM:
hibernation_platform_enter();
case HIBERNATION_SHUTDOWN:
kernel_power_off();
if (pm_power_off)
kernel_power_off();
break;
#ifdef CONFIG_SUSPEND
case HIBERNATION_SUSPEND:
Expand Down Expand Up @@ -627,7 +628,8 @@ static void power_down(void)
* corruption after resume.
*/
printk(KERN_CRIT "PM: Please power down manually\n");
while(1);
while (1)
cpu_relax();
}

/**
Expand Down

0 comments on commit 2c73078

Please sign in to comment.