From: Stefan Becker <Stefan.Becker@nokia.com>
To: ext Alan Stern <stern@rowland.harvard.edu>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [REGRESSION] 2.6.24/25: random lockups when accessing external USB harddrive
Date: Tue, 24 Jun 2008 21:41:51 +0300 [thread overview]
Message-ID: <48613FEF.8020004@nokia.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0806231403350.2556-100000@iolanthe.rowland.org>
Hi,
ext Alan Stern wrote:
>
>>> Can you add debugging
>>> printk statements to the USB bluetooth driver to try and localize where
>>> the hang occurs?
>> Any suggestions where to start?
>
> Around every place where the driver calls into the core. You might
> also want to debug the places where uhci-hcd acquires and releases
> spinlocks.
I sprinkled some printk's into hci_usb.c. But I see only messages at the
start of bluetooth daemon.
>>>>> git bisect resulted in the following bad commit:
>>>>>
>>>>> e9df41c5c5899259541dc928872cad4d07b82076 is first bad commit
>>>>> commit e9df41c5c5899259541dc928872cad4d07b82076
>>>>> Author: Alan Stern <stern@rowland.harvard.edu>
>>>>> Date: Wed Aug 8 11:48:02 2007 -0400
>>>>>
>>>>> USB: make HCDs responsible for managing endpoint queues
>>> Knowing this doesn't help much without more information.
>
>> That commit has spinlock changes so I hoped that it would be a good
>> starting point. Is there a way to track the locks?
>
> Only what I suggested: Print something in the log whenever a lock is
> acquired or released.
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
next prev parent reply other threads:[~2008-06-24 18:49 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-22 16:55 [REGRESSION] 2.6.24/25: random lockups when accessing external USB harddrive Stefan Becker
2008-06-22 17:42 ` Rene Herman
2008-06-22 19:31 ` Alan Stern
2008-06-23 15:52 ` Stefan Becker
2008-06-23 18:10 ` Alan Stern
2008-06-24 18:41 ` Stefan Becker [this message]
2008-06-24 21:15 ` Alan Stern
2008-06-25 15:52 ` Stefan Becker
2008-06-25 18:38 ` Alan Stern
2008-06-26 6:31 ` Stefan Becker
2008-06-26 14:25 ` Alan Stern
2008-06-26 22:07 ` Stefan Becker
2008-06-27 16:07 ` David Brownell
2008-06-28 14:31 ` Stefan Becker
2008-06-27 16:10 ` Alan Stern
2008-06-28 14:36 ` Stefan Becker
2008-06-28 15:39 ` Stefan Becker
2008-06-28 16:53 ` Alan Stern
2008-06-28 19:34 ` BUG in 2.6.26-rc8 interrupt handling Becker Stefan (Nokia-D/Salo)
2008-06-28 19:51 ` David Brownell
2008-06-29 14:57 ` PATCH: 2.6.26-rc8: Fix IRQF_DISABLED for shared interrupts Stefan Becker
2008-06-30 3:09 ` David Brownell
2008-06-30 5:22 ` Stefan Becker
2008-06-30 14:28 ` Henrique de Moraes Holschuh
2008-06-30 14:26 ` Alan Cox
2008-06-30 9:34 ` Stefan Becker
2008-06-30 11:15 ` David Brownell
2008-06-30 14:37 ` Alan Stern
2008-06-30 18:53 ` [PATCH] USB: fix interrupt disabling for HCDs with shared interrupt handlers Stefan Becker
2008-06-30 19:35 ` Alan Stern
2008-06-30 20:31 ` David Brownell
2008-06-30 21:26 ` Stefan Becker
2008-07-01 14:11 ` Alan Stern
2008-07-01 14:19 ` Leonardo Chiquitto
2008-07-01 16:19 ` Stefan Becker
2008-07-01 18:25 ` Greg KH
2008-07-01 18:59 ` Alan Stern
2008-07-01 19:13 ` Greg KH
2008-07-01 19:21 ` David Brownell
2008-07-01 19:15 ` Stefan Becker
2008-07-01 19:51 ` Greg KH
2008-07-01 16:22 ` David Brownell
2008-06-30 21:29 ` Alan Stern
2008-06-30 21:48 ` David Brownell
2008-06-30 19:57 ` PATCH: 2.6.26-rc8: Fix IRQF_DISABLED for shared interrupts David Brownell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48613FEF.8020004@nokia.com \
--to=stefan.becker@nokia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox