[patch 2.6.23-rc3 3/4] EHCI cpufreq, handle broken notifications

David Brownell <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
From: Stuart Hayes <[email protected]>

This patch fixes a potential problem with the CPU frequency change
notification code in the EHCI driver.  The code counts the number of
change notifications, incrementing on PRECHANGE and decrementing on
POSTCHANGE events.

The problem is in the unlikely event that the notifier is registered
during a frequency change, and never gets the PRECHANGE notification.
The fix is to ignore unmatched POSTCHANGE events.

Signed-off-by: Stuart Hayes <[email protected]>
Signed-off-by: David Brownell <[email protected]>
---
 drivers/usb/host/ehci-hcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- g26.orig/drivers/usb/host/ehci-hcd.c	2007-08-17 22:45:28.000000000 -0700
+++ g26/drivers/usb/host/ehci-hcd.c	2007-08-17 22:54:23.000000000 -0700
@@ -299,7 +299,7 @@ static void ehci_cpufreq_unpause (struct
 	unsigned long	flags;
 
 	spin_lock_irqsave(&ehci->lock, flags);
-	if (!--ehci->cpufreq_changing)
+	if (ehci->cpufreq_changing && !--ehci->cpufreq_changing)
 		qh_reactivate_split_intr_qhs(ehci);
 	spin_unlock_irqrestore(&ehci->lock, flags);
 }

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