aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-sched.c')
-rw-r--r--drivers/usb/host/ehci-sched.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 6c9fbe352f73..2abf8543f083 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -172,7 +172,7 @@ periodic_usecs (struct ehci_hcd *ehci, unsigned frame, unsigned uframe)
172 } 172 }
173 } 173 }
174#ifdef DEBUG 174#ifdef DEBUG
175 if (usecs > 100) 175 if (usecs > ehci->uframe_periodic_max)
176 ehci_err (ehci, "uframe %d sched overrun: %d usecs\n", 176 ehci_err (ehci, "uframe %d sched overrun: %d usecs\n",
177 frame * 8 + uframe, usecs); 177 frame * 8 + uframe, usecs);
178#endif 178#endif
@@ -709,11 +709,8 @@ static int check_period (
709 if (uframe >= 8) 709 if (uframe >= 8)
710 return 0; 710 return 0;
711 711
712 /* 712 /* convert "usecs we need" to "max already claimed" */
713 * 80% periodic == 100 usec/uframe available 713 usecs = ehci->uframe_periodic_max - usecs;
714 * convert "usecs we need" to "max already claimed"
715 */
716 usecs = 100 - usecs;
717 714
718 /* we "know" 2 and 4 uframe intervals were rejected; so 715 /* we "know" 2 and 4 uframe intervals were rejected; so
719 * for period 0, check _every_ microframe in the schedule. 716 * for period 0, check _every_ microframe in the schedule.
@@ -1286,9 +1283,9 @@ itd_slot_ok (
1286{ 1283{
1287 uframe %= period; 1284 uframe %= period;
1288 do { 1285 do {
1289 /* can't commit more than 80% periodic == 100 usec */ 1286 /* can't commit more than uframe_periodic_max usec */
1290 if (periodic_usecs (ehci, uframe >> 3, uframe & 0x7) 1287 if (periodic_usecs (ehci, uframe >> 3, uframe & 0x7)
1291 > (100 - usecs)) 1288 > (ehci->uframe_periodic_max - usecs))
1292 return 0; 1289 return 0;
1293 1290
1294 /* we know urb->interval is 2^N uframes */ 1291 /* we know urb->interval is 2^N uframes */
@@ -1345,7 +1342,7 @@ sitd_slot_ok (
1345#endif 1342#endif
1346 1343
1347 /* check starts (OUT uses more than one) */ 1344 /* check starts (OUT uses more than one) */
1348 max_used = 100 - stream->usecs; 1345 max_used = ehci->uframe_periodic_max - stream->usecs;
1349 for (tmp = stream->raw_mask & 0xff; tmp; tmp >>= 1, uf++) { 1346 for (tmp = stream->raw_mask & 0xff; tmp; tmp >>= 1, uf++) {
1350 if (periodic_usecs (ehci, frame, uf) > max_used) 1347 if (periodic_usecs (ehci, frame, uf) > max_used)
1351 return 0; 1348 return 0;
@@ -1354,7 +1351,7 @@ sitd_slot_ok (
1354 /* for IN, check CSPLIT */ 1351 /* for IN, check CSPLIT */
1355 if (stream->c_usecs) { 1352 if (stream->c_usecs) {
1356 uf = uframe & 7; 1353 uf = uframe & 7;
1357 max_used = 100 - stream->c_usecs; 1354 max_used = ehci->uframe_periodic_max - stream->c_usecs;
1358 do { 1355 do {
1359 tmp = 1 << uf; 1356 tmp = 1 << uf;
1360 tmp <<= 8; 1357 tmp <<= 8;