[PATCH] fix cpufreq notifier counting issue

<[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <DFEF91B22ED07447AB6AA4B237F913F9B18ED9@ausx3mpc125.aus.amer.dell.com>
This patch fixes a potential problem with the CPU frequency change
notification code in the EHCI driver.  The code counts the number of
"pre change" and "post change" notifications, and will only take action
on the first "pre change" and the last "post change" notification.  In
the unlikely event that the notifier is registered during a frequency
change, so that the code never gets the pre change notification that
corresponds to a post change notification that it gets, the counter will
be out of sync and the code will not take action at the correct time.

This patch will re-sync the counter if this happens.

This patch is against the 2.6.23-rc3 kernel, plus the patch submitted
and accepted on 8/1 to fix a bug with nVidia controllers
(http://www.mail-archive.com/[email protected]/msg56
523.html), plus the patch I sent a few minutes ago to fix a problem with
VIA EHCI controllers and the cpufreq notifier.

Signed-off-by: Stuart Hayes <[email protected]>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
ehci_cpufreq_count.patch (application/octet-stream, 649 B)
diff -purN linux-2.6.23-rc3plus_x/drivers/usb/host/ehci-hcd.c linux-2.6.23-rc3plus_y/drivers/usb/host/ehci-hcd.c
--- linux-2.6.23-rc3plus_x/drivers/usb/host/ehci-hcd.c	2007-08-16 15:37:57.000000000 -0500
+++ linux-2.6.23-rc3plus_y/drivers/usb/host/ehci-hcd.c	2007-08-16 15:04:09.000000000 -0500
@@ -299,8 +299,9 @@ static void ehci_cpufreq_unpause (struct
 	unsigned long	flags;
 
 	spin_lock_irqsave(&ehci->lock, flags);
-	if (!--ehci->cpufreq_changing)
-		qh_reactivate_split_intr_qhs(ehci);
+	if (ehci->cpufreq_changing)
+		if (!--ehci->cpufreq_changing)
+			qh_reactivate_split_intr_qhs(ehci);
 	spin_unlock_irqrestore(&ehci->lock, flags);
 }
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.