From: sashiko-bot@kernel.org
To: "Vadim Yuzifovich" <vadim@yuzi.co>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v2 2/3] usb: dwc2: gadget: restart descriptor DMA bulk and interrupt endpoints after BNA
Date: Mon, 16 Nov 2026 07:13:24 +0000 [thread overview]
Message-ID: <sashiko-outbox-216395@kernel.org> (raw)
In-Reply-To: <20261116070433.2813951-3-vadim@yuzi.co>
> In descriptor DMA mode the core raises BNA and disables an endpoint when
> the descriptor it fetches is not marked host ready. For isochronous
> endpoints dwc2 handles that; for bulk and interrupt endpoints it only
> logs the interrupt at debug level. Nothing was transferred and no
> XferCompl follows, so the request stays current, the requests queued
> behind it never start, and the function driver waits for a completion
> that never comes.
>
> On a Sophgo SG2002 (DWC_otg 4.20a) with a video pipeline loading the
> DRAM this happened every minute or two to the bulk IN endpoint of
> f_mass_storage: debugfs showed the endpoint disabled with an 18-byte
> REQUEST SENSE reply current and nothing done, the 13-byte CSW queued
> behind it, and f_mass_storage asleep waiting for its buffer. The host's
> command timed out after 30 s and it reset the port. Read in the BNA
> handler, the descriptor is 0x0e000012: host ready, last, short,
> interrupt on completion, 18 bytes. The chain is written completely
> before the endpoint is enabled, so the core fetched the descriptor
> before the CPU's stores to it reached memory. The next patch closes
> that window on this SoC, but a BNA on such an endpoint should not leave
> it dead on any platform.
>
> When a bulk or interrupt endpoint other than EP0 raises BNA, is disabled
> and not halted, start its current request again, which fills the
> descriptor anew. Start it from what has been transferred of it, the way
> the next part of a request longer than one chain is started, so that a
> BNA on a later part does not send or fill the start of the buffer
> again. Report the BNA with a rate limited warning instead of
> at debug level: unlike on an isochronous endpoint it is not expected.
> Signed-off-by: Vadim Yuzifovich <vadim@yuzi.co>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116070433.2813951-1-vadim@yuzi.co?part=2
next prev parent reply other threads:[~2026-11-16 7:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 7:04 [PATCH v2 0/3] usb: dwc2: gadget: descriptor DMA fixes for BNA, found on Sophgo SG2002 Vadim Yuzifovich
2026-11-16 7:04 ` [PATCH v2 1/3] usb: dwc2: gadget: restart descriptor DMA isochronous OUT endpoints after BNA Vadim Yuzifovich
2026-11-16 7:04 ` [PATCH v2 2/3] usb: dwc2: gadget: restart descriptor DMA bulk and interrupt " Vadim Yuzifovich
2026-11-16 7:13 ` sashiko-bot [this message]
2026-11-16 7:04 ` [PATCH v2 3/3] usb: dwc2: gadget: make descriptors visible before the endpoint is enabled Vadim Yuzifovich
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=sashiko-outbox-216395@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vadim@yuzi.co \
/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