aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2009-07-31 10:41:40 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-08-07 19:05:13 -0400
commitef4638f955f2c4a667c8af20769d03f5ed3781ca (patch)
tree1e6092e6b104560ad1f079993dfd45fbf33df3d4 /drivers
parent7a0f0d951273eee889c2441846842348ebc00a2a (diff)
USB: EHCI: fix counting of transaction error retries
This patch (as1274) simplifies the counting of transaction-error retries. Now we will count up from 0 to QH_XACTERR_MAX instead of down from QH_XACTERR_MAX to 0. The patch also fixes a small bug: qh->xacterr was not getting initialized for interrupt endpoints. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Matthijs Kooijman <matthijs@stdin.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/ehci-q.c9
-rw-r--r--drivers/usb/host/ehci-sched.c1
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index b27380505576..7673554fa64d 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -375,12 +375,11 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
375 */ 375 */
376 if ((token & QTD_STS_XACT) && 376 if ((token & QTD_STS_XACT) &&
377 QTD_CERR(token) == 0 && 377 QTD_CERR(token) == 0 &&
378 --qh->xacterrs > 0 && 378 ++qh->xacterrs < QH_XACTERR_MAX &&
379 !urb->unlinked) { 379 !urb->unlinked) {
380 ehci_dbg(ehci, 380 ehci_dbg(ehci,
381 "detected XactErr len %zu/%zu retry %d\n", 381 "detected XactErr len %zu/%zu retry %d\n",
382 qtd->length - QTD_LENGTH(token), qtd->length, 382 qtd->length - QTD_LENGTH(token), qtd->length, qh->xacterrs);
383 QH_XACTERR_MAX - qh->xacterrs);
384 383
385 /* reset the token in the qtd and the 384 /* reset the token in the qtd and the
386 * qh overlay (which still contains 385 * qh overlay (which still contains
@@ -494,7 +493,7 @@ halt:
494 last = qtd; 493 last = qtd;
495 494
496 /* reinit the xacterr counter for the next qtd */ 495 /* reinit the xacterr counter for the next qtd */
497 qh->xacterrs = QH_XACTERR_MAX; 496 qh->xacterrs = 0;
498 } 497 }
499 498
500 /* last urb's completion might still need calling */ 499 /* last urb's completion might still need calling */
@@ -941,7 +940,7 @@ static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
941 head->hw_next = dma; 940 head->hw_next = dma;
942 941
943 qh_get(qh); 942 qh_get(qh);
944 qh->xacterrs = QH_XACTERR_MAX; 943 qh->xacterrs = 0;
945 qh->qh_state = QH_STATE_LINKED; 944 qh->qh_state = QH_STATE_LINKED;
946 /* qtd completions reported later by interrupt */ 945 /* qtd completions reported later by interrupt */
947} 946}
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 74f7f83b29ad..edd61ee90323 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -542,6 +542,7 @@ static int qh_link_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh)
542 } 542 }
543 } 543 }
544 qh->qh_state = QH_STATE_LINKED; 544 qh->qh_state = QH_STATE_LINKED;
545 qh->xacterrs = 0;
545 qh_get (qh); 546 qh_get (qh);
546 547
547 /* update per-qh bandwidth for usbfs */ 548 /* update per-qh bandwidth for usbfs */