From: Felipe Balbi <balbi@kernel.org>
To: John Stultz <john.stultz@linaro.org>
Cc: Tejas Joglekar <tejas.joglekar@synopsys.com>,
Yang Fei <fei.yang@intel.com>,
Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>,
YongQin Liu <yongqin.liu@linaro.org>,
Andrzej Pietrasiewicz <andrzej.p@collabora.com>,
Thinh Nguyen <thinhn@synopsys.com>,
Linux USB List <linux-usb@vger.kernel.org>
Subject: Re: dwc3 inconsistent gadget connection state?
Date: Tue, 07 Jul 2020 13:43:44 +0300 [thread overview]
Message-ID: <874kqjr4f3.fsf@kernel.org> (raw)
In-Reply-To: <CALAqxLWMJikHCzxcna08UPFdf=frm5=2z3BB-FDrzy7MbrHF6g@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3157 bytes --]
Hi,
John Stultz <john.stultz@linaro.org> writes:
> On Sat, Jul 4, 2020 at 7:38 AM Felipe Balbi <balbi@kernel.org> wrote:
>> John Stultz <john.stultz@linaro.org> writes:
>> > On Fri, Jul 3, 2020 at 2:54 AM Felipe Balbi <balbi@kernel.org> wrote:
>> >> John Stultz <john.stultz@linaro.org> writes:
>> >> > I was curious if you or anyone else had any thoughts on how to debug
>> >> > this further?
>> >>
>> >> Try enabling dwc3 tracepoints and collecting working and failing
>> >> cases. If I were to guess, I would say there's a small race condition
>> >> between setting pullup and the transceiver sending the VBUS_VALID signal
>> >> to dwc3.
>> >
>> > Trace logs attached. Let me know if you have any further ideas!
>>
>> You can see from failure case that we never got a Reset event. This
>> happens, for instance, when dwc3 doesn't know that VBUS is above
>> VBUS_VALID threshold (4.4V). When the problem happens, I'm assuming USB
>> is completely dead, meaning that keeping the cable connected for longer
>> won't change anything, right?
>
> Correct. The only way to get it working is to unplug and replug the
> cable (sometimes more than once).
>
>> In that case, could you dump DWC3 registers (there's a debugfs interface
>> for that)? I'm mostly interested in the PHY registers, both USB2 and
>> USB3. Check if the PHYs are suspended in the error case.
>
> Here's a diff of the regdump in bad and good cases:
> --- regdump.bad 2020-07-07 03:44:46.799514793 +0000
> +++ regdump.good 2020-07-07 03:44:44.723534198 +0000
> @@ -162,29 +162,29 @@
> GEVNTSIZ(0) = 0x00001000
> GEVNTCOUNT(0) = 0x00000000
> GHWPARAMS8 = 0x00000fea
> -DCFG = 0x00120804
> -DCTL = 0x80f00000
> +DCFG = 0x0052082c
the only interesting thing here is DCFG. Can you decode it?
> +DCTL = 0x8cf00a00
IIRC, this is only telling you that your controller is in U0 or
something like that. Not interesting.
>> If they are, try enabling the quirk flags that disable suspend for the
>> PHYs (check binding documentation). If that helps, then discuss with
>> your Silicon Validation guys what are the requirements when it comes to
>> suspend. Some PHYs are inherently quirky and need some of the quirky
>> flags dwc3 provides.
>>
>> Note that disabling suspend completely is a pretty large hammer that
>> should only be used if nothing else helps. Some PHYs are happy with a
>> simple delay of U1/U2/U3 entry but, again, check with your Silicon
>> Validation folks, likely they have already gone through this during chip
>> characterization.
>
> Unfortunately I don't have any access to silicon validation folks.
no publicly available Errata List either? Do you know which PHY IP this
platform uses?
> There is already a number of the quirk bindings in use, but I'll
> tinker around with them a bit to see if it causes any behavior change.
Would be great to review those with people who were involved with the
actual Silicon development, but if you don't have access to them, the
discussion is moot :-s
> Thanks so much for the ideas and feedback! Much appreciated!
no worries ;-)
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
prev parent reply other threads:[~2020-07-07 10:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 21:44 dwc3 inconsistent gadget connection state? John Stultz
2020-07-03 2:55 ` Jun Li
2020-07-03 3:08 ` John Stultz
2020-07-03 7:46 ` Jun Li
2020-07-03 6:15 ` John Stultz
2020-07-03 7:57 ` Anurag Kumar Vulisha
2020-08-05 5:32 ` John Stultz
2020-07-03 9:54 ` Felipe Balbi
2020-07-04 5:51 ` John Stultz
2020-07-04 14:38 ` Felipe Balbi
2020-07-07 3:56 ` John Stultz
2020-07-07 10:43 ` 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=874kqjr4f3.fsf@kernel.org \
--to=balbi@kernel.org \
--cc=andrzej.p@collabora.com \
--cc=anurag.kumar.vulisha@xilinx.com \
--cc=fei.yang@intel.com \
--cc=john.stultz@linaro.org \
--cc=linux-usb@vger.kernel.org \
--cc=tejas.joglekar@synopsys.com \
--cc=thinhn@synopsys.com \
--cc=yongqin.liu@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).