[PATCH] bug removing ehci-hcd

<[email protected]>
Newsgroups gmane.linux.usb.devel,gmane.linux.kernel
Message-ID <DFEF91B22ED07447AB6AA4B237F913F9524D64@ausx3mpc125.aus.amer.dell.com>
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 <[email protected]>

-------------------------------------------------------------------------
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/

_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
ehci_unregister_cpufreq_notifier.patch (application/octet-stream, 846 B)
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);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.