Skip to content

Commit

Permalink
usb: dwc3: gadget: start requests as soon as they come
Browse files Browse the repository at this point in the history
In an attempt to make dwc3 slightly faster, let's
start usb_requests as soon as they come as that will
let us avoid a XFER_NOT_READY event and save a little
bit of time.

Signed-off-by: Felipe Balbi <[email protected]>
Signed-off-by: Sekhar Nori <[email protected]>
  • Loading branch information
Felipe Balbi authored and nsekhar committed Sep 24, 2015
1 parent 5c82d5f commit 118694c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,22 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)

list_add_tail(&req->list, &dep->request_list);

/*
* If there are no pending requests and the endpoint isn't already
* busy, we will just start the request straight away.
*
* This will save one IRQ (XFER_NOT_READY) and possibly make it a
* little bit faster.
*/
if (!usb_endpoint_xfer_isoc(dep->endpoint.desc) &&
!(dep->flags & DWC3_EP_BUSY)) {
ret = __dwc3_gadget_kick_transfer(dep, 0, true);
if (ret && ret != -EBUSY)
dev_dbg(dwc->dev, "%s: failed to kick transfers\n",
dep->name);
return ret;
}

/*
* There are a few special cases:
*
Expand Down

0 comments on commit 118694c

Please sign in to comment.