mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Ohci-hcd: fix endless loop (second take)
@ 2004-11-26 10:30 Colin Leroy
  2004-11-26 17:28 ` [linux-usb-devel] " David Brownell
  0 siblings, 1 reply; 11+ messages in thread
From: Colin Leroy @ 2004-11-26 10:30 UTC (permalink / raw)
  To: Linux-kernel; +Cc: Benjamin Herrenschmidt, Greg KH, Andrew Morton

Hi, 

Following patch fixes an endless loop that happens after having
slept and resumed my iBook with a linux-wlan-ng controller plugged in,
removed the stick and plugged it back (getting "IRQ lossage" message).

It supercedes the previous one where 
.I hadn't noticed limit was unsigned,
.Decrementing limit was twice too fast,
.the goto was a bit useless.

Signed-off-by: Colin Leroy <colin@colino.net>
--- a/drivers/usb/host/ohci-hcd.c	2004-11-26 11:28:21.284259057 +0100
+++ b/drivers/usb/host/ohci-hcd.c	2004-11-26 11:28:03.437351150 +0100
@@ -344,7 +344,7 @@
 	int			epnum = ep & USB_ENDPOINT_NUMBER_MASK;
 	unsigned long		flags;
 	struct ed		*ed;
-	unsigned		limit = 1000;
+	int			limit = 1000;
 
 	/* ASSERT:  any requests/urbs are being unlinked */
 	/* ASSERT:  nobody can be submitting urbs for this any more */
@@ -375,6 +375,11 @@
 		spin_unlock_irqrestore (&ohci->lock, flags);
 		set_current_state (TASK_UNINTERRUPTIBLE);
 		schedule_timeout (1);
+		if (limit < 1000) {
+			ohci_warn (ohci, "Can't recover, restarting.\n");
+			ohci_restart(ohci);
+			return;
+		}
 		goto rescan;
 	case ED_IDLE:		/* fully unlinked */
 		if (list_empty (&ed->td_list)) {

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-11-30  0:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-26 10:30 [PATCH] Ohci-hcd: fix endless loop (second take) Colin Leroy
2004-11-26 17:28 ` [linux-usb-devel] " David Brownell
2004-11-26 17:37   ` Colin Leroy
2004-11-26 17:57     ` David Brownell
2004-11-26 22:12       ` Benjamin Herrenschmidt
2004-11-29  8:04         ` Colin Leroy
2004-11-29 22:26           ` Benjamin Herrenschmidt
2004-11-29 22:34             ` Colin Leroy
2004-11-29 22:43               ` Benjamin Herrenschmidt
2004-11-30  0:41                 ` David Brownell
2004-11-26 18:46   ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome