From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWRRZ-0007Gd-VQ for qemu-devel@nongnu.org; Tue, 14 Jun 2011 07:06:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWRRV-0003uW-1u for qemu-devel@nongnu.org; Tue, 14 Jun 2011 07:06:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWRRU-0003u8-89 for qemu-devel@nongnu.org; Tue, 14 Jun 2011 07:05:56 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5EB5tv9004239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 14 Jun 2011 07:05:55 -0400 From: Gerd Hoffmann Date: Tue, 14 Jun 2011 13:05:52 +0200 Message-Id: <1308049552-5744-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1308049552-5744-1-git-send-email-kraxel@redhat.com> References: <1308049552-5744-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 34/34] usb-uhci: fix expire time initialization. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann expire_time must be initialited when the guest activates the usb scheduler, not at device creation time. Signed-off-by: Gerd Hoffmann --- hw/usb-uhci.c | 4 ++-- 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); -- 1.7.1