2021-05-07 17:56:44

by Wesley Cheng

[permalink] [raw]
Subject: [PATCH v2] usb: dwc3: gadget: Return success always for kick transfer in ep queue

If an error is received when issuing a start or update transfer
command, the error handler will stop all active requests (including
the current USB request), and call dwc3_gadget_giveback() to notify
function drivers of the requests which have been stopped. Avoid
returning an error for kick transfer during EP queue, to remove
duplicate cleanup operations on the request being queued.

Fixes: 8d99087c2db8 ("usb: dwc3: gadget: Properly handle failed kick_transfer")
cc: [email protected]
Signed-off-by: Wesley Cheng <[email protected]>
---
Changes in v2:
- Added Fixes tag and Cc'ed stable

Changes in v1:
- Renamed commit title due to new implementation
- Return success always for kick transfer during ep queue

Previous patchset:
https://lore.kernel.org/linux-usb/[email protected]/T/#t

drivers/usb/dwc3/gadget.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index dd80e5c..a5b7fd9 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1684,7 +1684,9 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
}
}

- return __dwc3_gadget_kick_transfer(dep);
+ __dwc3_gadget_kick_transfer(dep);
+
+ return 0;
}

static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


2021-05-10 13:02:43

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH v2] usb: dwc3: gadget: Return success always for kick transfer in ep queue

Wesley Cheng <[email protected]> writes:

> If an error is received when issuing a start or update transfer
> command, the error handler will stop all active requests (including
> the current USB request), and call dwc3_gadget_giveback() to notify
> function drivers of the requests which have been stopped. Avoid
> returning an error for kick transfer during EP queue, to remove
> duplicate cleanup operations on the request being queued.
>
> Fixes: 8d99087c2db8 ("usb: dwc3: gadget: Properly handle failed kick_transfer")
> cc: [email protected]

Wrong format here, should be:

Cc: <[email protected]>

Other than that:

Acked-by: Felipe Balbi <[email protected]>

--
balbi


Attachments:
signature.asc (521.00 B)