commit d9a3da4df19d5d627f6d713b5a5b580f0a2e4ada
Author: P33M <P33M@github.com>
Date:   Thu May 15 14:56:56 2014 +0100

    fiq_fsm: Handle HC babble errors
    
    The HCTSIZ transfer size field raises a babble interrupt if
    the counter wraps. Handle the resulting interrupt in this case.

diff --git a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c
index e8ea868..7aad7f7 100644
--- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c
+++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c
@@ -773,7 +773,7 @@ static int notrace noinline fiq_fsm_do_hcintr(struct fiq_state *state, int num_c
 				handled = 1;
 				restart = 1;
 			}
-		} else if (hcint.b.stall) {
+		} else if (hcint.b.stall || hcint.b.bblerr) {
 			/* A STALL implies either a LS bus error or a genuine STALL. */
 			st->fsm = FIQ_NP_SPLIT_LS_ABORTED;
 		} else {
@@ -925,7 +925,7 @@ static int notrace noinline fiq_fsm_do_hcintr(struct fiq_state *state, int num_c
 		} else if (hcint.b.nyet) {
 			/* Doh. Data lost. */
 			st->fsm = FIQ_PER_SPLIT_NYET_ABORTED;
-		} else if (hcint.b.xacterr || hcint.b.stall) {
+		} else if (hcint.b.xacterr || hcint.b.stall || hcint.b.bblerr) {
 			st->fsm = FIQ_PER_SPLIT_LS_ABORTED;
 		} else {
 			st->fsm = FIQ_PER_SPLIT_HS_ABORTED;
@@ -962,12 +962,11 @@ static int notrace noinline fiq_fsm_do_hcintr(struct fiq_state *state, int num_c
 		} else if (hcint.b.nyet) {
 			st->fsm = FIQ_PER_SPLIT_NYET_ABORTED;
 			start_next_periodic = 1;
-		} else if (hcint.b.xacterr) {
+		} else if (hcint.b.xacterr || hcint.b.stall || hcint.b.bblerr) {
 			/* Local 3-strikes retry is handled by the core. This is a ERR response.*/
 			st->fsm = FIQ_PER_SPLIT_LS_ABORTED;
 		} else {
-			fiq_print(FIQDBG_INT, state, "TOGGLES");
-			BUG();
+			st->fsm = FIQ_PER_SPLIT_HS_ABORTED;
 		}
 		break;
 	
@@ -1006,12 +1005,9 @@ static int notrace noinline fiq_fsm_do_hcintr(struct fiq_state *state, int num_c
 					st->fsm = FIQ_PER_SPLIT_DONE;
 				}
 			}
-		} else if (hcint.b.xacterr || hcint.b.stall) {
+		} else if (hcint.b.xacterr || hcint.b.stall || hcint.b.bblerr) {
 			/* For xacterr, Local 3-strikes retry is handled by the core. This is a ERR response.*/
 			st->fsm = FIQ_PER_SPLIT_LS_ABORTED;
-		} else if (hcint.b.datatglerr) {
-			fiq_print(FIQDBG_INT, state, "TOGGLES");
-			BUG();
 		} else {
 			st->fsm = FIQ_PER_SPLIT_HS_ABORTED;
 		}
diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
index be8ef1b..f9acef2 100644
--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
@@ -2386,6 +2386,8 @@ int32_t dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num)
 			handle_hc_stall_intr(hcd, hc, hc_regs, qtd);
 		} else if (hcint.b.datatglerr) {
 			handle_hc_datatglerr_intr(hcd, hc, hc_regs, qtd);
+		} else if (hcint.b.bblerr) {
+			handle_hc_babble_intr(hcd, hc, hc_regs, qtd);
 		} else if (hcint.b.ahberr) {
 			handle_hc_ahberr_intr(hcd, hc, hc_regs, qtd);
 		} else {
@@ -2522,6 +2524,8 @@ int32_t dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num)
 			handle_hc_xacterr_intr(hcd, hc, hc_regs, qtd);
 		} else if (hcint.b.stall) {
 			handle_hc_stall_intr(hcd, hc, hc_regs, qtd);
+		} else if (hcint.b.bblerr) {
+			handle_hc_babble_intr(hcd, hc, hc_regs, qtd);
 		} else {
 			printk_ratelimited(KERN_INFO "Transfer to device %d endpoint 0x%x failed "
 				"- FIQ reported FSM=%d. Data may have been lost.\n",
