david-b@pacbell.net
[PATCH] USB: ehci requeue revisit
ChangeSet 1.2057, 2005/02/16 14:27:17-08:00, david-b@pacbell.net

[PATCH] USB: ehci requeue revisit

This gets rid of a bug found in some IRQ handling logic, after tripping
a debug assertion.  Basically, a recent patch called the wrong routine to
unlink a QH.  Net result, it wasn't allowing for the case that some other
QH was already being unlinked.  This patch uses the correct routine; the
names are confusingly similar, and the effect is often identical.

The consequence of using the wrong routine was that the driver could
lose one of the pending unlinks (probably wedging some activity) and
treat the other one as completed before it was safe to do so (which
probably wouldn't oops, but could cause other nasty corruption).

From: Brian Murphy <brian@murphy.dk>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


 drivers/usb/host/ehci-q.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


diff -Nru a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
--- a/drivers/usb/host/ehci-q.c	2005-02-16 14:47:29 -08:00
+++ b/drivers/usb/host/ehci-q.c	2005-02-16 14:47:29 -08:00
@@ -267,6 +267,7 @@
 }
 
 static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh);
+static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh);
 
 static void intr_deschedule (struct ehci_hcd *ehci, struct ehci_qh *qh);
 static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh);
@@ -430,7 +431,7 @@
 				intr_deschedule (ehci, qh);
 				(void) qh_schedule (ehci, qh);
 			} else
-				start_unlink_async (ehci, qh);
+				unlink_async (ehci, qh);
 			break;
 		/* otherwise, unlink already started */
 		}
