Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303942
b: refs/heads/master
c: 65b8e5c
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed May 14, 2012
1 parent eaf45e3 commit fa99695
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 61af9c3f894a48297db3cc01aa38910bd6f92c27
refs/heads/master: 65b8e5cbdddc86474372bdb48dc233b06710a576
40 changes: 21 additions & 19 deletions trunk/drivers/usb/host/ehci-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1331,34 +1331,36 @@ sitd_slot_ok (
if (mask & ~0xffff)
return 0;

/* check bandwidth */
uframe %= period_uframes;
frame = uframe >> 3;

#ifdef CONFIG_USB_EHCI_TT_NEWSCHED
/* The tt's fullspeed bus bandwidth must be available.
* tt_available scheduling guarantees 10+% for control/bulk.
*/
uf = uframe & 7;
if (!tt_available(ehci, period_uframes >> 3,
stream->udev, frame, uf, stream->tt_usecs))
return 0;
#else
/* tt must be idle for start(s), any gap, and csplit.
* assume scheduling slop leaves 10+% for control/bulk.
*/
if (!tt_no_collision(ehci, period_uframes >> 3,
stream->udev, frame, mask))
return 0;
#endif

/* this multi-pass logic is simple, but performance may
* suffer when the schedule data isn't cached.
*/

/* check bandwidth */
uframe %= period_uframes;
do {
u32 max_used;

frame = uframe >> 3;
uf = uframe & 7;

#ifdef CONFIG_USB_EHCI_TT_NEWSCHED
/* The tt's fullspeed bus bandwidth must be available.
* tt_available scheduling guarantees 10+% for control/bulk.
*/
if (!tt_available (ehci, period_uframes << 3,
stream->udev, frame, uf, stream->tt_usecs))
return 0;
#else
/* tt must be idle for start(s), any gap, and csplit.
* assume scheduling slop leaves 10+% for control/bulk.
*/
if (!tt_no_collision (ehci, period_uframes << 3,
stream->udev, frame, mask))
return 0;
#endif

/* check starts (OUT uses more than one) */
max_used = ehci->uframe_periodic_max - stream->usecs;
for (tmp = stream->raw_mask & 0xff; tmp; tmp >>= 1, uf++) {
Expand Down

0 comments on commit fa99695

Please sign in to comment.