summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLi Jun <jun.li@nxp.com>2019-03-06 16:15:01 +0800
committerLi Jun <jun.li@nxp.com>2019-03-08 13:40:34 +0800
commitae0cdc741f7313398539f7b576ced73871f6cd71 (patch)
tree08b4703f5f0398c4eb8bab24df1193f7e8c18b2f /drivers
parent7d111f4c8bac25c234b0fc24af885421ce8bb188 (diff)
MLK-21055 usb: dwc3: gadget: disable U1 and U2
Currenlty U1 and U2 low power modes are allowed in device mode. Allowing U1 and U2 low power modes during data transfers in device mode is causing U1 exit failure on some USB3 host: which will transite to SS.inactive instead of U0, then host will send warm reset and ultimately result in reenumeration. This is observed on UUU tool with some PC host. Hence disable U1 and U2 low power modes for now. USB3 spec 7.5.10.4.2 Exit from Recovery.Configuration The port shall transition to eSS.Inactive when the following conditions are met: 1. Either the Ux_EXIT_TIMER or the 6-ms timer (tRecoveryConfigurationTimeout) times out. 2. For a downstream port, the transition to Recovery is not to attempt a Hot Reset. Signed-off-by: Li Jun <jun.li@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/dwc3/ep0.c25
-rw-r--r--drivers/usb/dwc3/gadget.c5
2 files changed, 5 insertions, 25 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index e61d98046f..84548b89d1 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -391,7 +391,6 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
u32 recip;
u32 wValue;
u32 wIndex;
- u32 reg;
int ret;
enum usb_device_state state;
@@ -415,27 +414,12 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
return -EINVAL;
if (dwc->speed != DWC3_DSTS_SUPERSPEED)
return -EINVAL;
-
- reg = dwc3_readl(dwc->regs, DWC3_DCTL);
- if (set)
- reg |= DWC3_DCTL_INITU1ENA;
- else
- reg &= ~DWC3_DCTL_INITU1ENA;
- dwc3_writel(dwc->regs, DWC3_DCTL, reg);
break;
-
case USB_DEVICE_U2_ENABLE:
if (state != USB_STATE_CONFIGURED)
return -EINVAL;
if (dwc->speed != DWC3_DSTS_SUPERSPEED)
return -EINVAL;
-
- reg = dwc3_readl(dwc->regs, DWC3_DCTL);
- if (set)
- reg |= DWC3_DCTL_INITU2ENA;
- else
- reg &= ~DWC3_DCTL_INITU2ENA;
- dwc3_writel(dwc->regs, DWC3_DCTL, reg);
break;
case USB_DEVICE_LTM_ENABLE:
@@ -539,7 +523,6 @@ static int dwc3_ep0_set_config(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)
enum usb_device_state state = dwc->gadget.state;
u32 cfg;
int ret;
- u32 reg;
dwc->start_config_issued = false;
cfg = le16_to_cpu(ctrl->wValue);
@@ -563,14 +546,6 @@ static int dwc3_ep0_set_config(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)
usb_gadget_set_state(&dwc->gadget,
USB_STATE_CONFIGURED);
- /*
- * Enable transition to U1/U2 state when
- * nothing is pending from application.
- */
- reg = dwc3_readl(dwc->regs, DWC3_DCTL);
- reg |= (DWC3_DCTL_ACCEPTU1ENA | DWC3_DCTL_ACCEPTU2ENA);
- dwc3_writel(dwc->regs, DWC3_DCTL, reg);
-
dwc->resize_fifos = true;
dev_dbg(dwc->dev, "resize FIFOs flag SET");
}
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 2727126659..28c40d237d 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2563,6 +2563,7 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc)
int dwc3_gadget_init(struct dwc3 *dwc)
{
int ret;
+ u32 reg;
dwc->ctrl_req = dma_alloc_coherent(sizeof(*dwc->ctrl_req),
(unsigned long *)&dwc->ctrl_req_addr);
@@ -2621,6 +2622,10 @@ int dwc3_gadget_init(struct dwc3 *dwc)
goto err4;
}
+ reg = dwc3_readl(dwc->regs, DWC3_DCTL);
+ reg &= ~(DWC3_DCTL_INITU1ENA | DWC3_DCTL_INITU2ENA);
+ dwc3_writel(dwc->regs, DWC3_DCTL, reg);
+
return 0;
err4: