usb-ehci: Fix races with controller on updates to QH.

The EHCI controller writes to the TD after writing to the QH, so the
driver must wait for all the TDs to be complete before considering the
transfer completed.  (The previous implementation was particularly bad
as it only checked that the last TD was in progress before considering
the transfer complete.)

Also, avoid writing to the qh.token field when starting a transfer to
eliminate a potential race.  Place the qh.token in an available state
by default - that way only the qtd_next field needs to be updated to
start the transfer.

Signed-off-by: Kevin O'Connor <>
1 file changed
tree: 205939acac563c3b811305a64702b89ebc210e37
  1. src/
  2. tools/
  3. vgasrc/
  4. .gitignore
  7. Makefile
  9. TODO