[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-usb-devel
Subject:    [linux-usb-devel]  [PATCH] bug removing ehci-hcd
From:       <Stuart_Hayes () Dell ! com>
Date:       2007-05-31 15:26:10
Message-ID: DFEF91B22ED07447AB6AA4B237F913F9524D64 () ausx3mpc125 ! aus ! amer ! dell ! com
[Download RAW message or body]

I wasn't actually able to reproduce the bug myself, but I guess it is
pretty obvious that I shouldn't have called cpufreq_unregister_notifier
with a spinlock held.  I haven't been doing this long enough to know
exactly which kernel this patch should be against, so let me know if
this ins't good.  Thanks!


This patch (for the 2.6.21.3 kernel plus previously sent cpufreq
notifier patch) fixes a bug caused by calling
cpufreq_unregister_notifier (which can sleep) while holding a spinlock.

Signed-off-by: Stuart Hayes <stuart_hayes@dell.com>

["ehci_unregister_cpufreq_notifier.patch" (application/octet-stream)]

diff -purN linux-2.6.21.3_freqorig/drivers/usb/host/ehci-hcd.c \
                linux-2.6.21.3_freqbugfix/drivers/usb/host/ehci-hcd.c
--- linux-2.6.21.3_freqorig/drivers/usb/host/ehci-hcd.c	2007-05-29 16:05:20.000000000 \
                -0500
+++ linux-2.6.21.3_freqbugfix/drivers/usb/host/ehci-hcd.c	2007-05-29 \
15:40:41.000000000 -0500 @@ -449,14 +449,14 @@ static void ehci_stop (struct usb_hcd \
*h  /* no more interrupts ... */
 	del_timer_sync (&ehci->watchdog);
 
-	spin_lock_irq(&ehci->lock);
-	if (HC_IS_RUNNING (hcd->state))
-		ehci_quiesce (ehci);
-
 #ifdef CONFIG_CPU_FREQ
 	cpufreq_unregister_notifier(&ehci->cpufreq_transition,
 				    CPUFREQ_TRANSITION_NOTIFIER);
 #endif
+	spin_lock_irq(&ehci->lock);
+	if (HC_IS_RUNNING (hcd->state))
+		ehci_quiesce (ehci);
+
 	ehci_reset (ehci);
 	ehci_writel(ehci, 0, &ehci->regs->intr_enable);
 	spin_unlock_irq(&ehci->lock);



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic