Re: WARNING: at drivers/usb/host/ehci-hcd.c:287

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Brownell <david-b@...>, Christian Kujau <lists@...>
Cc: LKML <linux-kernel@...>, <0x0007@...>, USB list <linux-usb@...>
Date: Tuesday, March 4, 2008 - 12:29 pm

On Mon, 3 Mar 2008, Christian Kujau wrote:


Dave, it seems to me that this must be an example of a race between the 
iaa watchdog timer expiring and end_unlink_async() running.  It's not 
good enough for end_unlink_async() to call iaa_watchdog_done(), because 
on an SMP system the timer may already have fired and the watchdog 
routine may be spinning on ehci->lock.

It's even worse, because end_unlink_async() can call 
start_unlink_async().  If that happens, the watchdog routine will think 
the timer has expired when in fact it has just been restarted.

How about replacing the

	WARN_ON(!ehci->reclaim);

line in ehci_iaa_watchdog() with

	if (unlikely(!ehci->reclaim || 
			!HC_IS_RUNNING(ehci_to_hcd(ehci)->state) ||
			timer_pending(&ehci->iaa_watchdog))
		goto done;

where "done:" is added just before the spin_unlock_irqrestore?

Alan Stern

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
WARNING: at drivers/usb/host/ehci-hcd.c:287, Christian Kujau, (Sun Mar 2, 8:05 pm)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, Andrew Morton, (Tue Mar 4, 3:49 am)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, Christian Kujau, (Tue Mar 4, 4:01 am)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, Andrew Morton, (Tue Mar 4, 4:10 am)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, Christian Kujau, (Mon Mar 3, 6:38 pm)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, Alan Stern, (Tue Mar 4, 12:29 pm)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, David Brownell, (Tue Mar 4, 4:51 pm)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, Alan Stern, (Tue Mar 4, 4:57 pm)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, David Brownell, (Tue Mar 4, 6:01 pm)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, Christian Kujau, (Tue Mar 4, 7:15 pm)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, David Brownell, (Tue Mar 4, 8:30 pm)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, Christian Kujau, (Tue Mar 4, 9:15 pm)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, David Brownell, (Wed Mar 5, 12:25 am)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, Christian Kujau, (Wed Mar 5, 6:59 pm)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, Christian Kujau, (Fri Mar 7, 3:51 pm)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, Christian Kujau, (Tue Mar 4, 2:53 pm)
Re: WARNING: at drivers/usb/host/ehci-hcd.c:287, Alan Stern, (Tue Mar 4, 4:27 pm)