Hi guys! I think I might have hit a bug: * Description of the issue * Continuous (variable time 1-10 mins) small bulk transfers (between 1-6 bytes payload) either with libusb, or generic USB serial driver, leaves the app in uninterruptible wait state (i.e., hung). The kernel hung task stack dump consistently show the USB stack getting stuck: [ 3118.808597] INFO: task reprogJTAG:6993 blocked for more than 120 seconds. [ 3118.808603] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 3118.808606] reprogJTAG D ffff8800b026d260 0 6993 5917 0x00000000 [ 3118.808614] ffff88008ac69d88 0000000000000086 ffff880100000000 ffff88008ac69b88 [ 3118.808621] ffff88008ac68000 ffff8800b03cea40 ffff88008ac69fd8 0000000000011080 [ 3118.808628] 0000000000011080 0000000000004000 ffff88008ac69fd8 0000000000011080 [ 3118.808634] Call Trace: [ 3118.808648] [<ffffffff814d5904>] ? _raw_spin_lock_irqsave+0x18/0x37 [ 3118.808655] [<ffffffff814d562a>] ? _raw_spin_unlock_irqrestore+0x13/0x2e [ 3118.808661] [<ffffffff81345061>] ? ohci_urb_dequeue+0xdb/0xea [ 3118.808667] [<ffffffff81329b32>] ? unlink1+0xcd/0xe0 [ 3118.808672] [<ffffffff814d5904>] ? _raw_spin_lock_irqsave+0x18/0x37 [ 3118.808676] [<ffffffff814d562a>] ? _raw_spin_unlock_irqrestore+0x13/0x2e [ 3118.808681] [<ffffffff814d4bf6>] schedule+0x5f/0x61 [ 3118.808686] [<ffffffff8132b911>] usb_kill_urb+0xb1/0xd1 [ 3118.808692] [<ffffffff81046fee>] ? wake_up_bit+0x25/0x25 [ 3118.808696] [<ffffffff814d3adf>] ? mutex_lock+0x1f/0x40 [ 3118.808702] [<ffffffff8133515f>] usbdev_do_ioctl+0xbb5/0xf71 [ 3118.808707] [<ffffffff814d562a>] ? _raw_spin_unlock_irqrestore+0x13/0x2e [ 3118.808713] [<ffffffff8104a2bd>] ? __hrtimer_start_range_ns+0x2a4/0x2b6 [ 3118.808717] [<ffffffff814d5904>] ? _raw_spin_lock_irqsave+0x18/0x37 [ 3118.808722] [<ffffffff81335533>] usbdev_ioctl+0x9/0xd [ 3118.808727] [<ffffffff810e7e6d>] do_vfs_ioctl+0x4ed/0x52e [ 3118.808733] [<ffffffff8110e307>] ? sys_timerfd_settime+0x2f6/0x33f [ 3118.808737] [<ffffffff810e7ef0>] sys_ioctl+0x42/0x66 [ 3118.808743] [<ffffffff814d6266>] system_call_fastpath+0x1a/0x1f All the stacks are consistent of getting stuck in usb_kill_urb(). * Environment * This happens only in a OHCI-based system (AMD CPU, nVidia chipset), since if I test the same program and USB device in an Intel-based, EHCI laptop, I never hit this problem, and what's more interesting: the operations are about 5x faster in the EHCI system, even when my device is only 12Mbit-capable. I can reproduce this issue with a vanilla 3.5.0 kernel. The userspace program is a small libusb-based JTAG programmer I wrote and the USB device it talks to, is also designed, built, and firmware written by me, but the flawless work in the Intel system, rules out any issues on both the USB device and userspace program sides. Here is the lsusb output (running the 3.5.0 Gentoo kernel, not vanilla, but this version only has two minor patches, nothing USB-related, so can be regarded as a vanilla kernel for the practical purposes of this issue, my device is the 0x666:0x1 ): ----------------------------------------------------- Bus 003 Device 002: ID 04f9:0028 Brother Industries, Ltd Printer Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x04f9 Brother Industries, Ltd idProduct 0x0028 Printer bcdDevice 1.00 iManufacturer 1 iProduct 2 iSerial 3 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 32 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xc0 Self Powered MaxPower 2mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 7 Printer bInterfaceSubClass 1 Printer bInterfaceProtocol 2 Bidirectional iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0010 1x 16 bytes bInterval 0 Bus 004 Device 003: ID 0666:0001 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x0666 idProduct 0x0001 bcdDevice 1.50 iManufacturer 1 Tomas Sokorai iProduct 2 ECM Buddy iSerial 3 1 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 32 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 0 (Defined at Interface level) bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Device Status: 0x3390 (Bus Powered) Bus 004 Device 002: ID 045e:001e Microsoft Corp. IntelliMouse Explorer Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x045e Microsoft Corp. idProduct 0x001e IntelliMouse Explorer bcdDevice 1.07 iManufacturer 1 Microsoft iProduct 2 Microsoft IntelliMouse® Explorer iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 34 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xa0 (Bus Powered) Remote Wakeup MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 1 Boot Interface Subclass bInterfaceProtocol 2 Mouse iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.00 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 72 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0004 1x 4 bytes bInterval 10 Device Status: 0x0000 (Bus Powered) Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 9 Hub bDeviceSubClass 0 Unused bDeviceProtocol 0 Full speed (or root) hub bMaxPacketSize0 64 idVendor 0x1d6b Linux Foundation idProduct 0x0002 2.0 root hub bcdDevice 3.05 iManufacturer 3 Linux 3.5.0-gentoo ehci_hcd iProduct 2 EHCI Host Controller iSerial 1 0000:00:02.1 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 Unused bInterfaceProtocol 0 Full speed (or root) hub iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0004 1x 4 bytes bInterval 12 Hub Descriptor: bLength 9 bDescriptorType 41 nNbrPorts 6 wHubCharacteristic 0x000a No power switching (usb 1.0) Per-port overcurrent protection bPwrOn2PwrGood 10 * 2 milli seconds bHubContrCurrent 0 milli Ampere DeviceRemovable 0x00 PortPwrCtrlMask 0xff Hub Port Status: Port 1: 0000.0100 power Port 2: 0000.0100 power Port 3: 0000.0100 power Port 4: 0000.0100 power Port 5: 0000.0100 power Port 6: 0000.0100 power Device Status: 0x0001 Self Powered Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 9 Hub bDeviceSubClass 0 Unused bDeviceProtocol 0 Full speed (or root) hub bMaxPacketSize0 64 idVendor 0x1d6b Linux Foundation idProduct 0x0002 2.0 root hub bcdDevice 3.05 iManufacturer 3 Linux 3.5.0-gentoo ehci_hcd iProduct 2 EHCI Host Controller iSerial 1 0000:00:04.1 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 Unused bInterfaceProtocol 0 Full speed (or root) hub iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0004 1x 4 bytes bInterval 12 Hub Descriptor: bLength 9 bDescriptorType 41 nNbrPorts 6 wHubCharacteristic 0x000a No power switching (usb 1.0) Per-port overcurrent protection bPwrOn2PwrGood 10 * 2 milli seconds bHubContrCurrent 0 milli Ampere DeviceRemovable 0x00 PortPwrCtrlMask 0xff Hub Port Status: Port 1: 0000.0100 power Port 2: 0000.0100 power Port 3: 0000.0100 power Port 4: 0000.0100 power Port 5: 0000.0100 power Port 6: 0000.0100 power Device Status: 0x0001 Self Powered Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 9 Hub bDeviceSubClass 0 Unused bDeviceProtocol 0 Full speed (or root) hub bMaxPacketSize0 64 idVendor 0x1d6b Linux Foundation idProduct 0x0001 1.1 root hub bcdDevice 3.05 iManufacturer 3 Linux 3.5.0-gentoo ohci_hcd iProduct 2 OHCI Host Controller iSerial 1 0000:00:02.0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 Unused bInterfaceProtocol 0 Full speed (or root) hub iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0002 1x 2 bytes bInterval 255 Hub Descriptor: bLength 9 bDescriptorType 41 nNbrPorts 6 wHubCharacteristic 0x0012 No power switching (usb 1.0) No overcurrent protection bPwrOn2PwrGood 1 * 2 milli seconds bHubContrCurrent 0 milli Ampere DeviceRemovable 0x00 PortPwrCtrlMask 0xff Hub Port Status: Port 1: 0000.0100 power Port 2: 0000.0100 power Port 3: 0000.0103 power enable connect Port 4: 0000.0100 power Port 5: 0000.0100 power Port 6: 0000.0100 power Device Status: 0x0001 Self Powered Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 9 Hub bDeviceSubClass 0 Unused bDeviceProtocol 0 Full speed (or root) hub bMaxPacketSize0 64 idVendor 0x1d6b Linux Foundation idProduct 0x0001 1.1 root hub bcdDevice 3.05 iManufacturer 3 Linux 3.5.0-gentoo ohci_hcd iProduct 2 OHCI Host Controller iSerial 1 0000:00:04.0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 Unused bInterfaceProtocol 0 Full speed (or root) hub iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0002 1x 2 bytes bInterval 255 Hub Descriptor: bLength 9 bDescriptorType 41 nNbrPorts 6 wHubCharacteristic 0x0012 No power switching (usb 1.0) No overcurrent protection bPwrOn2PwrGood 1 * 2 milli seconds bHubContrCurrent 0 milli Ampere DeviceRemovable 0x00 PortPwrCtrlMask 0xff Hub Port Status: Port 1: 0000.0100 power Port 2: 0000.0103 power enable connect Port 3: 0000.0303 lowspeed power enable connect Port 4: 0000.0100 power Port 5: 0000.0100 power Port 6: 0000.0100 power Device Status: 0x0001 Self Powered ----------------------------------------------------- Any further ideas to shed more light into this issue? Thanks, -- Tomas J. Sokorai Sch. -- 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