Module Name:    src
Committed By:   skrll
Date:           Sat Jul 26 09:18:53 UTC 2014

Modified Files:
        src/sys/external/bsd/dwc2/dist: dwc2_hcdintr.c

Log Message:
Recover from channel halt errors by using the 3 strikes xacterr rule.

Adapted from the RaspberryPI linux driver.

This allows the rum(4) I was sent to be somewhat usable. Need to
investigate further what is causing the problem in the first place.

Might help PR/49019 (RPI: interrupt storm when url0 is up)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c
diff -u src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c:1.8 src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c:1.9
--- src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c:1.8	Thu Apr  3 06:34:58 2014
+++ src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c	Sat Jul 26 09:18:53 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_hcdintr.c,v 1.8 2014/04/03 06:34:58 skrll Exp $	*/
+/*	$NetBSD: dwc2_hcdintr.c,v 1.9 2014/07/26 09:18:53 skrll Exp $	*/
 
 /*
  * hcd_intr.c - DesignWare HS OTG Controller host-mode interrupt handling
@@ -40,7 +40,7 @@
  * This file contains the interrupt handlers for Host mode
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc2_hcdintr.c,v 1.8 2014/04/03 06:34:58 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_hcdintr.c,v 1.9 2014/07/26 09:18:53 skrll Exp $");
 
 #include <sys/types.h>
 #include <sys/pool.h>
@@ -1891,12 +1891,20 @@ static void dwc2_hc_chhltd_intr_dma(stru
 					"hcint 0x%08x, intsts 0x%08x\n",
 					chan->hcint,
 					DWC2_READ_4(hsotg, GINTSTS));
+				goto error;
 			}
 		}
 	} else {
 		dev_info(hsotg->dev,
 			 "NYET/NAK/ACK/other in non-error case, 0x%08x\n",
 			 chan->hcint);
+error:
+		/* use the 3-strikes rule */
+		qtd->error_count++;
+		dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb,
+					    qtd, DWC2_HC_XFER_XACT_ERR);
+		dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
+		dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_XACT_ERR);
 	}
 }
 

Reply via email to