summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2013-03-22 18:31:29 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-25 21:35:05 +0100
commit7655e3160c78a18c2ecf7bf4dee0bbfe58575c7f (patch)
treebf32c4068914e6c3054ba35dc003a9818c0dfc56 /drivers
parentUSB: EHCI: split needs_rescan into two flags (diff)
downloadlinux-7655e3160c78a18c2ecf7bf4dee0bbfe58575c7f.tar.xz
linux-7655e3160c78a18c2ecf7bf4dee0bbfe58575c7f.zip
USB: EHCI: consolidate code in ehci_urb_dequeue()
This patch (as1668) consolidates two nearly identical code paths in ehci_urb_dequeue(). The test for !qh can be removed because it will never succeed; the fact that usb_hcd_check_unlink_urb() returned 0 means that urb must be queued and therefore urb->hcpriv must point to a QH. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/ehci-hcd.c48
1 files changed, 11 insertions, 37 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 93f4cd75845e..87fe3daaa092 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -896,17 +896,21 @@ static int ehci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
if (rc)
goto done;
- switch (usb_pipetype (urb->pipe)) {
- // case PIPE_CONTROL:
- // case PIPE_BULK:
- default:
+ if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS) {
+ /*
+ * We don't expedite dequeue for isochronous URBs.
+ * Just wait until they complete normally or their
+ * time slot expires.
+ */
+ } else {
qh = (struct ehci_qh *) urb->hcpriv;
- if (!qh)
- break;
qh->exception = 1;
switch (qh->qh_state) {
case QH_STATE_LINKED:
- start_unlink_async(ehci, qh);
+ if (usb_pipetype(urb->pipe) == PIPE_INTERRUPT)
+ start_unlink_intr(ehci, qh);
+ else
+ start_unlink_async(ehci, qh);
break;
case QH_STATE_COMPLETING:
qh->dequeue_during_giveback = 1;
@@ -920,36 +924,6 @@ static int ehci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
qh_completions(ehci, qh);
break;
}
- break;
-
- case PIPE_INTERRUPT:
- qh = (struct ehci_qh *) urb->hcpriv;
- if (!qh)
- break;
- qh->exception = 1;
- switch (qh->qh_state) {
- case QH_STATE_LINKED:
- start_unlink_intr(ehci, qh);
- break;
- case QH_STATE_COMPLETING:
- qh->dequeue_during_giveback = 1;
- break;
- case QH_STATE_IDLE:
- qh_completions (ehci, qh);
- break;
- default:
- ehci_dbg (ehci, "bogus qh %p state %d\n",
- qh, qh->qh_state);
- goto done;
- }
- break;
-
- case PIPE_ISOCHRONOUS:
- // itd or sitd ...
-
- // wait till next completion, do it then.
- // completion irqs can wait up to 1024 msec,
- break;
}
done:
spin_unlock_irqrestore (&ehci->lock, flags);