Skip to content

Commit

Permalink
usb: dwc3: gadget: interrupt on ring full too
Browse files Browse the repository at this point in the history
If the ring is full and we are processing a big
sglist, then let's interrupt so we can, later, add
more TRBs to the ring.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
  • Loading branch information
Felipe Balbi committed Aug 22, 2016
1 parent 0b3e4af commit 2c78c02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,8 @@ static void dwc3_gadget_ep_free_request(struct usb_ep *ep,
kfree(req);
}

static u32 dwc3_calc_trbs_left(struct dwc3_ep *dep);

/**
* dwc3_prepare_one_trb - setup one TRB from one request
* @dep: endpoint for which this request is prepared
Expand Down Expand Up @@ -818,7 +820,8 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
/* always enable Continue on Short Packet */
trb->ctrl |= DWC3_TRB_CTRL_CSP;

if (!req->request.no_interrupt && !chain)
if ((!req->request.no_interrupt && !chain) ||
(dwc3_calc_trbs_left(dep) == 0))
trb->ctrl |= DWC3_TRB_CTRL_IOC | DWC3_TRB_CTRL_ISP_IMI;

if (chain)
Expand Down

0 comments on commit 2c78c02

Please sign in to comment.