PERFORCE change 160413 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Thu Apr 9 13:04:42 PDT 2009
http://perforce.freebsd.org/chv.cgi?CH=160413
Change 160413 by hselasky at hselasky_laptop001 on 2009/04/09 20:04:12
USB core + USB controller:
Use direct reference to parent high-speed HUB instead of
indirect, due to pointer clearing race at detach of parent
USB HUB.
Reported by: Tim Kientzle <kientzle at freesd.org>
PR: usb/133545
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/controller/ehci.c#14 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_device.c#23 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_device.h#15 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_hub.c#12 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/controller/ehci.c#14 (text+ko) ====
@@ -3652,8 +3652,8 @@
if ((udev->speed != USB_SPEED_HIGH) &&
((udev->hs_hub_addr == 0) ||
(udev->hs_port_no == 0) ||
- (udev->bus->devices[udev->hs_hub_addr] == NULL) ||
- (udev->bus->devices[udev->hs_hub_addr]->hub == NULL))) {
+ (udev->parent_hs_hub == NULL) ||
+ (udev->parent_hs_hub->hub == NULL))) {
/* We need a transaction translator */
goto done;
}
==== //depot/projects/usb/src/sys/dev/usb/usb_device.c#23 (text+ko) ====
@@ -1492,6 +1492,7 @@
while (hub) {
if (hub->speed == USB_SPEED_HIGH) {
udev->hs_hub_addr = hub->address;
+ udev->parent_hs_hub = hub;
udev->hs_port_no = adev->port_no;
break;
}
==== //depot/projects/usb/src/sys/dev/usb/usb_device.h#15 (text+ko) ====
@@ -123,6 +123,7 @@
struct usb2_bus *bus; /* our USB BUS */
device_t parent_dev; /* parent device */
struct usb2_device *parent_hub;
+ struct usb2_device *parent_hs_hub; /* high-speed parent HUB */
struct usb2_config_descriptor *cdesc; /* full config descr */
struct usb2_hub *hub; /* only if this is a hub */
#if USB_HAVE_COMPAT_LINUX
==== //depot/projects/usb/src/sys/dev/usb/usb_hub.c#12 (text+ko) ====
@@ -1117,7 +1117,7 @@
* access.
*/
- hub = bus->devices[udev->hs_hub_addr]->hub;
+ hub = udev->parent_hs_hub->hub;
if (slot >= USB_HS_MICRO_FRAMES_MAX) {
slot = usb2_intr_find_best_slot(hub->uframe_usage,
USB_FS_ISOC_UFRAME_MAX, 6);
@@ -1232,7 +1232,7 @@
isoc_time = usb2_isoc_time_expand(udev->bus, isoc_time);
- hs_hub = udev->bus->devices[udev->hs_hub_addr]->hub;
+ hs_hub = udev->parent_hs_hub->hub;
if (hs_hub != NULL) {
More information about the p4-projects
mailing list