Dear all, I am currently doing some tests to communicate with an USB HID device by means of the HIDAPI and libusb libraries on a Linux x64 distribution. One of these tests consists basically of successive enumeration cycles: - opening the hid device - exchanging some data between the host and the device - at some point, closing the communication with the hid device - wait a few second and reiterate the above steps This test runs correctly a few times and then suddenly crashes. Apparently, this crash happens in a random way. The strange point is that after this crash, the file system in RAM is "corrupted": some folders like ‘etc’ have disappeared and I have to reboot the kernel. The crash has been seen on 2 different machines: - on x64 Ubuntu 2.6.35 based kernel (Ubuntu 10.10) - on x64 Angström 2.6.39 based kernel (the log given below have been obtained on this machine). On this last machine, the crash happens only on the 2nd usb bus. When the test usb device is connected to the 1st bus usb, I have not seen any problem up to now. When looking to the dmesg output, the crash seems to be caused by the kworker process. The crash log starts with a crash of the ehci driver (see below for a complete dmesg log): ehci_hcd 0000:00:13.2: force halt; handshake ffffc90000070024 00004000 00000000 -> -110 ehci_hcd 0000:00:13.2: HC died; cleaning up usb 2-4: usbfs: usb_submit_urb returned -110 usb 2-3: USB disconnect, device number 2 In the past days, I have been looking for a possible bug in my test application or in the HIDAPI / libusb libraries (cf. http://libusb.6.n5.nabble.com/Application-using-HIDAPI-and-libusb-causes-file-system-corruption-td5508578.html) but I am now wondering if this could be related to a known issue in the kernel. Has someone already seen a similar issue with any application? Could a bug in an userspace application cause this kernel crash? I thank you in advance for any help or tips. Best regards Adrien Full dmesg output obtained after the crash: driver: '2-4:1.0': driver_bound: bound to device 'usbfs' driver: '2-4:1.0': driver_bound: bound to device 'usbfs' driver: '2-4:1.0': driver_bound: bound to device 'usbfs' driver: '2-4:1.0': driver_bound: bound to device 'usbfs' driver: '2-4:1.0': driver_bound: bound to device 'usbfs' driver: '2-4:1.0': driver_bound: bound to device 'usbfs' driver: '2-4:1.0': driver_bound: bound to device 'usbfs' driver: '2-4:1.0': driver_bound: bound to device 'usbfs' driver: '2-4:1.0': driver_bound: bound to device 'usbfs' driver: '2-4:1.0': driver_bound: bound to device 'usbfs' ehci_hcd 0000:00:13.2: force halt; handshake ffffc90000070024 00004000 00000000 -> -110 ehci_hcd 0000:00:13.2: HC died; cleaning up usb 2-4: usbfs: usb_submit_urb returned -110 usb 2-3: USB disconnect, device number 2 device: 'ep_01': device_unregister device: 'ep_82': device_unregister device: 'ep_83': device_unregister device: '6:0:0:0': device_unregister device: '6:0:0:0': device_create_release device: '6:0:0:0': device_unregister device: 'sg0': device_unregister device: 'sg0': device_create_release sd 6:0:0:0: [sda] Unhandled error code sd 6:0:0:0: [sda] Result: hostbyte=0x01 driverbyte=0x00 sd 6:0:0:0: [sda] CDB: cdb[0]=0x2a: 2a 00 00 36 09 ec 00 00 0c 00 end_request: I/O error, dev sda, sector 3541484 Aborting journal on device sda3. JBD: I/O error detected when updating journal superblock for sda3. __journal_remove_journal_head: freeing b_committed_data journal commit I/O error EXT3-fs (sda3): error: ext3_journal_start_sb: Detected aborted journal EXT3-fs (sda3): error: remounting filesystem read-only device: '8:0': device_unregister device: '8:0': device_create_release device: 'host6': device_unregister device: 'ep_00': device_unregister device: 'usbdev2.2': device_unregister device: 'usbdev2.2': device_create_release usb 2-4: USB disconnect, device number 3 device: 'ep_81': device_unregister device: 'ep_02': device_unregister device: 'ep_00': device_unregister device: 'usbdev2.3': device_unregister device: 'usbdev2.3': device_create_release irq 17: nobody cared (try booting with the "irqpoll" option) Pid: 0, comm: kworker/0:0 Tainted: P 2.6.39.2 #1 Call Trace: <IRQ> [<ffffffff8106e575>] __report_bad_irq+0x35/0xc0 [<ffffffff8106e9a4>] note_interrupt+0x194/0x1d0 [<ffffffff8106cc9c>] handle_irq_event_percpu+0x8c/0x160 [<ffffffff8106cda5>] handle_irq_event+0x35/0x60 [<ffffffff8106f121>] handle_fasteoi_irq+0x51/0xd0 [<ffffffff81003cdd>] handle_irq+0x1d/0x30 [<ffffffff81003958>] do_IRQ+0x58/0xe0 [<ffffffff813b3193>] common_interrupt+0x13/0x13 <EOI> [<ffffffff811c7ac4>] ? acpi_idle_enter_simple+0xde/0x10f [<ffffffff811c7abf>] ? acpi_idle_enter_simple+0xd9/0x10f [<ffffffff81294ff2>] cpuidle_idle_call+0x82/0xf0 [<ffffffff8100088a>] cpu_idle+0x4a/0x70 [<ffffffff813ace58>] start_secondary+0x19d/0x1a1 handlers: [<ffffffff8125e130>] (usb_hcd_irq+0x0/0x60) [<ffffffff8125e130>] (usb_hcd_irq+0x0/0x60) [<ffffffff8125e130>] (usb_hcd_irq+0x0/0x60) Disabling IRQ #17 EXT3-fs error (device sda3): ext3_find_entry: reading directory #2 offset 0 EXT3-fs error (device sda1): ext3_find_entry: reading directory #57415 offset 0 EXT3-fs error (device sda1): ext3_find_entry: reading directory #57415 offset 0 Here is the lspci output: root@x86:/usr/sbin# lspci -v 00:12.0 Class 0c03: Device 1002:4397 (prog-if 10) Subsystem: Device 1734:11be Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 18 Memory at feb4e000 (32-bit, non-prefetchable) [size=4K] Kernel driver in use: ohci_hcd 00:12.2 Class 0c03: Device 1002:4396 (prog-if 20) Subsystem: Device 1734:11be Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 17 Memory at feb4d000 (32-bit, non-prefetchable) [size=256] Capabilities: [c0] Power Management version 2 Capabilities: [e4] Debug port: BAR=1 offset=00e0 Kernel driver in use: ehci_hcd 00:13.0 Class 0c03: Device 1002:4397 (prog-if 10) Subsystem: Device 1734:11be Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 18 Memory at feb4c000 (32-bit, non-prefetchable) [size=4K] Kernel driver in use: ohci_hcd 00:13.2 Class 0c03: Device 1002:4396 (prog-if 20) Subsystem: Device 1734:11be Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 17 Memory at feb4b000 (32-bit, non-prefetchable) [size=256] Capabilities: [c0] Power Management version 2 Capabilities: [e4] Debug port: BAR=1 offset=00e0 Kernel driver in use: ehci_hcd 00:14.5 Class 0c03: Device 1002:4399 (prog-if 10) Subsystem: Device 1734:11be Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 18 Memory at feb4a000 (32-bit, non-prefetchable) [size=4K] Kernel driver in use: ohci_hcd 00:15.0 Class 0604: Device 1002:43a0 Flags: bus master, fast devsel, latency 0 Bus: primary=00, secondary=04, subordinate=04, sec-latency=0 Memory behind bridge: fea00000-feafffff Capabilities: [50] Power Management version 3 Capabilities: [58] Express Root Port (Slot-), MSI 00 Capabilities: [a0] MSI: Mask- 64bit+ Count=1/1 Enable- Capabilities: [b0] Subsystem: Device 1002:0000 Capabilities: [b8] HyperTransport: MSI Mapping Enable+ Fixed+ Capabilities: [100] Vendor Specific Information <?> Kernel driver in use: pcieport 00:16.0 Class 0c03: Device 1002:4397 (prog-if 10) Subsystem: Device 1734:11be Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 18 Memory at feb49000 (32-bit, non-prefetchable) [size=4K] Kernel driver in use: ohci_hcd 00:16.2 Class 0c03: Device 1002:4396 (prog-if 20) Subsystem: Device 1734:11be Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 17 Memory at feb48000 (32-bit, non-prefetchable) [size=256] Capabilities: [c0] Power Management version 2 Capabilities: [e4] Debug port: BAR=1 offset=00e0 Kernel driver in use: ehci_hcd -- 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