Skip to contentSkip to conversation

Re-attach usb device to kernel while usb_host_open fails

PATCH In review Lin Ma 2 participants 2 messages Jun 24, 2015 – Jun 25, 2015

lore
Share & tools
lore

Lin Ma

author
#0 lore raw

PATCH v2 1/1 Re-attach usb device to kernel while usb_host_open fails

---
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(+)
hw/usb/host-libusb.c +3 -0
index bc2944c..11429f5 100644
@@ -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;
Signature · 1 line
2.1.4