From 9636beca521c90babc3424789dd13317806d36f7 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 2 Oct 2013 07:00:19 +0200 Subject: [PATCH 7/8] xhci adaptions for old rhel7 seabios codebase RH-Author: Gerd Hoffmann Message-id: <1380697219-1860-8-git-send-email-kraxel@redhat.com> Patchwork-id: 54631 O-Subject: [RHEL-7 seabios PATCH 7/7] xhci adaptions for old rhel7 seabios codebase Bugzilla: 947051 RH-Acked-by: Laszlo Ersek RH-Acked-by: Bandan Das RH-Acked-by: Miroslav Rezanina Kept as separate commit to make review easier. rhel-only patch for obvious reasons. Signed-off-by: Gerd Hoffmann --- src/Kconfig | 2 +- src/usb-xhci.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) Signed-off-by: Miroslav Rezanina --- src/Kconfig | 2 +- src/usb-xhci.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Kconfig b/src/Kconfig index b059a73..d00c66c 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -185,7 +185,7 @@ menu "Hardware support" help Support USB EHCI controllers. config USB_XHCI - depends on USB && QEMU_HARDWARE + depends on USB && QEMU bool "USB XHCI controllers" default y help diff --git a/src/usb-xhci.c b/src/usb-xhci.c index 5be0b25..3a4f3e0 100644 --- a/src/usb-xhci.c +++ b/src/usb-xhci.c @@ -1,5 +1,6 @@ #include "config.h" // CONFIG_* #include "util.h" // timer_calc +#include "list.h" // timer_calc #include "pci.h" // pci_bdf_to_bus #include "pci_regs.h" // PCI_BASE_ADDRESS_0 #include "usb.h" // struct usb_s @@ -387,7 +388,7 @@ static int xhci_event_wait(struct usb_xhci_s *xhci, struct xhci_ring *ring, u32 timeout) { - u32 end = timer_calc(timeout); + u64 end = calc_future_tsc(timeout); for (;;) { xhci_process_events(xhci); @@ -395,7 +396,7 @@ static int xhci_event_wait(struct usb_xhci_s *xhci, u32 status = GET_LOWFLAT(ring->evt.status); return (status >> 24) & 0xff; } - if (timer_check(end)) { + if (check_tsc(end)) { warn_timeout(); return -1; } @@ -482,10 +483,10 @@ static void xhci_xfer_normal(struct xhci_pipe *pipe, static int wait_bit(u32 *reg, u32 mask, int value, u32 timeout) { ASSERT32FLAT(); - u32 end = timer_calc(timeout); + u64 end = calc_future_tsc(timeout); while ((readl(reg) & mask) != value) { - if (timer_check(end)) { + if (check_tsc(end)) { warn_timeout(); return -1; } -- 1.7.1