]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
usb-ehci: fix reset
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 23 Feb 2012 13:24:00 +0000 (14:24 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 27 Feb 2012 10:13:26 +0000 (11:13 +0100)
Two reset fixes:
  * pick up s->usbcmd value after ehci_reset call to make sure it
    keeps the reset value and doesn't get rubbish filled in when
    val is written back to the mmio register array later on.
  * make sure the frame timer is zapped on reset.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb-ehci.c

index e6998143052af0a38eac6c16569a6949e95ce2f4..b9da26ada8041c7426f5c1a5d581e5c775741cf7 100644 (file)
@@ -912,6 +912,7 @@ static void ehci_reset(void *opaque)
         }
     }
     ehci_queues_rip_all(s);
+    qemu_del_timer(s->frame_timer);
 }
 
 static uint32_t ehci_mem_readb(void *ptr, target_phys_addr_t addr)
@@ -1070,7 +1071,7 @@ static void ehci_mem_writel(void *ptr, target_phys_addr_t addr, uint32_t val)
 
         if (val & USBCMD_HCRESET) {
             ehci_reset(s);
-            val &= ~USBCMD_HCRESET;
+            val = s->usbcmd;
         }
 
         /* not supporting dynamic frame list size at the moment */