diff options
Diffstat (limited to 'drivers/usb/host/uhci-q.c')
-rw-r--r-- | drivers/usb/host/uhci-q.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c index db645936eedd..5631d89c8730 100644 --- a/drivers/usb/host/uhci-q.c +++ b/drivers/usb/host/uhci-q.c | |||
@@ -123,14 +123,10 @@ static struct uhci_td *uhci_alloc_td(struct uhci_hcd *uhci) | |||
123 | 123 | ||
124 | static void uhci_free_td(struct uhci_hcd *uhci, struct uhci_td *td) | 124 | static void uhci_free_td(struct uhci_hcd *uhci, struct uhci_td *td) |
125 | { | 125 | { |
126 | if (!list_empty(&td->list)) { | 126 | if (!list_empty(&td->list)) |
127 | dev_warn(uhci_dev(uhci), "td %p still in list!\n", td); | 127 | dev_WARN(uhci_dev(uhci), "td %p still in list!\n", td); |
128 | WARN_ON(1); | 128 | if (!list_empty(&td->fl_list)) |
129 | } | 129 | dev_WARN(uhci_dev(uhci), "td %p still in fl_list!\n", td); |
130 | if (!list_empty(&td->fl_list)) { | ||
131 | dev_warn(uhci_dev(uhci), "td %p still in fl_list!\n", td); | ||
132 | WARN_ON(1); | ||
133 | } | ||
134 | 130 | ||
135 | dma_pool_free(uhci->td_pool, td, td->dma_handle); | 131 | dma_pool_free(uhci->td_pool, td, td->dma_handle); |
136 | } | 132 | } |
@@ -295,10 +291,8 @@ static struct uhci_qh *uhci_alloc_qh(struct uhci_hcd *uhci, | |||
295 | static void uhci_free_qh(struct uhci_hcd *uhci, struct uhci_qh *qh) | 291 | static void uhci_free_qh(struct uhci_hcd *uhci, struct uhci_qh *qh) |
296 | { | 292 | { |
297 | WARN_ON(qh->state != QH_STATE_IDLE && qh->udev); | 293 | WARN_ON(qh->state != QH_STATE_IDLE && qh->udev); |
298 | if (!list_empty(&qh->queue)) { | 294 | if (!list_empty(&qh->queue)) |
299 | dev_warn(uhci_dev(uhci), "qh %p list not empty!\n", qh); | 295 | dev_WARN(uhci_dev(uhci), "qh %p list not empty!\n", qh); |
300 | WARN_ON(1); | ||
301 | } | ||
302 | 296 | ||
303 | list_del(&qh->node); | 297 | list_del(&qh->node); |
304 | if (qh->udev) { | 298 | if (qh->udev) { |
@@ -746,11 +740,9 @@ static void uhci_free_urb_priv(struct uhci_hcd *uhci, | |||
746 | { | 740 | { |
747 | struct uhci_td *td, *tmp; | 741 | struct uhci_td *td, *tmp; |
748 | 742 | ||
749 | if (!list_empty(&urbp->node)) { | 743 | if (!list_empty(&urbp->node)) |
750 | dev_warn(uhci_dev(uhci), "urb %p still on QH's list!\n", | 744 | dev_WARN(uhci_dev(uhci), "urb %p still on QH's list!\n", |
751 | urbp->urb); | 745 | urbp->urb); |
752 | WARN_ON(1); | ||
753 | } | ||
754 | 746 | ||
755 | list_for_each_entry_safe(td, tmp, &urbp->td_list, list) { | 747 | list_for_each_entry_safe(td, tmp, &urbp->td_list, list) { |
756 | uhci_remove_td_from_urbp(td); | 748 | uhci_remove_td_from_urbp(td); |
@@ -1073,13 +1065,18 @@ static int uhci_submit_interrupt(struct uhci_hcd *uhci, struct urb *urb, | |||
1073 | } | 1065 | } |
1074 | if (exponent < 0) | 1066 | if (exponent < 0) |
1075 | return -EINVAL; | 1067 | return -EINVAL; |
1076 | qh->period = 1 << exponent; | ||
1077 | qh->skel = SKEL_INDEX(exponent); | ||
1078 | 1068 | ||
1079 | /* For now, interrupt phase is fixed by the layout | 1069 | /* If the slot is full, try a lower period */ |
1080 | * of the QH lists. */ | 1070 | do { |
1081 | qh->phase = (qh->period / 2) & (MAX_PHASE - 1); | 1071 | qh->period = 1 << exponent; |
1082 | ret = uhci_check_bandwidth(uhci, qh); | 1072 | qh->skel = SKEL_INDEX(exponent); |
1073 | |||
1074 | /* For now, interrupt phase is fixed by the layout | ||
1075 | * of the QH lists. | ||
1076 | */ | ||
1077 | qh->phase = (qh->period / 2) & (MAX_PHASE - 1); | ||
1078 | ret = uhci_check_bandwidth(uhci, qh); | ||
1079 | } while (ret != 0 && --exponent >= 0); | ||
1083 | if (ret) | 1080 | if (ret) |
1084 | return ret; | 1081 | return ret; |
1085 | } else if (qh->period > urb->interval) | 1082 | } else if (qh->period > urb->interval) |