[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 16/26] uhci: Maximize how many frames we catch up wh
From: |
Hans de Goede |
Subject: |
[Qemu-devel] [PATCH 16/26] uhci: Maximize how many frames we catch up when behind |
Date: |
Fri, 14 Dec 2012 14:35:37 +0100 |
If somehow we've gotten behind a lot, simply skip ahead, like the ehci code
does.
Signed-off-by: Hans de Goede <address@hidden>
---
hw/usb/hcd-uhci.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 2a5d4cc..fa75a77 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.8.0.1
- Re: [Qemu-devel] [PATCH 09/26] ehci: Use uframe precision for interrupt threshold checking, (continued)
- [Qemu-devel] [PATCH 12/26] uhci: Fix 1 ms delay in interrupt reporting to the guest, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 10/26] ehci: Further speedup rescanning if async schedule after raising an interrupt, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 11/26] ehci: Don't call commit_irq after raising PCD, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 13/26] uhci: Fix pending interrupts getting lost on migration, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 14/26] uhci: Add a QH_VALID define, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 17/26] hid: Change idle handling to use a timer, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 15/26] uhci: Limit amount of frames processed in one go, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 20/26] usbredir: Add an usbredir_stop_ep helper function, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 19/26] usb: Add an usb_device_ep_stopped USBDevice method, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 16/26] uhci: Maximize how many frames we catch up when behind,
Hans de Goede <=
- [Qemu-devel] [PATCH 21/26] usbredir: Add USBEP2I and I2USBEP helper macros, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 22/26] usbredir: Add ep_stopped USBDevice method, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 23/26] usbredir: Verify we have 32 bits bulk length cap when redirecting to xhci, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 26/26] usbredir: Add support for buffered bulk input, Hans de Goede, 2012/12/14
[Qemu-devel] [PATCH 24/26] usbredir: Add usbredir_init_endpoints() helper, Hans de Goede, 2012/12/14
[Qemu-devel] [PATCH 25/26] usb-redir: Add debugging to bufpq save / restore, Hans de Goede, 2012/12/14