Hi,

> It would be even better to clear the cache on a set_address command
> (to cover the admittedly obscure case of an OS changing a device's
> address later on).

Additional verification check catches any address change (token address
not matching current device address).  That fixes the keyboard issue and
should also catch the obscure address change case.  And also the more
likely case of the address flipping back to zero due to a port reset.

cheers,
  Gerd

>From de99539cd89899ffc3054ab2601fbcec027b1503 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kra...@redhat.com>
Date: Wed, 5 Feb 2014 14:54:14 +0100
Subject: [PATCH] uhci: invalidate queue on device address changes

Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
---
 hw/usb/hcd-uhci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 238d1d2..1f7b152 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -252,9 +252,11 @@ static bool uhci_queue_verify(UHCIQueue *queue, uint32_t qh_addr, UHCI_TD *td,
                               uint32_t td_addr, bool queuing)
 {
     UHCIAsync *first = QTAILQ_FIRST(&queue->asyncs);
+    uint32_t queue_token_addr = (queue->token >> 8) & 0x7f;
 
     return queue->qh_addr == qh_addr &&
            queue->token == uhci_queue_token(td) &&
+           queue_token_addr == queue->ep->dev->addr &&
            (queuing || !(td->ctrl & TD_CTRL_ACTIVE) || first == NULL ||
             first->td_addr == td_addr);
 }
-- 
1.8.3.1

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios

Reply via email to