From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1xbZ-0002bG-Nc for qemu-devel@nongnu.org; Thu, 16 Aug 2012 06:47:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1xbY-0006Ts-Pu for qemu-devel@nongnu.org; Thu, 16 Aug 2012 06:47:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1xbY-0006TY-HH for qemu-devel@nongnu.org; Thu, 16 Aug 2012 06:47:08 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7GAl76n014554 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 16 Aug 2012 06:47:07 -0400 From: Gerd Hoffmann Date: Thu, 16 Aug 2012 12:11:50 +0200 Message-Id: <1345111910-26791-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1345111910-26791-1-git-send-email-kraxel@redhat.com> References: <1345111910-26791-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH for-1.2 4/4] ehci: Fix setting of halt bit from usbcmd register updates List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede , Gerd Hoffmann From: Hans de Goede This fixes linux guests started without any USB devices not seeing newly plugged devices until "lsusb" is done inside the guest. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index e489509..8b94b17 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -1187,22 +1187,23 @@ static void ehci_mem_writel(void *ptr, target_phys_addr_t addr, uint32_t val) break; } + /* not supporting dynamic frame list size at the moment */ + if ((val & USBCMD_FLS) && !(s->usbcmd & USBCMD_FLS)) { + fprintf(stderr, "attempt to set frame list size -- value %d\n", + val & USBCMD_FLS); + val &= ~USBCMD_FLS; + } + if (((USBCMD_RUNSTOP | USBCMD_PSE | USBCMD_ASE) & val) != ((USBCMD_RUNSTOP | USBCMD_PSE | USBCMD_ASE) & s->usbcmd)) { if (s->pstate == EST_INACTIVE) { SET_LAST_RUN_CLOCK(s); } + s->usbcmd = val; /* Set usbcmd for ehci_update_halt() */ ehci_update_halt(s); s->async_stepdown = 0; qemu_mod_timer(s->frame_timer, qemu_get_clock_ns(vm_clock)); } - - /* not supporting dynamic frame list size at the moment */ - if ((val & USBCMD_FLS) && !(s->usbcmd & USBCMD_FLS)) { - fprintf(stderr, "attempt to set frame list size -- value %d\n", - val & USBCMD_FLS); - val &= ~USBCMD_FLS; - } break; case USBSTS: -- 1.7.1