|
|
9ae3a8 |
From 6e80e82c534ca31d46e556ab10b83ebbd381a627 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
Date: Fri, 30 Aug 2013 09:39:37 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 08/29] xhci: implement warm port reset
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1377855577-11693-2-git-send-email-kraxel@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 53942
|
|
|
9ae3a8 |
O-Subject: [RHEL-7 qemu-kvm PATCH 1/1] xhci: implement warm port reset
|
|
|
9ae3a8 |
Bugzilla: 949514
|
|
|
9ae3a8 |
RH-Acked-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Without this patch windows can't do port resets for usb3 devices.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
https://bugzilla.redhat.com/show_bug.cgi?id=949514
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit dad5b9ea0895c227bc9d48b7f0a6fa51eaaa8661)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Note: the upstream commit message is incomplete. This patch also
|
|
|
9ae3a8 |
fixes cold port reset with USB_SPEED_SUPER.
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/usb/hcd-xhci.c | 13 +++++++++++--
|
|
|
9ae3a8 |
1 file changed, 11 insertions(+), 2 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/usb/hcd-xhci.c | 13 +++++++++++--
|
|
|
9ae3a8 |
1 files changed, 11 insertions(+), 2 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
|
|
|
9ae3a8 |
index 3d3d6c3..233f3b6 100644
|
|
|
9ae3a8 |
--- a/hw/usb/hcd-xhci.c
|
|
|
9ae3a8 |
+++ b/hw/usb/hcd-xhci.c
|
|
|
9ae3a8 |
@@ -2655,7 +2655,7 @@ static void xhci_port_update(XHCIPort *port, int is_detach)
|
|
|
9ae3a8 |
xhci_port_notify(port, PORTSC_CSC);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-static void xhci_port_reset(XHCIPort *port)
|
|
|
9ae3a8 |
+static void xhci_port_reset(XHCIPort *port, bool warm_reset)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
trace_usb_xhci_port_reset(port->portnr);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -2666,6 +2666,11 @@ static void xhci_port_reset(XHCIPort *port)
|
|
|
9ae3a8 |
usb_device_reset(port->uport->dev);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
switch (port->uport->dev->speed) {
|
|
|
9ae3a8 |
+ case USB_SPEED_SUPER:
|
|
|
9ae3a8 |
+ if (warm_reset) {
|
|
|
9ae3a8 |
+ port->portsc |= PORTSC_WRC;
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+ /* fall through */
|
|
|
9ae3a8 |
case USB_SPEED_LOW:
|
|
|
9ae3a8 |
case USB_SPEED_FULL:
|
|
|
9ae3a8 |
case USB_SPEED_HIGH:
|
|
|
9ae3a8 |
@@ -2828,8 +2833,12 @@ static void xhci_port_write(void *ptr, hwaddr reg,
|
|
|
9ae3a8 |
switch (reg) {
|
|
|
9ae3a8 |
case 0x00: /* PORTSC */
|
|
|
9ae3a8 |
/* write-1-to-start bits */
|
|
|
9ae3a8 |
+ if (val & PORTSC_WPR) {
|
|
|
9ae3a8 |
+ xhci_port_reset(port, true);
|
|
|
9ae3a8 |
+ break;
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
if (val & PORTSC_PR) {
|
|
|
9ae3a8 |
- xhci_port_reset(port);
|
|
|
9ae3a8 |
+ xhci_port_reset(port, false);
|
|
|
9ae3a8 |
break;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|