From patchwork Fri Jul 26 09:56:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 262105 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B0CEF2C00F8 for ; Fri, 26 Jul 2013 19:56:25 +1000 (EST) Received: from localhost ([::1]:33865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2el5-0001z9-6X for incoming@patchwork.ozlabs.org; Fri, 26 Jul 2013 05:56:23 -0400 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 Received: from rincewind.home.kraxel.org (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r6Q9u3CZ015262; Fri, 26 Jul 2013 05:56:04 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 644764177B; Fri, 26 Jul 2013 11:56:03 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 26 Jul 2013 11:56:03 +0200 Message-Id: <1374832563-28693-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH] uhci: egsm fix X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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;