From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RljPb-0000pm-Fb for qemu-devel@nongnu.org; Fri, 13 Jan 2012 10:51:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RljPV-00015z-R1 for qemu-devel@nongnu.org; Fri, 13 Jan 2012 10:51:27 -0500 Received: from mail-gy0-f173.google.com ([209.85.160.173]:39374) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RljPV-00015s-M6 for qemu-devel@nongnu.org; Fri, 13 Jan 2012 10:51:21 -0500 Received: by ghbg15 with SMTP id g15so1101989ghb.4 for ; Fri, 13 Jan 2012 07:51:21 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4F1052F3.2040708@redhat.com> Date: Fri, 13 Jan 2012 16:51:15 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1326294541-15080-1-git-send-email-kraxel@redhat.com> <1326294541-15080-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1326294541-15080-2-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 1/5] suspend: add infrastructure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel , Gerd Hoffmann 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