summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller/usb_controller.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-09-28 07:01:54 +0000
committerthompsa <thompsa@FreeBSD.org>2009-09-28 07:01:54 +0000
commitd0aa741310827933f03f54a327c7943ac8bab8e1 (patch)
tree37f27b26a180d3ca763d43c1482ba0f009e8cf51 /sys/dev/usb/controller/usb_controller.c
parentd2f83e3acde61a67c746b7a212a0ee867691028d (diff)
downloadFreeBSD-src-d0aa741310827933f03f54a327c7943ac8bab8e1.zip
FreeBSD-src-d0aa741310827933f03f54a327c7943ac8bab8e1.tar.gz
MFp4 @ 168387
- clean up USB detach logic. There seems to be some problems detaching multiple USB HUBs connected in series from the root. - after this patch the rule is: 1) Always use device_detach() on the USB HUB first. 2) Never just device_delete_child() on the USB HUB, because that function will traverse to all the device leaves and free them first, and then the USB stack will free the devices twice which doesn't work very well. - make sure the did DMA delay gets set after the timeout has elapsed to make logic more clear. There is no functional difference. Submitted by: Hans Petter Selasky
Diffstat (limited to 'sys/dev/usb/controller/usb_controller.c')
-rw-r--r--sys/dev/usb/controller/usb_controller.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/usb/controller/usb_controller.c b/sys/dev/usb/controller/usb_controller.c
index a925444..fe59e06 100644
--- a/sys/dev/usb/controller/usb_controller.c
+++ b/sys/dev/usb/controller/usb_controller.c
@@ -270,11 +270,9 @@ usb_bus_detach(struct usb_proc_msg *pm)
mtx_unlock(&Giant);
/*
- * Free USB Root device, but not any sub-devices, hence they
- * are freed by the caller of this function:
+ * Free USB device and all subdevices, if any.
*/
- usb_free_device(udev,
- USB_UNCFG_FLAG_FREE_EP0);
+ usb_free_device(udev, 0);
USB_BUS_LOCK(bus);
/* clear bdev variable last */
OpenPOWER on IntegriCloud