On Wed, 29 Jun 2005, Matthias Urlichs wrote: > Hi, > > I hate deadlocks.
Does anybody actually like them? :-) > khubd is here: > Call Trace: > [<c028d0de>] wait_for_completion+0x6e/0xb0 > [<e0609ff9>] usb_start_wait_urb+0x89/0xe0 [usbcore] > [<e060a0a4>] usb_internal_control_msg+0x54/0x70 [usbcore] > [<e060a133>] usb_control_msg+0x73/0x90 [usbcore] > [<e0606e21>] hub_port_init+0x391/0x530 [usbcore] > [<e06072d0>] hub_port_connect_change+0x130/0x3a0 [usbcore] > [<e06077bb>] hub_events+0x27b/0x3a0 [usbcore] > [<e0607915>] hub_thread+0x35/0xe0 [usbcore] > [<c0100ca5>] kernel_thread_helper+0x5/0x10 > > That won't timeout because of broken OPTi chip issues, so I try > pulling the plug. However, cardctl ends up sitting here: > > Call Trace: [<c028c95b>] > __down+0x7b/0xd0 > [<c028caba>] __down_failed+0xa/0x10 > [<e0604fc0>] .text.lock.usb+0x16/0xc6 [usbcore] > [<e060631b>] usb_disconnect+0x10b/0x120 [usbcore] > [<e0609965>] usb_remove_hcd+0x55/0x90 [usbcore] > [<e060d60c>] usb_hcd_pci_remove+0x1c/0x90 [usbcore] > [<c01b9ab3>] pci_device_remove+0x33/0x40 > [<c01f2e43>] device_release_driver+0x63/0x70 > [<c01f3089>] bus_remove_device+0x69/0xb0 > [<c01f1f54>] device_del+0x54/0x90 > [<c01f1f9d>] device_unregister+0xd/0x20 > [<c01b773c>] pci_destroy_dev+0x1c/0x70 > [...] > > because hub_events() has locked the hub for the duration. > > I assume that the same thing can happen if you either call cardctl or > physically pull the card at exactly the wrong moment. > > Any ideas on how to fix that? Temporarily unlock the hub while sending > the message, and check whether it's still up afterwards? I'm afraid there's no way around it. Timeouts _have_ to work; pretty much every device driver depends on them crucially. The best way to fix this is to take care of those broken OPTi chip issues you mentioned. Other things can be done, however. For instance, it might be a good idea to have the usb_remove_hcd routine unlink _all_ the pending URBs before calling usb_disconnect. But if the timeout were working this wouldn't be necessary. Alan Stern ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
