aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2011-06-10 14:38:08 +0200
committerGerd Hoffmann <kraxel@redhat.com>2011-06-14 12:56:50 +0200
commit94cc916a8c7e631afc650cb3c9c2832167b0dd8f (patch)
treeadacdebceeb265d4cfa27c250ffed5206e8ef478 /hw
parent9bba1eb180cb9b08ee1a53c19c52ee57253ac8c2 (diff)
downloadqemu-94cc916a8c7e631afc650cb3c9c2832167b0dd8f.zip
qemu-94cc916a8c7e631afc650cb3c9c2832167b0dd8f.tar.gz
qemu-94cc916a8c7e631afc650cb3c9c2832167b0dd8f.tar.bz2
usb-uhci: fix expire time initialization.
expire_time must be initialited when the guest activates the usb scheduler, not at device creation time. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb-uhci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index 1503373..75cd231 100644
--- a/hw/usb-uhci.c
+++ b/hw/usb-uhci.c
@@ -424,6 +424,8 @@ static void uhci_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
case 0x00:
if ((val & UHCI_CMD_RS) && !(s->cmd & UHCI_CMD_RS)) {
/* start frame processing */
+ s->expire_time = qemu_get_clock_ns(vm_clock) +
+ (get_ticks_per_sec() / FRAME_TIMER_FREQ);
qemu_mod_timer(s->frame_timer, qemu_get_clock_ns(vm_clock));
s->status &= ~UHCI_STS_HCHALTED;
} else if (!(val & UHCI_CMD_RS)) {
@@ -1131,8 +1133,6 @@ static int usb_uhci_common_initfn(UHCIState *s)
usb_port_location(&s->ports[i].port, NULL, i+1);
}
s->frame_timer = qemu_new_timer_ns(vm_clock, uhci_frame_timer, s);
- s->expire_time = qemu_get_clock_ns(vm_clock) +
- (get_ticks_per_sec() / FRAME_TIMER_FREQ);
s->num_ports_vmstate = NB_PORTS;
QTAILQ_INIT(&s->async_pending);