On Tue, 25 Jul 2006, Matthias Urlichs wrote:

> This is the perennial "we have an OHCI interface on a PCMCIA card. We
> pull the card. The kernel crashes / hangs / whatever" problem.
> 
> [ INFO: inconsistent lock state ] -- details below.

This is interesting because the "inconsistent lock state" message involves 
the UHCI controller as well as the OHCI controller.  And ironically, the 
error has nothing to do with the fact that a PCMCIA card was ejected.  
It could have happened any time a USB controller was turned off.

Does the following patch help?

Alan Stern



Index: usb-2.6/drivers/usb/core/hcd.c
===================================================================
--- usb-2.6.orig/drivers/usb/core/hcd.c
+++ usb-2.6/drivers/usb/core/hcd.c
@@ -1371,14 +1371,13 @@ hcd_endpoint_disable (struct usb_device 
        WARN_ON (!HC_IS_RUNNING (hcd->state) && hcd->state != HC_STATE_HALT &&
                        udev->state != USB_STATE_NOTATTACHED);
 
-       local_irq_disable ();
-
        /* FIXME move most of this into message.c as part of its
         * endpoint disable logic
         */
 
        /* ep is already gone from udev->ep_{in,out}[]; no more submits */
 rescan:
+       local_irq_disable ();
        spin_lock (&hcd_data_lock);
        list_for_each_entry (urb, &ep->urb_list, urb_list) {
                int     tmp;
@@ -1399,6 +1398,7 @@ rescan:
                if (tmp == -EINPROGRESS)
                        urb->status = -ESHUTDOWN;
                spin_unlock (&urb->lock);
+               local_irq_enable ();
 
                /* kick hcd unless it's already returning this */
                if (tmp == -EINPROGRESS) {


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to