Thread (14 messages) 14 messages, 2 authors, 2021-12-06

[PATCH 3/3] usb: aspeed-vhub: fix ep0 OUT ack received wrong length issue

flat view

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2021-11-29 23:54:19
Also in: linux-arm-kernel, linux-usb, lkml

On Fri, 2021-11-26 at 19:09 +0800, Neal Liu wrote:
quoted hunk ↗ jump to hunk
diff --git a/drivers/usb/gadget/udc/aspeed-vhub/ep0.c
b/drivers/usb/gadget/udc/aspeed-vhub/ep0.c
index 74ea36c19b1e..bea9cbb191a2 100644
--- a/drivers/usb/gadget/udc/aspeed-vhub/ep0.c
+++ b/drivers/usb/gadget/udc/aspeed-vhub/ep0.c
@@ -251,6 +251,13 @@ static void ast_vhub_ep0_do_receive(struct
ast_vhub_ep *ep, struct ast_vhub_req
 		len = remain;
 		rc = -EOVERFLOW;
 	}
+
+	/* HW return wrong data len */
+	if (len < ep->ep.maxpacket && len != remain) {
+		EPDBG(ep, "using expected data len instead\n");
+		len = remain;
+	}
+
Wow, that is a nasty hw bug ! Patch looks good, I had to swap some of
that logic back into my brain but it looks like it won't break any
normal case :-)

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Cheers,
Ben.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help