diff options
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 14 |
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 */ |