diff mbox

[V2] Re-attach usb device to kernel while usb_host_open fails

Message ID 1435124411-11421-1-git-send-email-lma@suse.com
State New
Headers show

Commit Message

Lin Ma June 24, 2015, 5:40 a.m. UTC
Signed-off-by: Lin Ma <lma@suse.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
---
Changes in V2:
* For avoiding regression issue, Dont remove the usb device from global hostdevs list while
usb speed mismatch occurs.

* Add missing R-by information.

 hw/usb/host-libusb.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Gerd Hoffmann June 25, 2015, 6:29 a.m. UTC | #1
On Mi, 2015-06-24 at 13:40 +0800, Lin Ma wrote:
> Signed-off-by: Lin Ma <lma@suse.com>
> Reviewed-by: Gonglei <arei.gonglei@huawei.com>

Added to usb patch queue.

thanks,
  Gerd
diff mbox

Patch

diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index bc2944c..11429f5 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -889,6 +889,9 @@  static int usb_host_open(USBHostDevice *s, libusb_device *dev)
 fail:
     trace_usb_host_open_failure(bus_num, addr);
     if (s->dh != NULL) {
+        usb_host_release_interfaces(s);
+        libusb_reset_device(s->dh);
+        usb_host_attach_kernel(s);
         libusb_close(s->dh);
         s->dh = NULL;
         s->dev = NULL;