From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZJmc-0000qG-Sk for qemu-devel@nongnu.org; Fri, 26 Feb 2016 09:54:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZJmY-0006Pj-PC for qemu-devel@nongnu.org; Fri, 26 Feb 2016 09:54:18 -0500 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:33713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZJmY-0006O2-Iw for qemu-devel@nongnu.org; Fri, 26 Feb 2016 09:54:14 -0500 Received: by mail-wm0-x230.google.com with SMTP id g62so75687357wme.0 for ; Fri, 26 Feb 2016 06:54:11 -0800 (PST) Message-ID: <56D06712.2030607@linaro.org> Date: Fri, 26 Feb 2016 22:54:10 +0800 From: Shannon Zhao MIME-Version: 1.0 References: <1454005340-15682-1-git-send-email-wei@redhat.com> <56B1A90E.3000506@msgid.tls.msk.ru> <56B22469.7040308@redhat.com> <56B2AD13.6030504@huawei.com> <56B2EB3E.2000908@redhat.com> <56B2F4E3.6010807@huawei.com> <56BA6F6C.5000301@redhat.com> <56C845B1.3080000@huawei.com> <56CE2D33.7020005@redhat.com> <56D04596.7010205@huawei.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/1] arm: virt: change GPIO trigger interrupt to pulse List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , Shannon Zhao Cc: Wei Huang , QEMU Trivial , Michael Tokarev , QEMU Developers On 2016/2/26 20:53, Peter Maydell wrote: > On 26 February 2016 at 12:31, Shannon Zhao wrote: >> So how about below patch? I've tested it and it works both for ACPI and >> DT. Could you help verify if it works for you? Thanks. >> >> diff --git a/hw/arm/virt.c b/hw/arm/virt.c >> index 15658f4..4d45ea2 100644 >> --- a/hw/arm/virt.c >> +++ b/hw/arm/virt.c >> @@ -558,11 +558,20 @@ static void create_rtc(const VirtBoardInfo *vbi, >> qemu_irq *pic) >> g_free(nodename); >> } >> >> +#define GPIO_KEY_LATENCY 500 /* 500ms */ > > I don't understand why a 500ms pulse is better than a short one. > Oh, I just pick a value which seems like a real latency for pressing a button. What's your suggestion? >> +static QEMUTimer *gpio_key_timer; > > This is state, and must be migrated somehow. > Ah, yes. So is it fine if we move this timer and the notifier virt_system_powerdown_notifier to VirtMachineState? Thanks, -- Shannon