The usb_request API clearly noted that removed requests due to disabled endpoint should have -ESHUTDOWN status returned. Don't change this behavior.
Fixes: b44c0e7fef51 ("usb: dwc3: gadget: conditionally remove requests") Cc: stable@vger.kernel.org Signed-off-by: Thinh Nguyen Thinh.Nguyen@synopsys.com --- Note: Patch revert have conflicts, so let's do this instead of a revert.
drivers/usb/dwc3/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 5fe2d136dff5..026d4029bda6 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1029,7 +1029,7 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep) dep->endpoint.desc = NULL; }
- dwc3_remove_requests(dwc, dep, -ECONNRESET); + dwc3_remove_requests(dwc, dep, -ESHUTDOWN);
dep->stream_capable = false; dep->type = 0;
base-commit: 30a0b95b1335e12efef89dd78518ed3e4a71a763
Since the patch b44c0e7fef51 ("usb: dwc3: gadget: conditionally remove requests") the driver is now returning different request status values in different conditions of disabled endpoint and stopped transfers. The patch however has swapped the actual status results they should have. We fix this now with this patch.
Fixes: b44c0e7fef51 ("usb: dwc3: gadget: conditionally remove requests") Cc: stable@vger.kernel.org Signed-off-by: Michael Grzeschik m.grzeschik@pengutronix.de ---
I had this patch prepared already, but forgot about it. Sorry about the delay. Thanks for catching up on this, Thinh!
mgr
drivers/usb/dwc3/gadget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index ecddb144871bec..cd5ace438d40ee 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1029,7 +1029,7 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep) dep->endpoint.desc = NULL; }
- dwc3_remove_requests(dwc, dep, -ECONNRESET); + dwc3_remove_requests(dwc, dep, -ESHUTDOWN);
dep->stream_capable = false; dep->type = 0; @@ -2375,7 +2375,7 @@ static void dwc3_stop_active_transfers(struct dwc3 *dwc) if (!dep) continue;
- dwc3_remove_requests(dwc, dep, -ESHUTDOWN); + dwc3_remove_requests(dwc, dep, -ECONNRESET); } }
On Tue, Nov 08, 2022, Michael Grzeschik wrote:
Since the patch b44c0e7fef51 ("usb: dwc3: gadget: conditionally remove requests") the driver is now returning different request status values in different conditions of disabled endpoint and stopped transfers. The patch however has swapped the actual status results they should have. We fix this now with this patch.
Fixes: b44c0e7fef51 ("usb: dwc3: gadget: conditionally remove requests") Cc: stable@vger.kernel.org Signed-off-by: Michael Grzeschik m.grzeschik@pengutronix.de
I had this patch prepared already, but forgot about it. Sorry about the delay. Thanks for catching up on this, Thinh!
mgr
NP, I wasn't sure you would prepare it any time soon. It breaks some of our tests, so I went ahead and pushed the fix. Greg already picked it up.
drivers/usb/dwc3/gadget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index ecddb144871bec..cd5ace438d40ee 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1029,7 +1029,7 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep) dep->endpoint.desc = NULL; }
- dwc3_remove_requests(dwc, dep, -ECONNRESET);
- dwc3_remove_requests(dwc, dep, -ESHUTDOWN);
dep->stream_capable = false; dep->type = 0; @@ -2375,7 +2375,7 @@ static void dwc3_stop_active_transfers(struct dwc3 *dwc) if (!dep) continue;
dwc3_remove_requests(dwc, dep, -ESHUTDOWN);
}dwc3_remove_requests(dwc, dep, -ECONNRESET);
}
That doesn't look right. What about soft-disconnect? What conditions that dwc3_stop_active_transfers() is called that's not supposed to return -ESHUTDOWN?
Thanks, Thinh
linux-stable-mirror@lists.linaro.org