Commit 2456b97f0c9411d0bc2637ba1033a910c8b4b971

Authored by Stephen Warren
Committed by Marek Vasut
1 parent 247161b816

ush: ehci: initialize altnext pointers in QH

Section 4.10.2 "Advance Queue" of ehci-specification-for-usb.pdf
specifies how an EHCI controller loads a new QTD for processing if the
QH is not already marked as active. It states:

=====
If the field Bytes to Transfer is not zero and the T-bit in the Alternate
Next qTD Pointer is set to zero, then the host controller uses the
Alternate Next qTD Pointer. Otherwise, the host controller uses the Next
qTD Pointer. If Next qTD Pointer’s T-bit is set to a one, then the host
controller exits this state and uses the horizontal pointer to the next
schedule data structure.
=====

Hence, we must ensure that the alternate next QTD pointer's T-bit
(TERMINATE) is set, so the EHCI controller knows to use the next QTD
pointer.

Signed-off-by: Stephen Warren <swarren@nvidia.com>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

drivers/usb/host/ehci-hcd.c
... ... @@ -395,6 +395,7 @@
395 395 QH_ENDPT2_UFCMASK(0) | QH_ENDPT2_UFSMASK(0);
396 396 qh->qh_endpt2 = cpu_to_hc32(endpt);
397 397 qh->qh_overlay.qt_next = cpu_to_hc32(QT_NEXT_TERMINATE);
  398 + qh->qh_overlay.qt_altnext = cpu_to_hc32(QT_NEXT_TERMINATE);
398 399  
399 400 tdp = &qh->qh_overlay.qt_next;
400 401  
... ... @@ -1186,6 +1187,7 @@
1186 1187 qh->qh_link = QH_LINK_TERMINATE;
1187 1188  
1188 1189 qh->qh_overlay.qt_next = (uint32_t)td;
  1190 + qh->qh_overlay.qt_altnext = QT_NEXT_TERMINATE;
1189 1191 qh->qh_endpt1 = (0 << 28) | /* No NAK reload (ehci 4.9) */
1190 1192 (usb_maxpacket(dev, pipe) << 16) | /* MPS */
1191 1193 (1 << 14) |