Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>


authored by

Alan Stern and committed by
Greg Kroah-Hartman
ef4638f9 7a0f0d95

+5 -5
+4 -5
drivers/usb/host/ehci-q.c
··· 375 375 */ 376 376 if ((token & QTD_STS_XACT) && 377 377 QTD_CERR(token) == 0 && 378 - --qh->xacterrs > 0 && 378 + ++qh->xacterrs < QH_XACTERR_MAX && 379 379 !urb->unlinked) { 380 380 ehci_dbg(ehci, 381 381 "detected XactErr len %zu/%zu retry %d\n", 382 - qtd->length - QTD_LENGTH(token), qtd->length, 383 - QH_XACTERR_MAX - qh->xacterrs); 382 + qtd->length - QTD_LENGTH(token), qtd->length, qh->xacterrs); 384 383 385 384 /* reset the token in the qtd and the 386 385 * qh overlay (which still contains ··· 493 494 last = qtd; 494 495 495 496 /* reinit the xacterr counter for the next qtd */ 496 - qh->xacterrs = QH_XACTERR_MAX; 497 + qh->xacterrs = 0; 497 498 } 498 499 499 500 /* last urb's completion might still need calling */ ··· 940 941 head->hw_next = dma; 941 942 942 943 qh_get(qh); 943 - qh->xacterrs = QH_XACTERR_MAX; 944 + qh->xacterrs = 0; 944 945 qh->qh_state = QH_STATE_LINKED; 945 946 /* qtd completions reported later by interrupt */ 946 947 }
+1
drivers/usb/host/ehci-sched.c
··· 542 542 } 543 543 } 544 544 qh->qh_state = QH_STATE_LINKED; 545 + qh->xacterrs = 0; 545 546 qh_get (qh); 546 547 547 548 /* update per-qh bandwidth for usbfs */