From: Gerd Hoffmann Date: Thu, 23 Feb 2012 13:24:00 +0000 (+0100) Subject: usb-ehci: fix reset X-Git-Tag: v1.1-rc0~292^2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81d37739dfded2ebd992f3bf8ae5d6cb1a0558cc;p=thirdparty%2Fqemu.git usb-ehci: fix reset 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 --- diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index e6998143052..b9da26ada80 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -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 */