yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From ad3f6b5b188c572bd07cc5929e844138c2d95915 Mon Sep 17 00:00:00 2001
9ae3a8
From: Gerd Hoffmann <kraxel@redhat.com>
9ae3a8
Date: Fri, 13 Nov 2015 13:32:34 +0100
9ae3a8
Subject: [PATCH 1/6] ehci: clear suspend bit on detach
9ae3a8
9ae3a8
Message-id: <1447421554-28366-2-git-send-email-kraxel@redhat.com>
9ae3a8
Patchwork-id: 68349
9ae3a8
O-Subject: [RHEL-7.3 qemu-kvm PATCH 1/1] ehci: clear suspend bit on detach
9ae3a8
Bugzilla: 1268879
9ae3a8
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
9ae3a8
RH-Acked-by: John Snow <jsnow@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
9ae3a8
When a device is detached, clear the suspend bit (PORTSC_SUSPEND)
9ae3a8
in the port status register.
9ae3a8
9ae3a8
The specs are not *that* clear what is supposed to happen in case
9ae3a8
a suspended device is unplugged.  But the enable bit (PORTSC_PED)
9ae3a8
is cleared, and the specs mention setting suspend with enable being
9ae3a8
unset is undefined behavior.  So clearing them both looks reasonable,
9ae3a8
and it actually fixes the reported bug.
9ae3a8
9ae3a8
Cc: Hans de Goede <hdegoede@redhat.com>
9ae3a8
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9ae3a8
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9ae3a8
Message-id: 1445413462-18004-1-git-send-email-kraxel@redhat.com
9ae3a8
(cherry picked from commit cbf82fa01e6fd4ecb234b235b10ffce548154a95)
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 hw/usb/hcd-ehci.c | 2 +-
9ae3a8
 1 file changed, 1 insertion(+), 1 deletion(-)
9ae3a8
9ae3a8
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
9ae3a8
index 02d2ab7..3429c77 100644
9ae3a8
--- a/hw/usb/hcd-ehci.c
9ae3a8
+++ b/hw/usb/hcd-ehci.c
9ae3a8
@@ -802,7 +802,7 @@ static void ehci_detach(USBPort *port)
9ae3a8
     ehci_queues_rip_device(s, port->dev, 0);
9ae3a8
     ehci_queues_rip_device(s, port->dev, 1);
9ae3a8
 
9ae3a8
-    *portsc &= ~(PORTSC_CONNECT|PORTSC_PED);
9ae3a8
+    *portsc &= ~(PORTSC_CONNECT|PORTSC_PED|PORTSC_SUSPEND);
9ae3a8
     *portsc |= PORTSC_CSC;
9ae3a8
 
9ae3a8
     ehci_raise_irq(s, USBSTS_PCD);
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8