dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0009-usb-ehci-cleanup-port-reset-handling.patch

3f1f29
From afada27ad05658aae93aa8beab34b1b6885f63b9 Mon Sep 17 00:00:00 2001
3f1f29
From: Hans de Goede <hdegoede@redhat.com>
3f1f29
Date: Tue, 21 Jun 2011 12:23:40 +0200
3f1f29
Subject: [PATCH 09/35] usb-ehci: cleanup port reset handling
3f1f29
3f1f29
Doing a usb_attach when dev is NULL will just result in the
3f1f29
port detach op getting called even though nothing was connected in
3f1f29
the first place.
3f1f29
3f1f29
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
3f1f29
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
3f1f29
---
3f1f29
 hw/usb-ehci.c |    7 +------
3f1f29
 1 files changed, 1 insertions(+), 6 deletions(-)
3f1f29
3f1f29
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
3f1f29
index ce1a432..d85e0a9 100644
3f1f29
--- a/hw/usb-ehci.c
3f1f29
+++ b/hw/usb-ehci.c
3f1f29
@@ -863,14 +863,9 @@ static void handle_port_status_write(EHCIState *s, int port, uint32_t val)
3f1f29
 
3f1f29
     if (!(val & PORTSC_PRESET) &&(*portsc & PORTSC_PRESET)) {
3f1f29
         trace_usb_ehci_port_reset(port, 0);
3f1f29
-        usb_attach(&s->ports[port], dev);
3f1f29
-
3f1f29
-        // TODO how to handle reset of ports with no device
3f1f29
         if (dev) {
3f1f29
+            usb_attach(&s->ports[port], dev);
3f1f29
             usb_send_msg(dev, USB_MSG_RESET);
3f1f29
-        }
3f1f29
-
3f1f29
-        if (s->ports[port].dev) {
3f1f29
             *portsc &= ~PORTSC_CSC;
3f1f29
         }
3f1f29
 
3f1f29
-- 
3f1f29
1.7.5.1
3f1f29