* [PATCH] usb: cdns3: gadget: fix missing ZLP for ep0 data transfer
@ 2026-12-03 15:49 Yongchao Wu
2026-12-03 16:08 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Yongchao Wu @ 2026-12-03 15:49 UTC (permalink / raw)
To: Peter Chen, Pawel Laszczak, Greg Kroah-Hartman
Cc: Roger Quadros, linux-usb, Yongchao Wu
When an ep0 data stage IN response is an exact multiple of maxpacket
and shorter than wLength, the queued zero-length TRB is never processed
because the data TRB lacks TRB_CHAIN, causing continuous IN-NAK until
the host times out. Set TRB_CHAIN on the data TRB to chain it with the
following ZLP TRB.
Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Cc: stable@vger.kernel.org
Signed-off-by: Yongchao Wu <yongchao.wu@autochips.com>
---
drivers/usb/cdns3/cdns3-ep0.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/cdns3/cdns3-ep0.c b/drivers/usb/cdns3/cdns3-ep0.c
index e29989d57..23ca1bb1f 100644
--- a/drivers/usb/cdns3/cdns3-ep0.c
+++ b/drivers/usb/cdns3/cdns3-ep0.c
@@ -42,7 +42,8 @@ static void cdns3_ep0_run_transfer(struct cdns3_device *priv_dev,
priv_ep->trb_pool[0].length = cpu_to_le32(TRB_LEN(length));
if (zlp) {
- priv_ep->trb_pool[0].control = cpu_to_le32(TRB_CYCLE | TRB_TYPE(TRB_NORMAL));
+ priv_ep->trb_pool[0].control = cpu_to_le32(TRB_CYCLE | TRB_CHAIN |
+ TRB_TYPE(TRB_NORMAL));
priv_ep->trb_pool[1].buffer = cpu_to_le32(TRB_BUFFER(dma_addr));
priv_ep->trb_pool[1].length = cpu_to_le32(TRB_LEN(0));
priv_ep->trb_pool[1].control = cpu_to_le32(TRB_CYCLE | TRB_IOC |
base-commit: 4dce97c6c265544342e716e62fd24bbb232590c5
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-03 16:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 15:49 [PATCH] usb: cdns3: gadget: fix missing ZLP for ep0 data transfer Yongchao Wu
2026-12-03 16:08 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox