Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289631
b: refs/heads/master
c: 8d62cd6
h: refs/heads/master
i:
  289629: 170c8b7
  289627: f972b17
  289623: 5728dbe
  289615: 3c6df8a
  289599: 8de4422
v: v3
  • Loading branch information
Paul Zimmerman authored and Felipe Balbi committed Mar 2, 2012
1 parent c3aab8f commit ff0f06d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 075cd14d2a8d35afc39ad28fc7b968275881266b
refs/heads/master: 8d62cd65d74d0e241b3a152f7347bb66126b705b
8 changes: 8 additions & 0 deletions trunk/drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,13 +826,21 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool starting)
{
struct dwc3_request *req, *n;
u32 trbs_left;
u32 max;
unsigned int last_one = 0;

BUILD_BUG_ON_NOT_POWER_OF_2(DWC3_TRB_NUM);

/* the first request must not be queued */
trbs_left = (dep->busy_slot - dep->free_slot) & DWC3_TRB_MASK;

/* Can't wrap around on a non-isoc EP since there's no link TRB */
if (!usb_endpoint_xfer_isoc(dep->desc)) {
max = DWC3_TRB_NUM - (dep->free_slot & DWC3_TRB_MASK);
if (trbs_left > max)
trbs_left = max;
}

/*
* If busy & slot are equal than it is either full or empty. If we are
* starting to process requests then we are empty. Otherwise we are
Expand Down

0 comments on commit ff0f06d

Please sign in to comment.