(1) The locking in devices.c needs to be fixed. The USB subsystem rwsem should be held over a much larger part of the code. That should be pretty easy to do. I don't think it's necessary to use usb_get_dev or to lock usbdev->serialize, but someone should verify this.
Hmm, could you elaborate? The bus rwsem is only to protect against changes to driver bindings, and there's only one chunk of code that accesses those bindings (for a brief moment, already protected by that rwsem).
I did find a missing claim of dev->serialize though, in the usb_device_dump() routine ... at least, this was in one patch I sent ages ago, but nothing I recent. It'd protect against device reconfig/reset/disconnect. See the attached patch.
- Dave
--- 1.24/drivers/usb/core/devices.c Tue Mar 30 08:50:40 2004 +++ edited/drivers/usb/core/devices.c Fri Apr 2 14:58:47 2004 @@ -466,6 +466,7 @@ if (!(pages_start = (char*) __get_free_pages(GFP_KERNEL,1))) return -ENOMEM; + down(&usbdev->serialize); if (usbdev->parent && usbdev->parent->devnum != -1) parent_devnum = usbdev->parent->devnum; /* @@ -516,6 +517,7 @@ } data_end = usb_dump_desc(data_end, pages_start + (2 * PAGE_SIZE) - 256, usbdev); + up(&usbdev->serialize); if (data_end > (pages_start + (2 * PAGE_SIZE) - 256)) data_end += sprintf(data_end, "(truncated)\n");