On 01/11/2012 04:08 PM, Gerd Hoffmann wrote:
+void qemu_system_suspend_request(qemu_irq wake_irq) +{ + if (suspend_wake_irq != NULL) { + return; + } + cpu_stop_current(); + qemu_notify_event(); + suspend_wake_irq = wake_irq; +} + +void qemu_system_wakeup_request(void) +{ + if (suspend_wake_irq == NULL) { + return; + } + reset_requested = 1; + qemu_irq_raise(suspend_wake_irq); + suspend_wake_irq = NULL; +}
The code in acpi.c is confusing, but it seems to me that IRQ is raised when the system _enters_ S3. See especially xen-all.c. It would be lowered by acpi_pm1_cnt_reset when the reset actually happens on the next main loop iteration. However, acpi_pm1_cnt_reset has never been called since its introduction in commit eaba51c (acpi, acpi_piix, vt82c686: factor out PM1_CNT logic, 2011-03-25).
Overall, it seems to me that with your new infrastructure a global Notifier would be a better fit than a qemu_irq that the board would have to pass all the way. A notifier would also remove the ugly Xen special casing. However, this can be done separately.
Paolo