[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 16/32] uhci: Maximize how many frames we catch up wh
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 16/32] uhci: Maximize how many frames we catch up when behind |
Date: |
Tue, 8 Jan 2013 14:14:38 +0100 |
From: Hans de Goede <address@hidden>
If somehow we've gotten behind a lot, simply skip ahead, like the ehci code
does.
Signed-off-by: Hans de Goede <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-uhci.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index e5c3e59..bd3377e 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -171,6 +171,7 @@ struct UHCIState {
/* Properties */
char *masterbus;
uint32_t firstport;
+ uint32_t maxframes;
};
typedef struct UHCI_TD {
@@ -1201,6 +1202,12 @@ static void uhci_frame_timer(void *opaque)
/* Process up to MAX_FRAMES_PER_TICK frames */
frames = (t_now - t_last_run) / frame_t;
+ if (frames > s->maxframes) {
+ int skipped = frames - s->maxframes;
+ s->expire_time += skipped * frame_t;
+ s->frnum = (s->frnum + skipped) & 0x7ff;
+ frames -= skipped;
+ }
if (frames > MAX_FRAMES_PER_TICK) {
frames = MAX_FRAMES_PER_TICK;
}
@@ -1326,6 +1333,7 @@ static Property uhci_properties[] = {
DEFINE_PROP_STRING("masterbus", UHCIState, masterbus),
DEFINE_PROP_UINT32("firstport", UHCIState, firstport, 0),
DEFINE_PROP_UINT32("bandwidth", UHCIState, frame_bandwidth, 1280),
+ DEFINE_PROP_UINT32("maxframes", UHCIState, maxframes, 128),
DEFINE_PROP_END_OF_LIST(),
};
--
1.7.1
- [Qemu-devel] [PATCH 26/32] xhci: call set-address with dummy usbpacket, (continued)
- [Qemu-devel] [PATCH 26/32] xhci: call set-address with dummy usbpacket, Gerd Hoffmann, 2013/01/08
- [Qemu-devel] [PATCH 13/32] uhci: Fix pending interrupts getting lost on migration, Gerd Hoffmann, 2013/01/08
- [Qemu-devel] [PATCH 15/32] uhci: Limit amount of frames processed in one go, Gerd Hoffmann, 2013/01/08
- [Qemu-devel] [PATCH 23/32] usbredir: Verify we have 32 bits bulk length cap when redirecting to xhci, Gerd Hoffmann, 2013/01/08
- [Qemu-devel] [PATCH 30/32] exynos4210: Add EHCI support, Gerd Hoffmann, 2013/01/08
- [Qemu-devel] [PATCH 20/32] usbredir: Add an usbredir_stop_ep helper function, Gerd Hoffmann, 2013/01/08
- [Qemu-devel] [PATCH 22/32] usbredir: Add ep_stopped USBDevice method, Gerd Hoffmann, 2013/01/08
- [Qemu-devel] [PATCH 32/32] uhci: stop using portio lists, Gerd Hoffmann, 2013/01/08
- [Qemu-devel] [PATCH 28/32] usb/ehci: Move capsbase and opregbase into SysBus EHCI class, Gerd Hoffmann, 2013/01/08
- [Qemu-devel] [PATCH 24/32] usbredir: Add usbredir_init_endpoints() helper, Gerd Hoffmann, 2013/01/08
- [Qemu-devel] [PATCH 16/32] uhci: Maximize how many frames we catch up when behind,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 27/32] usb/ehci: Clean up SysBus and PCI EHCI split, Gerd Hoffmann, 2013/01/08
- [Qemu-devel] [PATCH 18/32] usb: Fix usb_ep_find_packet_by_id, Gerd Hoffmann, 2013/01/08
- [Qemu-devel] [PATCH 31/32] usbredir: Add support for buffered bulk input (v2), Gerd Hoffmann, 2013/01/08
- Re: [Qemu-devel] [PULL 00/32] usb patch queue, Anthony Liguori, 2013/01/08