From: anis chali <chalianis1@gmail.com>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: BAREBOX <barebox@lists.infradead.org>,
"Claude Sonnet 4.6" <noreply@anthropic.com>
Subject: Re: [PATCH 1/2] usb: dwc2: handle NAK when CHHLTD does not fire
Date: Mon, 20 Apr 2026 11:40:01 -0400 [thread overview]
Message-ID: <CAL+1fyAnh3D1p=yj8+Fgj8CsjE6R0Jsfc5XbwyZYKhK797QQ8w@mail.gmail.com> (raw)
In-Reply-To: <22ce3b8d-b01f-4566-895d-c175c33a7e26@pengutronix.de>
Hi, Okay I will give it a try today and come back to you.
Anis C.
Le lun. 20 avr. 2026 à 10:11, Ahmad Fatoum <a.fatoum@pengutronix.de> a écrit :
>
> Hi,
>
> fixing the Cc.
>
> On 4/20/26 2:18 PM, Sascha Hauer wrote:
> > +Cc Chali Anis <chalianis1@gmail.com>
> >
> > On Mon, Apr 20, 2026 at 01:32:25PM +0200, Ahmad Fatoum wrote:
> >> Hello,
> >>
> >> On 4/20/26 1:20 PM, Sascha Hauer wrote:
> >>> From: Sascha Hauer <sascha@saschahauer.de>
> >>>
> >>> Some DWC2 configurations do not assert CHHLTD when a NAK is received;
> >>> the hardware keeps the channel active and only sets the NAK bit in HCINT.
> >>> wait_for_chhltd() polls for CHHLTD with a 10ms timeout; when CHHLTD never
> >>> fires the timeout expires and -ETIMEDOUT is returned without inspecting
> >>> HCINT. This causes the caller to treat the NAK as a hard error instead of
> >>> a retryable condition.
> >>>
> >>> The symptom is that devices which NAK bulk or control transfers during
> >>> initialisation (e.g. some Samsung USB-C flash drives that NAK while their
> >>> firmware starts up) fail immediately rather than being retried via the
> >>> 5-second NAK-retry loop in dwc2_submit_bulk_msg() or the do/while loops
> >>> in dwc2_submit_control_msg().
> >>>
> >>> Fix by reading HCINT before aborting the channel when the CHHLTD timeout
> >>> fires. If the NAK or FRMOVRUN bit is set, abort the channel, wait for the
> >>> abort to complete, and return -EAGAIN so that the existing retry logic can
> >>> handle the NAK. Log a diagnostic message if the channel abort itself times
> >>> out, which would indicate a real hardware problem.
> >>
> >> How does this relate to
> >> https://lore.barebox.org/barebox/20260331034819.227094-1-chalianis1@gmail.com/
> >>
> >> Do we need both? Only this one? Is there something over there, which you
> >> would want in your series?
> >
> > Sounds related, but seems to be a different issue. It says "handle the case where
> > DMA has already completed by the time we get here". DMA is not an issue
> > in my case. We likely need a combination of both, but Chali, could you
> > give my patch without yours a try to see if it changes something for
> > good in your case?
> >
> > Sascha
> >
>
> --
> Pengutronix e.K. | |
> Steuerwalder Str. 21 | http://www.pengutronix.de/ |
> 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
>
next prev parent reply other threads:[~2026-04-20 15:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 11:20 [PATCH 0/2] USB: dwc2: Fix handling NAK Sascha Hauer
2026-04-20 11:20 ` [PATCH 1/2] usb: dwc2: handle NAK when CHHLTD does not fire Sascha Hauer
2026-04-20 11:32 ` Ahmad Fatoum
2026-04-20 12:18 ` Sascha Hauer
2026-04-20 14:11 ` Ahmad Fatoum
2026-04-20 15:40 ` anis chali [this message]
2026-04-21 2:28 ` anis chali
2026-04-21 7:54 ` Sascha Hauer
2026-04-21 13:48 ` anis chali
2026-04-20 11:20 ` [PATCH 2/2] usb: dwc2: fix data toggle reset direction on ClearFeature(ENDPOINT_HALT) Sascha Hauer
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='CAL+1fyAnh3D1p=yj8+Fgj8CsjE6R0Jsfc5XbwyZYKhK797QQ8w@mail.gmail.com' \
--to=chalianis1@gmail.com \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=noreply@anthropic.com \
/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