summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>2019-08-29 18:00:16 -0700
committerFelipe Balbi <felipe.balbi@linux.intel.com>2019-08-30 09:14:33 +0300
commit17b63704ec7cd4a37c513d964bc09c7e3fde8988 (patch)
treec9b806ebc18e75670962b557572abec800280d3c /drivers/usb/dwc3
parent6bbf87a131edd39040974f3843ff97e89310ebde (diff)
downloadlinux-17b63704ec7cd4a37c513d964bc09c7e3fde8988.tar.gz
linux-17b63704ec7cd4a37c513d964bc09c7e3fde8988.tar.bz2
linux-17b63704ec7cd4a37c513d964bc09c7e3fde8988.zip
usb: dwc3: gadget: Workaround Mirosoft's BESL check
While testing our host system using Microsoft's usb stack against our gadget for various BESL values, we found an issue with their usb stack when the recommended baseline BESL value is 0 (125us) or when the deep BESL is 1 or less. The Windows host will issue a usb reset immediately after it receives the extended BOS descriptor and the enumeration will fail after a few attempts. To keep compatibility with Microsoft's host usb stack, let's workaround this issue by using the recommended baseline BESL of 1 (or 150us) and clamp the deep BESL value within 2 to 15. This was tested against Windows 10 build 18956. Signed-off-by: Thinh Nguyen <thinhn@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/gadget.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 7b58e0e1e438..8adb59f8e4f1 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2083,9 +2083,19 @@ static void dwc3_gadget_config_params(struct usb_gadget *g,
/* Recommended BESL */
if (!dwc->dis_enblslpm_quirk) {
- params->besl_baseline = 0;
+ /*
+ * If the recommended BESL baseline is 0 or if the BESL deep is
+ * less than 2, Microsoft's Windows 10 host usb stack will issue
+ * a usb reset immediately after it receives the extended BOS
+ * descriptor and the enumeration will fail. To maintain
+ * compatibility with the Windows' usb stack, let's set the
+ * recommended BESL baseline to 1 and clamp the BESL deep to be
+ * within 2 to 15.
+ */
+ params->besl_baseline = 1;
if (dwc->is_utmi_l1_suspend)
- params->besl_deep = min_t(u8, dwc->hird_threshold, 15);
+ params->besl_deep =
+ clamp_t(u8, dwc->hird_threshold, 2, 15);
}
/* U1 Device exit Latency */