From 40de8458b79f42ffea8d3e4173bf6265ea41ab33 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Thu, 25 Sep 2008 16:59:57 -0400 Subject: [PATCH] --- yaml --- r: 115784 b: refs/heads/master c: e58dcebcd83b5902411e747ee7807219dee6bcf2 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/host/uhci-q.c | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 30a1f173151f..33af2d5931b2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 925dff5dee04fb46d2e67c088c54b331f97672ee +refs/heads/master: e58dcebcd83b5902411e747ee7807219dee6bcf2 diff --git a/trunk/drivers/usb/host/uhci-q.c b/trunk/drivers/usb/host/uhci-q.c index 1f0c2cf26e5d..5631d89c8730 100644 --- a/trunk/drivers/usb/host/uhci-q.c +++ b/trunk/drivers/usb/host/uhci-q.c @@ -1065,13 +1065,18 @@ static int uhci_submit_interrupt(struct uhci_hcd *uhci, struct urb *urb, } if (exponent < 0) return -EINVAL; - qh->period = 1 << exponent; - qh->skel = SKEL_INDEX(exponent); - /* For now, interrupt phase is fixed by the layout - * of the QH lists. */ - qh->phase = (qh->period / 2) & (MAX_PHASE - 1); - ret = uhci_check_bandwidth(uhci, qh); + /* If the slot is full, try a lower period */ + do { + qh->period = 1 << exponent; + qh->skel = SKEL_INDEX(exponent); + + /* For now, interrupt phase is fixed by the layout + * of the QH lists. + */ + qh->phase = (qh->period / 2) & (MAX_PHASE - 1); + ret = uhci_check_bandwidth(uhci, qh); + } while (ret != 0 && --exponent >= 0); if (ret) return ret; } else if (qh->period > urb->interval)