From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2ekq-0001ys-M4 for qemu-devel@nongnu.org; Fri, 26 Jul 2013 05:56:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2ekn-0004f8-Tt for qemu-devel@nongnu.org; Fri, 26 Jul 2013 05:56:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2ekn-0004ei-Mm for qemu-devel@nongnu.org; Fri, 26 Jul 2013 05:56:05 -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 r6Q9u4Ne011572 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 26 Jul 2013 05:56:05 -0400 From: Gerd Hoffmann Date: Fri, 26 Jul 2013 11:56:03 +0200 Message-Id: <1374832563-28693-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH] 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 066072e..b93d3ae 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