dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0139-usb-ehci-fix-reset.patch

1b1995
From 21946e621f14553b72cde7fae221ae390a427eac Mon Sep 17 00:00:00 2001
1b1995
From: Gerd Hoffmann <kraxel@redhat.com>
1b1995
Date: Thu, 23 Feb 2012 13:24:00 +0000
1b1995
Subject: [PATCH 139/140] usb-ehci: fix reset
1b1995
1b1995
Two reset fixes:
1b1995
  * pick up s->usbcmd value after ehci_reset call to make sure it
1b1995
    keeps the reset value and doesn't get rubbish filled in when
1b1995
    val is written back to the mmio register array later on.
1b1995
  * make sure the frame timer is zapped on reset.
1b1995
1b1995
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
1b1995
---
1b1995
 hw/usb-ehci.c |    3 ++-
1b1995
 1 file changed, 2 insertions(+), 1 deletion(-)
1b1995
1b1995
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
1b1995
index ba1b9da..ad0f6e1 100644
1b1995
--- a/hw/usb-ehci.c
1b1995
+++ b/hw/usb-ehci.c
1b1995
@@ -900,6 +900,7 @@ static void ehci_reset(void *opaque)
1b1995
     }
1b1995
     ehci_queues_rip_all(s, 0);
1b1995
     ehci_queues_rip_all(s, 1);
1b1995
+    qemu_del_timer(s->frame_timer);
1b1995
 }
1b1995
 
1b1995
 static uint32_t ehci_mem_readb(void *ptr, target_phys_addr_t addr)
1b1995
@@ -1059,7 +1060,7 @@ static void ehci_mem_writel(void *ptr, target_phys_addr_t addr, uint32_t val)
1b1995
 
1b1995
         if (val & USBCMD_HCRESET) {
1b1995
             ehci_reset(s);
1b1995
-            val &= ~USBCMD_HCRESET;
1b1995
+            val = s->usbcmd;
1b1995
         }
1b1995
 
1b1995
         /* not supporting dynamic frame list size at the moment */
1b1995
-- 
1b1995
1.7.9.3
1b1995