[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/23] ehci: fix reset
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 08/23] ehci: fix reset |
Date: |
Tue, 21 Aug 2012 12:05:42 -0500 |
From: Gerd Hoffmann <address@hidden>
Check for the reset bit first when processing USBCMD register writes.
Also break out of the switch, there is no need to check the other bits.
Signed-off-by: Gerd Hoffmann <address@hidden>
(cherry picked from commit 7046530c36fa3a3f87692bdb54556f5d891a9c03)
Signed-off-by: Michael Roth <address@hidden>
---
hw/usb/hcd-ehci.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index e759c99..5855c5d 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1064,6 +1064,12 @@ static void ehci_mem_writel(void *ptr,
target_phys_addr_t addr, uint32_t val)
/* Do any register specific pre-write processing here. */
switch(addr) {
case USBCMD:
+ if (val & USBCMD_HCRESET) {
+ ehci_reset(s);
+ val = s->usbcmd;
+ break;
+ }
+
if ((val & USBCMD_RUNSTOP) && !(s->usbcmd & USBCMD_RUNSTOP)) {
qemu_mod_timer(s->frame_timer, qemu_get_clock_ns(vm_clock));
SET_LAST_RUN_CLOCK(s);
@@ -1077,10 +1083,6 @@ static void ehci_mem_writel(void *ptr,
target_phys_addr_t addr, uint32_t val)
ehci_set_usbsts(s, USBSTS_HALT);
}
- if (val & USBCMD_HCRESET) {
- ehci_reset(s);
- val = s->usbcmd;
- }
/* not supporting dynamic frame list size at the moment */
if ((val & USBCMD_FLS) && !(s->usbcmd & USBCMD_FLS)) {
--
1.7.9.5
- [Qemu-devel] [stable-1.1] Patch Round-up for stable 1.1.2, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 02/23] configure: Don't override user's --cpu on MacOS and Solaris, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 03/23] ppc: Fix bug in handling of PAPR hypercall exits, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 05/23] kvmvapic: Disable if there is insufficient memory, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 04/23] s390: Fix error handling and condition code of service call, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 01/23] qtest: fix infinite loop when QEMU aborts abruptly, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 07/23] virtio-blk: fix use-after-free while handling scsi commands, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 08/23] ehci: fix reset,
Michael Roth <=
- [Qemu-devel] [PATCH 06/23] qdev: fix use-after-free in the error path of qdev_init_nofail, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 13/23] usb-ehci: Fix an assert whenever isoc transfers are used, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 11/23] usb: restore USBDevice->attached on vmload, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 10/23] uhci: fix uhci_async_cancel_all, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 14/23] qlist: add qlist_size(), Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 09/23] ehci: don't flush cache on doorbell rings., Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 12/23] usb-redir: Correctly handle the usb_redir_babble usbredir status, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 16/23] check-qjson: add test for large JSON objects, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 17/23] slirp: Enforce host-side user of smb share, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 15/23] json-parser: don't replicate tokens at each level of recursion, Michael Roth, 2012/08/21