diff options
Diffstat (limited to 'drivers/usb/host/ehci-q.c')
-rw-r--r-- | drivers/usb/host/ehci-q.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index e469221e7ec3..7fc25b6bd7d2 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2001-2004 by David Brownell | 2 | * Copyright (C) 2001-2004 by David Brownell |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms of the GNU General Public License as published by the | 5 | * under the terms of the GNU General Public License as published by the |
6 | * Free Software Foundation; either version 2 of the License, or (at your | 6 | * Free Software Foundation; either version 2 of the License, or (at your |
@@ -31,7 +31,7 @@ | |||
31 | * ISO traffic uses "ISO TD" (itd, and sitd) records, and (along with | 31 | * ISO traffic uses "ISO TD" (itd, and sitd) records, and (along with |
32 | * interrupts) needs careful scheduling. Performance improvements can be | 32 | * interrupts) needs careful scheduling. Performance improvements can be |
33 | * an ongoing challenge. That's in "ehci-sched.c". | 33 | * an ongoing challenge. That's in "ehci-sched.c". |
34 | * | 34 | * |
35 | * USB 1.1 devices are handled (a) by "companion" OHCI or UHCI root hubs, | 35 | * USB 1.1 devices are handled (a) by "companion" OHCI or UHCI root hubs, |
36 | * or otherwise through transaction translators (TTs) in USB 2.0 hubs using | 36 | * or otherwise through transaction translators (TTs) in USB 2.0 hubs using |
37 | * (b) special fields in qh entries or (c) split iso entries. TTs will | 37 | * (b) special fields in qh entries or (c) split iso entries. TTs will |
@@ -199,7 +199,7 @@ static void qtd_copy_status ( | |||
199 | && ((token & QTD_STS_MMF) != 0 | 199 | && ((token & QTD_STS_MMF) != 0 |
200 | || QTD_CERR(token) == 0) | 200 | || QTD_CERR(token) == 0) |
201 | && (!ehci_is_TDI(ehci) | 201 | && (!ehci_is_TDI(ehci) |
202 | || urb->dev->tt->hub != | 202 | || urb->dev->tt->hub != |
203 | ehci_to_hcd(ehci)->self.root_hub)) { | 203 | ehci_to_hcd(ehci)->self.root_hub)) { |
204 | #ifdef DEBUG | 204 | #ifdef DEBUG |
205 | struct usb_device *tt = urb->dev->tt->hub; | 205 | struct usb_device *tt = urb->dev->tt->hub; |
@@ -364,7 +364,7 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh, struct pt_regs *regs) | |||
364 | */ | 364 | */ |
365 | if (likely (urb->status == -EINPROGRESS)) | 365 | if (likely (urb->status == -EINPROGRESS)) |
366 | continue; | 366 | continue; |
367 | 367 | ||
368 | /* issue status after short control reads */ | 368 | /* issue status after short control reads */ |
369 | if (unlikely (do_status != 0) | 369 | if (unlikely (do_status != 0) |
370 | && QTD_PID (token) == 0 /* OUT */) { | 370 | && QTD_PID (token) == 0 /* OUT */) { |
@@ -388,7 +388,7 @@ halt: | |||
388 | wmb (); | 388 | wmb (); |
389 | } | 389 | } |
390 | } | 390 | } |
391 | 391 | ||
392 | /* remove it from the queue */ | 392 | /* remove it from the queue */ |
393 | spin_lock (&urb->lock); | 393 | spin_lock (&urb->lock); |
394 | qtd_copy_status (ehci, urb, qtd->length, token); | 394 | qtd_copy_status (ehci, urb, qtd->length, token); |
@@ -518,7 +518,7 @@ qh_urb_transaction ( | |||
518 | /* for zero length DATA stages, STATUS is always IN */ | 518 | /* for zero length DATA stages, STATUS is always IN */ |
519 | if (len == 0) | 519 | if (len == 0) |
520 | token |= (1 /* "in" */ << 8); | 520 | token |= (1 /* "in" */ << 8); |
521 | } | 521 | } |
522 | 522 | ||
523 | /* | 523 | /* |
524 | * data transfer stage: buffer setup | 524 | * data transfer stage: buffer setup |
@@ -759,7 +759,7 @@ qh_make ( | |||
759 | } | 759 | } |
760 | break; | 760 | break; |
761 | default: | 761 | default: |
762 | dbg ("bogus dev %p speed %d", urb->dev, urb->dev->speed); | 762 | dbg ("bogus dev %p speed %d", urb->dev, urb->dev->speed); |
763 | done: | 763 | done: |
764 | qh_put (qh); | 764 | qh_put (qh); |
765 | return NULL; | 765 | return NULL; |
@@ -967,17 +967,16 @@ static void end_unlink_async (struct ehci_hcd *ehci, struct pt_regs *regs) | |||
967 | struct ehci_qh *qh = ehci->reclaim; | 967 | struct ehci_qh *qh = ehci->reclaim; |
968 | struct ehci_qh *next; | 968 | struct ehci_qh *next; |
969 | 969 | ||
970 | timer_action_done (ehci, TIMER_IAA_WATCHDOG); | 970 | iaa_watchdog_done (ehci); |
971 | 971 | ||
972 | // qh->hw_next = cpu_to_le32 (qh->qh_dma); | 972 | // qh->hw_next = cpu_to_le32 (qh->qh_dma); |
973 | qh->qh_state = QH_STATE_IDLE; | 973 | qh->qh_state = QH_STATE_IDLE; |
974 | qh->qh_next.qh = NULL; | 974 | qh->qh_next.qh = NULL; |
975 | qh_put (qh); // refcount from reclaim | 975 | qh_put (qh); // refcount from reclaim |
976 | 976 | ||
977 | /* other unlink(s) may be pending (in QH_STATE_UNLINK_WAIT) */ | 977 | /* other unlink(s) may be pending (in QH_STATE_UNLINK_WAIT) */ |
978 | next = qh->reclaim; | 978 | next = qh->reclaim; |
979 | ehci->reclaim = next; | 979 | ehci->reclaim = next; |
980 | ehci->reclaim_ready = 0; | ||
981 | qh->reclaim = NULL; | 980 | qh->reclaim = NULL; |
982 | 981 | ||
983 | qh_completions (ehci, qh, regs); | 982 | qh_completions (ehci, qh, regs); |
@@ -1031,7 +1030,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
1031 | timer_action_done (ehci, TIMER_ASYNC_OFF); | 1030 | timer_action_done (ehci, TIMER_ASYNC_OFF); |
1032 | } | 1031 | } |
1033 | return; | 1032 | return; |
1034 | } | 1033 | } |
1035 | 1034 | ||
1036 | qh->qh_state = QH_STATE_UNLINK; | 1035 | qh->qh_state = QH_STATE_UNLINK; |
1037 | ehci->reclaim = qh = qh_get (qh); | 1036 | ehci->reclaim = qh = qh_get (qh); |
@@ -1046,17 +1045,16 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
1046 | 1045 | ||
1047 | if (unlikely (ehci_to_hcd(ehci)->state == HC_STATE_HALT)) { | 1046 | if (unlikely (ehci_to_hcd(ehci)->state == HC_STATE_HALT)) { |
1048 | /* if (unlikely (qh->reclaim != 0)) | 1047 | /* if (unlikely (qh->reclaim != 0)) |
1049 | * this will recurse, probably not much | 1048 | * this will recurse, probably not much |
1050 | */ | 1049 | */ |
1051 | end_unlink_async (ehci, NULL); | 1050 | end_unlink_async (ehci, NULL); |
1052 | return; | 1051 | return; |
1053 | } | 1052 | } |
1054 | 1053 | ||
1055 | ehci->reclaim_ready = 0; | ||
1056 | cmd |= CMD_IAAD; | 1054 | cmd |= CMD_IAAD; |
1057 | writel (cmd, &ehci->regs->command); | 1055 | writel (cmd, &ehci->regs->command); |
1058 | (void) readl (&ehci->regs->command); | 1056 | (void) readl (&ehci->regs->command); |
1059 | timer_action (ehci, TIMER_IAA_WATCHDOG); | 1057 | iaa_watchdog_start (ehci); |
1060 | } | 1058 | } |
1061 | 1059 | ||
1062 | /*-------------------------------------------------------------------------*/ | 1060 | /*-------------------------------------------------------------------------*/ |