Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93369
b: refs/heads/master
c: 4f66762
h: refs/heads/master
i:
  93367: c09d3bf
v: v3
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Apr 25, 2008
1 parent 9a7ee16 commit c9210e9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c6dbf554bc8a79c9caab3dbf891a33c19068f646
refs/heads/master: 4f6676274fb6303a8e8100d086ea8c2c00c0d8e3
34 changes: 16 additions & 18 deletions trunk/drivers/usb/host/ehci-q.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ __acquires(ehci->lock)
if (unlikely(urb->unlinked)) {
COUNT(ehci->stats.unlink);
} else {
if (likely(status == -EINPROGRESS))
/* report non-error and short read status as zero */
if (status == -EINPROGRESS || status == -EREMOTEIO)
status = 0;
COUNT(ehci->stats.complete);
}
Expand Down Expand Up @@ -283,7 +284,6 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
int last_status = -EINPROGRESS;
int stopped;
unsigned count = 0;
int do_status = 0;
u8 state;
u32 halt = HALT_BIT(ehci);

Expand All @@ -309,7 +309,6 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
struct ehci_qtd *qtd;
struct urb *urb;
u32 token = 0;
int qtd_status;

qtd = list_entry (entry, struct ehci_qtd, qtd_list);
urb = qtd->urb;
Expand Down Expand Up @@ -377,13 +376,6 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
else if (last_status == -EINPROGRESS && !urb->unlinked)
continue;

/* issue status after short control reads */
if (unlikely (do_status != 0)
&& QTD_PID (token) == 0 /* OUT */) {
do_status = 0;
continue;
}

/* qh unlinked; token in overlay may be most current */
if (state == QH_STATE_IDLE
&& cpu_to_hc32(ehci, qtd->qtd_dma)
Expand All @@ -401,15 +393,21 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
}
}

/* remove it from the queue */
qtd_status = qtd_copy_status(ehci, urb, qtd->length, token);
if (unlikely(qtd_status == -EREMOTEIO)) {
do_status = (!urb->unlinked &&
usb_pipecontrol(urb->pipe));
qtd_status = 0;
/* unless we already know the urb's status, collect qtd status
* and update count of bytes transferred. in common short read
* cases with only one data qtd (including control transfers),
* queue processing won't halt. but with two or more qtds (for
* example, with a 32 KB transfer), when the first qtd gets a
* short read the second must be removed by hand.
*/
if (last_status == -EINPROGRESS) {
last_status = qtd_copy_status(ehci, urb,
qtd->length, token);
if (last_status == -EREMOTEIO
&& (qtd->hw_alt_next
& EHCI_LIST_END(ehci)))
last_status = -EINPROGRESS;
}
if (likely(last_status == -EINPROGRESS))
last_status = qtd_status;

/* if we're removing something not at the queue head,
* patch the hardware queue pointer.
Expand Down

0 comments on commit c9210e9

Please sign in to comment.