• G
    ehci: fix fetch qtd race · b7d3a7e1
    Gerd Hoffmann 提交于
    The token field contains the (guest-filled) state of the qtd, which
    indicates whenever the other fields are valid or not.  So make sure
    we read the token first, otherwise we may end up with an stale next
    pointer:
    
      (1) ehci reads next
      (2) guest writes next
      (3) guest writes token
      (4) ehci reads token
      (5) ehci operates with stale next.
    
    Typical effect is that qemu doesn't notice that the guest appends new
    qtds to the end of the queue.  Looks like the usb device stopped
    responding.  Linux can recover from that, but leaves a message in the
    kernel log that it did reset the usb device in question.
    Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
    Message-id: 20181126100836.8805-1-kraxel@redhat.com
    b7d3a7e1
hcd-ehci.c 72.8 KB