From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7ORb-0002uL-T3 for qemu-devel@nongnu.org; Thu, 08 Aug 2013 07:31:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7ORO-0001BJ-Dm for qemu-devel@nongnu.org; Thu, 08 Aug 2013 07:31:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7ORO-0001B7-71 for qemu-devel@nongnu.org; Thu, 08 Aug 2013 07:31:38 -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 r78BVbE7014023 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 8 Aug 2013 07:31:37 -0400 From: Gerd Hoffmann Date: Thu, 8 Aug 2013 13:31:35 +0200 Message-Id: <1375961495-20970-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1375961495-20970-1-git-send-email-kraxel@redhat.com> References: <1375961495-20970-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 1/1] xhci: implement warm port reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Without this patch windows can't do port resets for usb3 devices. https://bugzilla.redhat.com/show_bug.cgi?id=949514 Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index ff5f681..58c88b8 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -2672,7 +2672,7 @@ static void xhci_port_update(XHCIPort *port, int is_detach) xhci_port_notify(port, PORTSC_CSC); } -static void xhci_port_reset(XHCIPort *port) +static void xhci_port_reset(XHCIPort *port, bool warm_reset) { trace_usb_xhci_port_reset(port->portnr); @@ -2683,6 +2683,11 @@ static void xhci_port_reset(XHCIPort *port) usb_device_reset(port->uport->dev); switch (port->uport->dev->speed) { + case USB_SPEED_SUPER: + if (warm_reset) { + port->portsc |= PORTSC_WRC; + } + /* fall through */ case USB_SPEED_LOW: case USB_SPEED_FULL: case USB_SPEED_HIGH: @@ -2845,8 +2850,12 @@ static void xhci_port_write(void *ptr, hwaddr reg, switch (reg) { case 0x00: /* PORTSC */ /* write-1-to-start bits */ + if (val & PORTSC_WPR) { + xhci_port_reset(port, true); + break; + } if (val & PORTSC_PR) { - xhci_port_reset(port); + xhci_port_reset(port, false); break; } -- 1.7.9.7