brcm2708: update 3.10 patches with raspberrypi/rpi-3.10.y of 27 Apr. 2014
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0054-dwc_otg-add-handling-of-SPLIT-transaction-data-toggl.patch
1 From 70303c1e07d940f6f0b2b8b9359930be1c0f566e 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/196] 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 diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
17 index 0c81a64..16e8c6c 100644
18 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
19 +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
20 @@ -1921,13 +1921,20 @@ static int32_t handle_hc_datatglerr_intr(dwc_otg_hcd_t * hcd,
21                                          dwc_otg_qtd_t * qtd)
22  {
23         DWC_DEBUGPL(DBG_HCDI, "--Host Channel %d Interrupt: "
24 -                   "Data Toggle Error--\n", hc->hc_num);
25 +               "Data Toggle Error on %s transfer--\n",
26 +               hc->hc_num, (hc->ep_is_in ? "IN" : "OUT"));
27  
28 -       if (hc->ep_is_in) {
29 +       /* Data toggles on split transactions cause the hc to halt.
30 +        * restart transfer */
31 +       if(hc->qh->do_split)
32 +       {
33 +               qtd->error_count++;
34 +               dwc_otg_hcd_save_data_toggle(hc, hc_regs, qtd);
35 +               update_urb_state_xfer_intr(hc, hc_regs,
36 +                       qtd->urb, qtd, DWC_OTG_HC_XFER_XACT_ERR);
37 +               halt_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_XACT_ERR);
38 +       } else if (hc->ep_is_in) {
39                 qtd->error_count = 0;
40 -       } else {
41 -               DWC_ERROR("Data Toggle Error on OUT transfer,"
42 -                         "channel %d\n", hc->hc_num);
43         }
44  
45         disable_hc_int(hc_regs, datatglerr);
46 @@ -2080,6 +2087,8 @@ static void handle_hc_chhltd_intr_dma(dwc_otg_hcd_t * hcd,
47                 handle_hc_babble_intr(hcd, hc, hc_regs, qtd);
48         } else if (hcint.b.frmovrun) {
49                 handle_hc_frmovrun_intr(hcd, hc, hc_regs, qtd);
50 +       } else if (hcint.b.datatglerr) {
51 +               handle_hc_datatglerr_intr(hcd, hc, hc_regs, qtd);
52         } else if (!out_nak_enh) {
53                 if (hcint.b.nyet) {
54                         /*
55 -- 
56 1.9.1
57