On Mon, 2004-01-12 at 19:43, Alan Stern wrote: > On Mon, 12 Jan 2004, Axel Waggershauser wrote: > > ...so far so good... > > Not really... Your completion routine should get called as soon as the > "USB disconnect" message appears in the syslog. Below you said that's > what happens on your other system; the question is why doesn't it happen > here? Are you submitting this URB from within your probe() routine?
Yes, of course, I should get the completion handler called. Since I called the usb_unlink_urb synchronously, I should have expected it to be called before the unlink call returns, right? That recognized, I got the ingenious idea to check the return value of the unlink call... It returns -EBUSY (-16). So it looks to me like the controller driver sort of "got stuck" with this urb. Can I generally expect that the controller cancels the urb by itself when the device gets disconnected (like it does on the other machine)? What am i supposed to do if the usb_unlink_urb call returns -EBUSY? > > 7. I replug the device, the kernel panics immediately > > Do you know if the kernel detects the newly replugged device before > panicking? No I do not. Any suggestions how to find that out? > The way to do this is to have another computer handy, hook them together > by a null-modem serial cable, and then boot your test system telling it to > use the serial port as the console. Then use a communications program > like minicom on the other system to capture the log output and save it in > a file. I don't have such a cable at the moment so I try to get as far as I can without it. I had the idea of unloading the uhci-hcd module after I unplugged the device... attached is a syslog excerpt. Maybe you can extract some useful information. If I try to load the module again, modprobe segfaults. Any suggestions for the next step to do? Thanks, Axel.
Jan 12 22:42:17 koffer kernel: uhci_hcd 0000:00:07.2: remove, state 1 Jan 12 22:42:17 koffer kernel: usb usb1: USB disconnect, address 1 Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd62b000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd62c000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd62d000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd62e000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd62f000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd630000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd631000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd632000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd633000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd634000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd635000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd636000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd637000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd638000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd639000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd63a000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd63b000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd63c000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd63d000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd63e000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd63f000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd640000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd641000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd642000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd643000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd644000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd645000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd646000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd647000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd648000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd649000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd64a000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd64b000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd64c000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd64d000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd64e000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd64f000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd660000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd661000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd662000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd663000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd664000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd665000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd666000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd667000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd668000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd669000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd67f000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd700000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd701000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd702000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd703000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd712000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd713000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd714000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd715000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd716000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd717000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd718000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd719000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd71a000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, cd71b000 busy Jan 12 22:42:17 koffer kernel: pci_pool_destroy 0000:00:07.2/uhci_td, ce59a000 busy Jan 12 22:42:17 koffer kernel: uhci_hcd 0000:00:07.2: USB bus 1 deregistered Jan 12 22:42:17 koffer kernel: uhci_hcd 0000:00:07.3: remove, state 1 Jan 12 22:42:17 koffer kernel: usb usb2: USB disconnect, address 1 Jan 12 22:42:17 koffer kernel: usb 2-2: USB disconnect, address 2 Jan 12 22:42:17 koffer kernel: uhci_hcd 0000:00:07.3: USB bus 2 deregistered Jan 12 22:42:17 koffer kernel: slab error in kmem_cache_destroy(): cache `uhci_urb_priv': Can't free all objects Jan 12 22:42:17 koffer kernel: Call Trace: Jan 12 22:42:17 koffer kernel: [kmem_cache_destroy+137/272] kmem_cache_destroy+0x89/0x110 Jan 12 22:42:17 koffer kernel: [__crc_blk_queue_dma_alignment+1229756/2081198] uhci_hcd_cleanup+0x18/0x5d [uhci_hcd] Jan 12 22:42:17 koffer kernel: [sys_delete_module+290/416] sys_delete_module+0x122/0x1a0 Jan 12 22:42:17 koffer kernel: [do_munmap+227/272] do_munmap+0xe3/0x110 Jan 12 22:42:17 koffer kernel: [sys_munmap+66/96] sys_munmap+0x42/0x60 Jan 12 22:42:17 koffer kernel: [syscall_call+7/11] syscall_call+0x7/0xb Jan 12 22:42:17 koffer kernel: Jan 12 22:42:17 koffer kernel: uhci: not all urb_priv's were freed