On Wed, 11 Mar 2009, Leonid wrote: > Hi all, > > There seems to have been a bug introduced in the recent > kernels relating to usbdevfs syscalls. > > My application is constantly submitting and reaping URBs > using the USBDEVFS ioctls. In recent kernels, if I > disconnect the device while the application is in the > USBDEVFS_REAPURB ioctl call, ioctl never returns, causing > the application to freeze. At this point, dmesg shows the > kernel has detected the disconnect. If I then background > the application and return it to the foreground, the ioctl > returns with errno = EINTR and subsequent calls to ioctl > properly return with errno = ENODEV. > > Since the libusb library uses the USBDEVFS_REAPURB ioctl call > inside the usb_bulk_read and usb_bulk_write functions, this > particular issue should be of general interest as well. > I am able to reproduce this behavior on kernels 2.6.23.1, > 2.6.26.8, and 2.6.28.5. > > If I disconnect the device when running kernel 2.6.20, the > USBDEVFS_REAPURB ioctl never gets stuck in the manner > described above. Unfortunately, due to a lack of time, I am > unable to determine the first kernel version that introduces > this bug. > > I was wondering if any one is aware of the bug, or has any > idea why this is happening in the newer kernels? A patch to fix this problem is here: http://marc.info/?l=linux-usb&m=123662065119759&w=2 Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html