From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V45Po-0000N3-VN for qemu-devel@nongnu.org; Tue, 30 Jul 2013 04:36:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V45Pi-0001Bj-Tz for qemu-devel@nongnu.org; Tue, 30 Jul 2013 04:36:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V45Pi-0001B6-M4 for qemu-devel@nongnu.org; Tue, 30 Jul 2013 04:36:14 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6U8aCjA023232 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 30 Jul 2013 04:36:12 -0400 From: Gerd Hoffmann Date: Tue, 30 Jul 2013 10:36:10 +0200 Message-Id: <1375173371-3378-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1375173371-3378-1-git-send-email-kraxel@redhat.com> References: <1375173371-3378-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/3] uhci: egsm fix List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann When the guest goes suspend the uhci controller while there are pending resume requests on the ports go signal global resume instantly. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index cb44abc..ac82833 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -189,6 +189,7 @@ typedef struct UHCI_QH { static void uhci_async_cancel(UHCIAsync *async); static void uhci_queue_fill(UHCIQueue *q, UHCI_TD *td); +static void uhci_resume(void *opaque); static inline int32_t uhci_queue_token(UHCI_TD *td) { @@ -498,6 +499,12 @@ static void uhci_port_write(void *opaque, hwaddr addr, return; } s->cmd = val; + if (val & UHCI_CMD_EGSM) { + if ((s->ports[0].ctrl & UHCI_PORT_RD) || + (s->ports[1].ctrl & UHCI_PORT_RD)) { + uhci_resume(s); + } + } break; case 0x02: s->status &= ~val; -- 1.7.9.7