On Tuesday 04 January 2005 4:31 am, Pedro Venda wrote:
> David Brownell wrote:
> | On Monday 03 January 2005 5:05 pm, you wrote:
> |
> |>David Brownell wrote:
> |>| It's something wierd that started a while back, and so far
> |>| it doesn't make sense to me.  But see below, and please
> |>| try the patch I've attached.  If it fails, please send
> |>| the full CONFIG_USB_DEBUG output showing the error (as
> |>| below) and contents of /sys/class/usb_host/usb4/registers
> |>| after the fault.
> |>
> |>I've tried the patch and it failed.

OK, try this slightly modified version.  Looks like
the Intel chip sets the HALT bit then spontaneously
clears it, while the ALI may never set it.

- Dave

Experimental patch, to try

 - catching some "fatal error" IRQs that seem to be bogus
   (HC didn't actually halt, contrary to spec),
   
 - reporting some controllers as "no power switching", since
   those "fatal errors" seem coupled to overcurrent reports
   on at least the first root hub port.


--- 1.94/drivers/usb/host/ehci-hcd.c	Tue Nov 23 00:39:00 2004
+++ edited/drivers/usb/host/ehci-hcd.c	Tue Jan  4 11:15:55 2005
@@ -864,13 +864,23 @@
 
 	/* PCI errors [4.15.2.4] */
 	if (unlikely ((status & STS_FATAL) != 0)) {
-		ehci_err (ehci, "fatal error\n");
-dead:
-		ehci_reset (ehci);
-		/* generic layer kills/unlinks all urbs, then
-		 * uses ehci_stop to clean up the rest
+		/* bogus "fatal" IRQs appear on at least ALI and Intel
+		 * chips; unclear why.
 		 */
-		bh = 1;
+		status = readl (&ehci->regs->status);
+		dbg_cmd (ehci, "fatal", readl (&ehci->regs->command));
+		dbg_status (ehci, "fatal", status);
+		ehci_err (ehci, "%sfatal error\n",
+				(status & STS_HALT) ? "" : "BOGUS ");
+
+		if (status & STS_HALT) {
+dead:
+			ehci_reset (ehci);
+			/* generic layer kills/unlinks all urbs, then
+			 * uses ehci_stop to clean up the rest
+			 */
+			bh = 1;
+		}
 	}
 
 	if (bh)
--- 1.31/drivers/usb/host/ehci-hub.c	Mon Dec 20 03:48:01 2004
+++ edited/drivers/usb/host/ehci-hub.c	Mon Jan  3 12:10:06 2005
@@ -281,6 +281,8 @@
 	temp = 0x0008;			/* per-port overcurrent reporting */
 	if (HCS_PPC (ehci->hcs_params))
 		temp |= 0x0001;		/* per-port power control */
+	else
+		temp |= 0x0002;		/* no power switching */
 #if 0
 // re-enable when we support USB_PORT_FEAT_INDICATOR below.
 	if (HCS_INDICATOR (ehci->hcs_params))

Reply via email to