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@xxxxxxxxxxxxxxx > Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx> > --- > > 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