PM: Add missing syscore_suspend() and syscore_resume() calls
Device suspend/resume infrastructure is used not only by the suspend
and hibernate code in kernel/power, but also by APM, Xen and the
kexec jump feature. However, commit 40dc166cb5
(PM / Core: Introduce struct syscore_ops for core subsystems PM)
failed to add syscore_suspend() and syscore_resume() calls to that
code, which generally leads to breakage when the features in question
are used.
To fix this problem, add the missing syscore_suspend() and
syscore_resume() calls to arch/x86/kernel/apm_32.c, kernel/kexec.c
and drivers/xen/manage.c.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/swap.h>
|
||||
#include <linux/kmsg_dump.h>
|
||||
#include <linux/syscore_ops.h>
|
||||
|
||||
#include <asm/page.h>
|
||||
#include <asm/uaccess.h>
|
||||
@@ -1532,6 +1533,11 @@ int kernel_kexec(void)
|
||||
local_irq_disable();
|
||||
/* Suspend system devices */
|
||||
error = sysdev_suspend(PMSG_FREEZE);
|
||||
if (!error) {
|
||||
error = syscore_suspend();
|
||||
if (error)
|
||||
sysdev_resume();
|
||||
}
|
||||
if (error)
|
||||
goto Enable_irqs;
|
||||
} else
|
||||
@@ -1546,6 +1552,7 @@ int kernel_kexec(void)
|
||||
|
||||
#ifdef CONFIG_KEXEC_JUMP
|
||||
if (kexec_image->preserve_context) {
|
||||
syscore_resume();
|
||||
sysdev_resume();
|
||||
Enable_irqs:
|
||||
local_irq_enable();
|
||||
|
Reference in New Issue
Block a user