brcm2708: update against latest rpi-3.10.y branch
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0084-dwc_otg-make-channel-halts-with-unknown-state-less-d.patch
1 From e2c9f557c5bff8c839704d0627d5dd108a0e14f2 Mon Sep 17 00:00:00 2001
2 From: P33M <P33M@github.com>
3 Date: Tue, 23 Jul 2013 14:15:32 +0100
4 Subject: [PATCH 084/174] dwc_otg: make channel halts with unknown state less
5  damaging
6
7 If the IRQ received a channel halt interrupt through the FIQ
8 with no other bits set, the IRQ would not release the host
9 channel and never complete the URB.
10
11 Add catchall handling to treat as a transaction error and retry.
12 ---
13  drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 12 ++++++++++++
14  1 file changed, 12 insertions(+)
15
16 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
17 +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
18 @@ -2578,12 +2578,24 @@ static void handle_hc_chhltd_intr_dma(dw
19                                      DWC_READ_REG32(&hcd->
20                                                     core_if->core_global_regs->
21                                                     gintsts));
22 +                               /* Failthrough: use 3-strikes rule */
23 +                               qtd->error_count++;
24 +                               dwc_otg_hcd_save_data_toggle(hc, hc_regs, qtd);
25 +                               update_urb_state_xfer_intr(hc, hc_regs,
26 +                                          qtd->urb, qtd, DWC_OTG_HC_XFER_XACT_ERR);
27 +                               halt_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_XACT_ERR);
28                         }
29  
30                 }
31         } else {
32                 DWC_PRINTF("NYET/NAK/ACK/other in non-error case, 0x%08x\n",
33                            hcint.d32);
34 +               /* Failthrough: use 3-strikes rule */
35 +               qtd->error_count++;
36 +               dwc_otg_hcd_save_data_toggle(hc, hc_regs, qtd);
37 +               update_urb_state_xfer_intr(hc, hc_regs,
38 +                          qtd->urb, qtd, DWC_OTG_HC_XFER_XACT_ERR);
39 +               halt_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_XACT_ERR);
40         }
41  }
42