diff options
author | Sebastian Capella <sebastian.capella@linaro.org> | 2014-04-21 20:30:46 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-04-30 19:02:25 -0400 |
commit | 2c730785d9532d2a9c46e059bd6a6c9a764c539f (patch) | |
tree | db321b3e87c9ebaf4897a8a8e8fed9f79195a6ea /kernel/power | |
parent | 4881f603d7b82df2bc15efd2a272f973a3bf8df1 (diff) |
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>
Diffstat (limited to 'kernel/power')
-rw-r--r-- | kernel/power/hibernate.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index de4b989cc8fd..1f08ac7f55d8 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
@@ -599,7 +599,8 @@ static void power_down(void) | |||
599 | case HIBERNATION_PLATFORM: | 599 | case HIBERNATION_PLATFORM: |
600 | hibernation_platform_enter(); | 600 | hibernation_platform_enter(); |
601 | case HIBERNATION_SHUTDOWN: | 601 | case HIBERNATION_SHUTDOWN: |
602 | kernel_power_off(); | 602 | if (pm_power_off) |
603 | kernel_power_off(); | ||
603 | break; | 604 | break; |
604 | #ifdef CONFIG_SUSPEND | 605 | #ifdef CONFIG_SUSPEND |
605 | case HIBERNATION_SUSPEND: | 606 | case HIBERNATION_SUSPEND: |
@@ -627,7 +628,8 @@ static void power_down(void) | |||
627 | * corruption after resume. | 628 | * corruption after resume. |
628 | */ | 629 | */ |
629 | printk(KERN_CRIT "PM: Please power down manually\n"); | 630 | printk(KERN_CRIT "PM: Please power down manually\n"); |
630 | while(1); | 631 | while (1) |
632 | cpu_relax(); | ||
631 | } | 633 | } |
632 | 634 | ||
633 | /** | 635 | /** |