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: Thursday, June 26, 2008 - 6:07 pm

Hi,

ext Alan Stern wrote:

No.


Yes, the initial try was misleading. I tinkered around a little bit more 
and finally figured out that it is usb_hcd_unlink_urb_from_ep() itself 
that is called with interrupts enabled!


So with this code in place the error disappears:

void usb_hcd_unlink_urb_from_ep(struct usb_hcd *hcd, struct urb *urb)
{
	/* clear all state linking urb to this dev (and hcd) */
	unsigned int flags;
	spin_lock_irqsave(&hcd_urb_list_lock, flags);
	list_del_init(&urb->urb_list);
	spin_unlock_irqrestore(&hcd_urb_list_lock, flags);
}

This seems to impact USB performance though. In 2.6.23 (without the 
problem) I get 21MB/s with dd, but with the above "fix" only 14MB/s. But 
  I'll recheck once we have a real error fix in place.


After that I added the following code

         if (!raw_irqs_disabled()) {
	  printk(KERN_CRIT "usb_hcd_unlink_urb_from_ep called with interrupts 
enabled!\n");
	  dump_stack();
	}

and collected the attached kernel messages. I checked the messages 
briefly and it seems that the following code paths have the interrupts 
enabled when calling usb_hcd_unlink_urb_from_ep():

   [<c0574d9d>] usb_hcd_unlink_urb_from_ep+0x25/0x6b
   [<de850559>] uhci_giveback_urb+0xcd/0x1e3 [uhci_hcd]
   [<de850e02>] uhci_scan_schedule+0x511/0x720 [uhci_hcd]
...
   [<de8529c3>] uhci_irq+0x131/0x142 [uhci_hcd]
   [<c05750cb>] usb_hcd_irq+0x23/0x51

and

   [<c0574d9d>] usb_hcd_unlink_urb_from_ep+0x25/0x6b
   [<de839d55>] ehci_urb_done+0x73/0x92 [ehci_hcd]
   [<de83a92f>] qh_completions+0x373/0x3eb [ehci_hcd]
   [<de83aa43>] ehci_work+0x9c/0x6a9 [ehci_hcd]
...
   [<de83ec3c>] ehci_irq+0x241/0x265 [ehci_hcd]
...
   [<c05750cb>] usb_hcd_irq+0x23/0x51


Is that enough information to fix the problem?

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, (Thu Jun 26, 6:07 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)