mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
PM: Rework handling of interrupts during suspend-resume
Use the functions introduced in by the previous patch, suspend_device_irqs(), resume_device_irqs() and check_wakeup_irqs(), to rework the handling of interrupts during suspend (hibernation) and resume. Namely, interrupts will only be disabled on the CPU right before suspending sysdevs, while device drivers will be prevented from receiving interrupts, with the help of the new helper function, before their "late" suspend callbacks run (and analogously during resume). In addition, since the device interrups are now disabled before the CPU has turned all interrupts off and the CPU will ACK the interrupts setting the IRQ_PENDING bit for them, check in sysdev_suspend() if any wake-up interrupts are pending and abort suspend if that's the case. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
0a0c5168df
commit
2ed8d2b3a8
7 changed files with 83 additions and 40 deletions
|
|
@ -39,12 +39,6 @@ static int xen_suspend(void *data)
|
|||
|
||||
BUG_ON(!irqs_disabled());
|
||||
|
||||
err = device_power_down(PMSG_SUSPEND);
|
||||
if (err) {
|
||||
printk(KERN_ERR "xen_suspend: device_power_down failed: %d\n",
|
||||
err);
|
||||
return err;
|
||||
}
|
||||
err = sysdev_suspend(PMSG_SUSPEND);
|
||||
if (err) {
|
||||
printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n",
|
||||
|
|
@ -69,7 +63,6 @@ static int xen_suspend(void *data)
|
|||
xen_mm_unpin_all();
|
||||
|
||||
sysdev_resume();
|
||||
device_power_up(PMSG_RESUME);
|
||||
|
||||
if (!*cancelled) {
|
||||
xen_irq_resume();
|
||||
|
|
@ -108,6 +101,12 @@ static void do_suspend(void)
|
|||
/* XXX use normal device tree? */
|
||||
xenbus_suspend();
|
||||
|
||||
err = device_power_down(PMSG_SUSPEND);
|
||||
if (err) {
|
||||
printk(KERN_ERR "device_power_down failed: %d\n", err);
|
||||
goto resume_devices;
|
||||
}
|
||||
|
||||
err = stop_machine(xen_suspend, &cancelled, cpumask_of(0));
|
||||
if (err) {
|
||||
printk(KERN_ERR "failed to start xen_suspend: %d\n", err);
|
||||
|
|
@ -120,6 +119,9 @@ static void do_suspend(void)
|
|||
} else
|
||||
xenbus_suspend_cancel();
|
||||
|
||||
device_power_up(PMSG_RESUME);
|
||||
|
||||
resume_devices:
|
||||
device_resume(PMSG_RESUME);
|
||||
|
||||
/* Make sure timer events get retriggered on all CPUs */
|
||||
|
|
|
|||
Loading…
Reference in a new issue