diff options
| author | Stefan Hajnoczi <stefanha@redhat.com> | 2017-05-30 14:15:09 +0100 |
|---|---|---|
| committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-05-30 14:15:10 +0100 |
| commit | 697e42dec86d9ae706d4ed42c71acb5f35a463c8 (patch) | |
| tree | 9a07c0d1490c761bb0165b2d0d1f4206b7870c49 /hw/usb/hcd-ehci.c | |
| parent | a3203e7dd375d4f619b72b854fcb6d3f2d14bfef (diff) | |
| parent | 3bfecee2cb71f21cd39d6183f18b446c01917573 (diff) | |
| download | focaccia-qemu-697e42dec86d9ae706d4ed42c71acb5f35a463c8.tar.gz focaccia-qemu-697e42dec86d9ae706d4ed42c71acb5f35a463c8.zip | |
Merge remote-tracking branch 'kraxel/tags/pull-usb-20170529-1' into staging
usb: depricate legacy options and hmp commands usb: fixes for ehci and hub, split xhci variants # gpg: Signature made Mon 29 May 2017 02:07:17 PM BST # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * kraxel/tags/pull-usb-20170529-1: ehci: fix frame timer invocation. usb: don't wakeup during coldplug usb-hub: set PORT_STAT_C_SUSPEND on host-initiated wake-up xhci: add CONFIG_USB_XHCI_NEC option xhci: split into multiple files usb: Simplify the parameter parsing of the legacy usb serial device usb: Deprecate HMP commands usb_add and usb_del usb: Deprecate the legacy -usbdevice option ehci: fix overflow in frame timer code Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/usb/hcd-ehci.c')
| -rw-r--r-- | hw/usb/hcd-ehci.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 50ef817f93..17c572c55f 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -2232,13 +2232,13 @@ static void ehci_update_frindex(EHCIState *ehci, int uframes) ehci->frindex = (ehci->frindex + uframes) % 0x4000; } -static void ehci_frame_timer(void *opaque) +static void ehci_work_bh(void *opaque) { EHCIState *ehci = opaque; int need_timer = 0; int64_t expire_time, t_now; uint64_t ns_elapsed; - int uframes, skipped_uframes; + uint64_t uframes, skipped_uframes; int i; t_now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); @@ -2324,6 +2324,13 @@ static void ehci_frame_timer(void *opaque) } } +static void ehci_work_timer(void *opaque) +{ + EHCIState *ehci = opaque; + + qemu_bh_schedule(ehci->async_bh); +} + static const MemoryRegionOps ehci_mmio_caps_ops = { .read = ehci_caps_read, .write = ehci_caps_write, @@ -2478,8 +2485,8 @@ void usb_ehci_realize(EHCIState *s, DeviceState *dev, Error **errp) s->ports[i].dev = 0; } - s->frame_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, ehci_frame_timer, s); - s->async_bh = qemu_bh_new(ehci_frame_timer, s); + s->frame_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, ehci_work_timer, s); + s->async_bh = qemu_bh_new(ehci_work_bh, s); s->device = dev; s->vmstate = qemu_add_vm_change_state_handler(usb_ehci_vm_state_change, s); |