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