brcm2708: update against latest rpi-3.10.y branch
[openwrt/svn-archive/archive.git] / target / linux / brcm2708 / patches-3.10 / 0095-dwc_otg-Don-t-issue-traffic-to-LS-devices-in-FS-mode.patch
1 From 0dd387f3d3d1184fe45b57afbe73796e2ebe8d39 Mon Sep 17 00:00:00 2001
2 From: P33M <P33M@github.com>
3 Date: Fri, 27 Sep 2013 14:42:24 +0100
4 Subject: [PATCH 095/174] dwc_otg: Don't issue traffic to LS devices in FS mode
5
6 Issuing low-speed packets when the root port is in full-speed mode
7 causes the root port to stop responding. Explicitly fail when
8 enqueuing URBs to a LS endpoint on a FS bus.
9 ---
10 drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 11 +++++++++++
11 1 file changed, 11 insertions(+)
12
13 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
14 +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
15 @@ -501,6 +501,7 @@ int dwc_otg_hcd_urb_enqueue(dwc_otg_hcd_
16 dwc_otg_transaction_type_e tr_type;
17 dwc_otg_qtd_t *qtd;
18 gintmsk_data_t intr_mask = {.d32 = 0 };
19 + hprt0_data_t hprt0 = { .d32 = 0 };
20
21 #ifdef DEBUG /* integrity checks (Broadcom) */
22 if (NULL == hcd->core_if) {
23 @@ -515,6 +516,16 @@ int dwc_otg_hcd_urb_enqueue(dwc_otg_hcd_
24 return -DWC_E_NO_DEVICE;
25 }
26
27 + /* Some core configurations cannot support LS traffic on a FS root port */
28 + if ((hcd->fops->speed(hcd, dwc_otg_urb->priv) == USB_SPEED_LOW) &&
29 + (hcd->core_if->hwcfg2.b.fs_phy_type == 1) &&
30 + (hcd->core_if->hwcfg2.b.hs_phy_type == 1)) {
31 + hprt0.d32 = DWC_READ_REG32(hcd->core_if->host_if->hprt0);
32 + if (hprt0.b.prtspd == DWC_HPRT0_PRTSPD_FULL_SPEED) {
33 + return -DWC_E_NO_DEVICE;
34 + }
35 + }
36 +
37 qtd = dwc_otg_hcd_qtd_create(dwc_otg_urb, atomic_alloc);
38 if (qtd == NULL) {
39 DWC_ERROR("DWC OTG HCD URB Enqueue failed creating QTD\n");