From: Felipe Balbi <balbi@kernel.org>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org
Cc: John Youn <John.Youn@synopsys.com>,
Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Subject: Re: [PATCH] usb: dwc3: gadget: Workaround Mirosoft's BESL check
Date: Thu, 29 Aug 2019 07:28:38 +0300 [thread overview]
Message-ID: <871rx43895.fsf@gmail.com> (raw)
In-Reply-To: <02f8890eb7c60fa229ba599bf914936fe1491693.1567047731.git.thinhn@synopsys.com>
Hi,
Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes:
> 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>
> ---
> drivers/usb/dwc3/gadget.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 7b58e0e1e438..9ef2259829ba 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -2083,9 +2083,10 @@ static void dwc3_gadget_config_params(struct usb_gadget *g,
>
> /* Recommended BESL */
> if (!dwc->dis_enblslpm_quirk) {
let's add a comment here similar to what's in commit log so folks won't
go about changing this willy-nilly.
> - params->besl_baseline = 0;
> + 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 */
> --
> 2.11.0
>
--
balbi
prev parent reply other threads:[~2019-08-29 4:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-29 3:11 [PATCH] usb: dwc3: gadget: Workaround Mirosoft's BESL check Thinh Nguyen
2019-08-29 4:28 ` Felipe Balbi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871rx43895.fsf@gmail.com \
--to=balbi@kernel.org \
--cc=John.Youn@synopsys.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.