[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 27/37] ehci: move async schedule to bottom half
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 27/37] ehci: move async schedule to bottom half |
Date: |
Thu, 7 Jun 2012 11:31:16 +0200 |
This way we can kick the async schedule independant from the
periodic frame timer.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-ehci.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index f363f14..16627d3 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -414,6 +414,7 @@ struct EHCIState {
* Internal states, shadow registers, etc
*/
QEMUTimer *frame_timer;
+ QEMUBH *async_bh;
int attach_poll_counter;
int astate; // Current state in asynchronous
schedule
int pstate; // Current state in periodic schedule
@@ -959,6 +960,7 @@ static void ehci_reset(void *opaque)
ehci_queues_rip_all(s, 0);
ehci_queues_rip_all(s, 1);
qemu_del_timer(s->frame_timer);
+ qemu_bh_cancel(s->async_bh);
}
static uint32_t ehci_mem_readb(void *ptr, target_phys_addr_t addr)
@@ -1111,6 +1113,7 @@ static void ehci_mem_writel(void *ptr, target_phys_addr_t
addr, uint32_t val)
if (!(val & USBCMD_RUNSTOP) && (s->usbcmd & USBCMD_RUNSTOP)) {
qemu_del_timer(s->frame_timer);
+ qemu_bh_cancel(s->async_bh);
ehci_queues_rip_all(s, 0);
ehci_queues_rip_all(s, 1);
ehci_set_usbsts(s, USBSTS_HALT);
@@ -2290,11 +2293,16 @@ static void ehci_frame_timer(void *opaque)
/* Async is not inside loop since it executes everything it can once
* called
*/
- ehci_advance_async_state(ehci);
+ qemu_bh_schedule(ehci->async_bh);
qemu_mod_timer(ehci->frame_timer, expire_time);
}
+static void ehci_async_bh(void *opaque)
+{
+ EHCIState *ehci = opaque;
+ ehci_advance_async_state(ehci);
+}
static const MemoryRegionOps ehci_mem_ops = {
.old_mmio = {
@@ -2430,6 +2438,7 @@ static int usb_ehci_initfn(PCIDevice *dev)
}
s->frame_timer = qemu_new_timer_ns(vm_clock, ehci_frame_timer, s);
+ s->async_bh = qemu_bh_new(ehci_async_bh, s);
QTAILQ_INIT(&s->aqueues);
QTAILQ_INIT(&s->pqueues);
--
1.7.1
- [Qemu-devel] [PATCH 25/37] ehci: tweak queue initialization, (continued)
- [Qemu-devel] [PATCH 25/37] ehci: tweak queue initialization, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 08/37] usb-storage: remove MSDState->residue, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 03/37] uhci: make bandwidth tunable, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 17/37] xhci: trace: endpoints, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 29/37] ehci: kick async schedule on wakeup, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 05/37] uhci: zap uhci_pre_save, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 30/37] ehci: fix reset, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 04/37] uhci: fix trace format strings, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 09/37] usb-storage: add usb_msd_packet_complete(), Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 32/37] ehci: update status bits in ehci_set_state, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 27/37] ehci: move async schedule to bottom half,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 01/37] uhci: fix bandwidth management, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 22/37] ehci: cache USBDevice in EHCIQueue, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 10/37] usb-storage: add scsi_off, remove scsi_buf, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 06/37] uhci: fix irq routing, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 18/37] xhci: trace: transfers, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 26/37] ehci: add async field to EHCIQueue, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 12/37] xhci: Clean up reset function, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 21/37] ehci: make ehci_execute work on EHCIPacket instead of EHCIQueue, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 11/37] usb-storage: migration support, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 07/37] scsi: prepare migration code for usb-storage support, Gerd Hoffmann, 2012/06/07