brcm2708: update against latest rpi-3.10.y branch
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0054-dwc_otg-add-handling-of-SPLIT-transaction-data-toggl.patch
1 From f90755cd13b722cd3ea79bee92c29d2828b3905f Mon Sep 17 00:00:00 2001
2 From: P33M <P33M@github.com>
3 Date: Sun, 3 Mar 2013 14:45:53 +0000
4 Subject: [PATCH 054/174] dwc_otg: add handling of SPLIT transaction data
5  toggle errors
6
7 Previously a data toggle error on packets from a USB1.1 device behind
8 a TT would result in the Pi locking up as the driver never handled
9 the associated interrupt. Patch adds basic retry mechanism and
10 interrupt acknowledgement to cater for either a chance toggle error or
11 for devices that have a broken initial toggle state (FT8U232/FT232BM).
12 ---
13  drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 19 ++++++++++++++-----
14  1 file changed, 14 insertions(+), 5 deletions(-)
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 @@ -1921,13 +1921,20 @@ static int32_t handle_hc_datatglerr_intr
19                                          dwc_otg_qtd_t * qtd)
20  {
21         DWC_DEBUGPL(DBG_HCDI, "--Host Channel %d Interrupt: "
22 -                   "Data Toggle Error--\n", hc->hc_num);
23 +               "Data Toggle Error on %s transfer--\n",
24 +               hc->hc_num, (hc->ep_is_in ? "IN" : "OUT"));
25  
26 -       if (hc->ep_is_in) {
27 +       /* Data toggles on split transactions cause the hc to halt.
28 +        * restart transfer */
29 +       if(hc->qh->do_split)
30 +       {
31 +               qtd->error_count++;
32 +               dwc_otg_hcd_save_data_toggle(hc, hc_regs, qtd);
33 +               update_urb_state_xfer_intr(hc, hc_regs,
34 +                       qtd->urb, qtd, DWC_OTG_HC_XFER_XACT_ERR);
35 +               halt_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_XACT_ERR);
36 +       } else if (hc->ep_is_in) {
37                 qtd->error_count = 0;
38 -       } else {
39 -               DWC_ERROR("Data Toggle Error on OUT transfer,"
40 -                         "channel %d\n", hc->hc_num);
41         }
42  
43         disable_hc_int(hc_regs, datatglerr);
44 @@ -2080,6 +2087,8 @@ static void handle_hc_chhltd_intr_dma(dw
45                 handle_hc_babble_intr(hcd, hc, hc_regs, qtd);
46         } else if (hcint.b.frmovrun) {
47                 handle_hc_frmovrun_intr(hcd, hc, hc_regs, qtd);
48 +       } else if (hcint.b.datatglerr) {
49 +               handle_hc_datatglerr_intr(hcd, hc, hc_regs, qtd);
50         } else if (!out_nak_enh) {
51                 if (hcint.b.nyet) {
52                         /*