* [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
2026-12-04 7:37 ` Pawel Laszczak
0 siblings, 2 replies; 3+ 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] 3+ messages in thread* Re: [PATCH] usb: cdns3: gadget: fix missing ZLP for ep0 data transfer
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
2026-12-04 7:37 ` Pawel Laszczak
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-12-03 16:08 UTC (permalink / raw)
To: Yongchao Wu; +Cc: linux-usb
> 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>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203154939.1039614-1-yongchao.wu@autochips.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread* RE: [PATCH] usb: cdns3: gadget: fix missing ZLP for ep0 data transfer
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
@ 2026-12-04 7:37 ` Pawel Laszczak
1 sibling, 0 replies; 3+ messages in thread
From: Pawel Laszczak @ 2026-12-04 7:37 UTC (permalink / raw)
To: Yongchao Wu, Peter Chen, Greg Kroah-Hartman
Cc: Roger Quadros, linux-usb@vger.kernel.org
Acked-by: Pawel Laszczak <pawell@cadence.com>
>
>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 [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-04 7:37 UTC | newest]
Thread overview: 3+ 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
2026-12-04 7:37 ` Pawel Laszczak
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.