]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
uhci: Always mark a queue valid when we encounter it
authorHans de Goede <hdegoede@redhat.com>
Wed, 24 Oct 2012 16:31:18 +0000 (18:31 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 25 Oct 2012 07:08:12 +0000 (09:08 +0200)
commit3905097ea8ea0e1b3dd1556f3ef74a123fe8622a
treec36d056409c398cd6433091ad9559b6d081c01d3
parent420ca987d5d14fabacdec86c568832d6b0056ca3
uhci: Always mark a queue valid when we encounter it

Before this patch we would not mark a queue valid when its head was a
non-active td. This causes us to misbehave in the following scenario:

1) queue with multiple input transfers queued
2) We hit some latency issue, causing qemu to get behind processing frames
3) When qemu gets to run again, it notices the first transfer ends short,
   marking the head td non-active
4) It now processes 32+ frames in a row without giving the guest a chance
   to run since it is behind
5) valid is decreased to 0, causing the queue to get cancelled also cancelling
   already queued up further input transfers
6) guest gets to run, notices the inactive td, cleanups up further tds
   from the short transfer, and lets the queue continue at the first td of
   the next input transfer
7) we re-start the queue, issuing the second input transfer for the *second*
   time, and any data read by the first time we issued it has been lost

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/hcd-uhci.c