Skip to content

Commit

Permalink
usb: gadget: f_tcm: Requeue command request on error
Browse files Browse the repository at this point in the history
If there's error on command request, make sure to requeue to receive the
next one.

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/d4e55c13be8f83f99ee55f7b979a99e2c14fc4c8.1733876548.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Thinh Nguyen authored and Greg Kroah-Hartman committed Dec 24, 2024
1 parent a4d7274 commit 3ce3b21
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/usb/gadget/function/f_tcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,13 @@ static void bot_cmd_complete(struct usb_ep *ep, struct usb_request *req)

fu->flags &= ~USBG_BOT_CMD_PEND;

if (req->status < 0)
if (req->status < 0) {
struct usb_gadget *gadget = fuas_to_gadget(fu);

dev_err(&gadget->dev, "BOT command req err (%d)\n", req->status);
bot_enqueue_cmd_cbw(fu);
return;
}

ret = bot_submit_command(fu, req->buf, req->actual);
if (ret) {
Expand Down

0 comments on commit 3ce3b21

Please sign in to comment.