Re: [REGRESSION] 2.6.24/25: random lockups when accessing external USB harddrive

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: ext Alan Stern <stern@...>, <linux-kernel@...>, <linux-usb@...>
Date: Tuesday, June 24, 2008 - 2:41 pm

Hi,

ext Alan Stern wrote:

I sprinkled some printk's into hci_usb.c. But I see only messages at the 
start of bluetooth daemon.


I played around with printk a little bit more. With the following change 
to uhci_giveback_urb():

--- a/drivers/usb/host/uhci-q.c
+++ b/drivers/usb/host/uhci-q.c
@@ -1526,11 +1530,17 @@ __acquires(uhci->lock)
         }

         uhci_free_urb_priv(uhci, urbp);
+       printk(KERN_CRIT "UHCI UNLINK ENTER %08x %08x\n",
+              (unsigned int) uhci, (unsigned int) urb);
         usb_hcd_unlink_urb_from_ep(uhci_to_hcd(uhci), urb);
+       printk(KERN_CRIT "UHCI UNLINK LEAVE %08x %08x\n",
+              (unsigned int) uhci, (unsigned int) urb);

         spin_unlock(&uhci->lock);

I see

  UHCI UNLINK ENTER xxxxxxxx yyyyyyyy
  UHCI UNLINK LEAVE xxxxxxxx yyyyyyyy
  UHCI UNLINK ENTER xxxxxxxx yyyyyyyy

on the console at the time of the lockup. Then I added the following change:

--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1107,7 +1107,13 @@ EXPORT_SYMBOL_GPL(usb_hcd_check_unlink_urb);
  void usb_hcd_unlink_urb_from_ep(struct usb_hcd *hcd, struct urb *urb)
  {
         /* clear all state linking urb to this dev (and hcd) */
+#if 0
         spin_lock(&hcd_urb_list_lock);
+#else
+       if (!spin_trylock(&hcd_urb_list_lock)) {
+         printk(KERN_CRIT "HCD URB LIST ALREADY LOCKED!\n");
+       }
+#endif
         list_del_init(&urb->urb_list);
         spin_unlock(&hcd_urb_list_lock);
  }

and get this at the time of the lockup:

  UHCI UNLINK ENTER xxxxxxxx yyyyyyyy
  UHCI UNLINK LEAVE xxxxxxxx yyyyyyyy
  UHCI UNLINK ENTER xxxxxxxx yyyyyyyy
  HCD URB LIST ALREADY LOCKED!
             <---- here the original code would lockup
  UHCI UNLINK LEAVE xxxxxxxx yyyyyyyy
  HCD URB LIST ALREADY LOCKED!
  HCD URB LIST ALREADY LOCKED!
  HCD URB LIST ALREADY LOCKED!

So the lockup is caused by an already locked hcd_urb_list_lock. Is there 
a way to see the lock holder? Or any other suggestions how to proceed?

Regards,

	Stefan

---
Stefan Becker
E-Mail: Stefan.Becker@nokia.com
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [REGRESSION] 2.6.24/25: random lockups when accessing ex..., Stefan Becker, (Tue Jun 24, 2:41 pm)
BUG in 2.6.26-rc8 interrupt handling, Becker Stefan (Nokia-D/Salo)..., (Sat Jun 28, 3:34 pm)
Re: BUG in 2.6.26-rc8 interrupt handling, David Brownell, (Sat Jun 28, 3:51 pm)
PATCH: 2.6.26-rc8: Fix IRQF_DISABLED for shared interrupts, Stefan Becker, (Sun Jun 29, 10:57 am)
Re: [PATCH] USB: fix interrupt disabling for HCDs with share..., Leonardo Chiquitto, (Tue Jul 1, 10:19 am)
Re: PATCH: 2.6.26-rc8: Fix IRQF_DISABLED for shared interrupts, Henrique de Moraes Holschuh..., (Mon Jun 30, 10:28 am)