qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 1/5] suspend: add infrastructure


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH 1/5] suspend: add infrastructure
Date: Fri, 13 Jan 2012 16:51:15 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]