From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v3] usb: dwc3: core: Fix RAM interface getting stuck during enumeration
Date: Tue, 3 Nov 2026 03:11:17 +0000 [thread overview]
Message-ID: <auksxKbHVZzUd4G5@vbox> (raw)
In-Reply-To: <138abb5c-b1cb-44e5-a103-dccb022f3102@oss.qualcomm.com>
Hi,
Sorry for the delay, I was out of office.
On Wed, Oct 28, 2026, Krishna Kurapati wrote:
>
> On 10/21/2026 7:31 AM, Thinh Nguyen wrote:
> >
> > I'd rather not take this without testing. The check adds a register read
> > to every endpoint command and implies that CSR timeout is expected
> > during command sending, which it shouldn't be. Without confirmation that
> > it catches the issue and that recovery works, that cost is not
> > justified.
> >
>
> I won't be able to test this in my environment. The only PIPO test that
> easily reproduced it easily was with one faulty cable from (IIRC Xiaomi) and
> CDP port of AMD based Lenovo laptop (there was a particular variant, I will
> find out). I don't have that faulty cable for now, but this issue was
> reported even on Kaanapali as well on 6.12 Kernel (mobile build). Not sure
> if I can provide this series along with err_recovery_work to OEM and get the
> results since this is reproducible with very difficulty on their end too.
>
> How about we add the Depcmd check and then the GSTS check inside it ? To
> avoid checking GSTS always.
Your report shows ENDXFER timing out with CMDACT still set, so the
DEPCMD read back may not show a mismatch, and GSTS would never be
checked. To avoid reading GSTS on every command, we could check it
only when the command times out instead.
I'm fine with this approach. Since it's hard to reproduce, please note
in the commit message that it's untested against the failure, and add
a dev_err when it triggers so we can confirm it when it does happen.
>
> > Also, looking at the original report again, the stuck state could start
> > without an endpoint command being issued. Unplugging the cable then gave
> > no disconnect event, which blocked suspend. A check only in
> > dwc3_send_gadget_ep_cmd() wouldn't catch that.
> >
>
> Currently on downstream, the way we work is that if we unplug the cable we
> expect the controller enter runtime suspend. If that doesn't happen and the
> controller is stuck, we do a "usb_gadget_disconnect(dwc->gadget)" and then
> upon re-connect we do a "usb_gadget_connect(dwc->gadget)". So, if upon any
> plug-in, if enumeration fails and if we encounter this scenario, we are not
> handling this until plug out is done.
>
How do you detect that it's stuck? Soft-connect already does a core soft
reset, so you could call usb_gadget_connect() right away instead of
waiting for re-connect.
Would be great if you have logs showing a consistent symptom (GSTS,
DSTS, DEPCMD read back) that we can check for.
BR,
Thinh
prev parent reply other threads:[~2026-11-03 3:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20260929051941epcas5p27a5c69151937b9105660941776cda819@epcas5p2.samsung.com>
2026-09-29 5:19 ` Krishna Kurapati
2026-09-29 6:45 ` Selvarasu Ganesan
2026-09-29 8:35 ` Krishna Kurapati
2026-09-29 11:02 ` Selvarasu Ganesan
2026-09-29 17:50 ` Krishna Kurapati
2026-10-13 8:40 ` Krishna Kurapati
2026-10-14 1:44 ` Thinh Nguyen
2026-10-14 10:58 ` Krishna Kurapati
2026-10-15 2:12 ` Thinh Nguyen
2026-10-15 3:18 ` Krishna Kurapati
2026-10-21 2:01 ` Thinh Nguyen
2026-10-28 17:17 ` Krishna Kurapati
2026-11-03 3:11 ` Thinh Nguyen [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=auksxKbHVZzUd4G5@vbox \
--to=thinh.nguyen@synopsys.com \
--cc=gregkh@linuxfoundation.org \
--cc=krishna.kurapati@oss.qualcomm.com \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®