Commit 6c58e144 authored by Gerd Hoffmann's avatar Gerd Hoffmann Committed by Greg Kroah-Hartman

ohci-pci: add qemu quirk

commit 21a60f6e upstream.

On a loaded virtualization host (dozen guests booting at the same time)
it may happen that the ohci controller emulation doesn't manage to do
timely frame processing, with the result that the io watchdog fires and
considers the controller being dead, even though it's only the emulation
being unusual slow due to the load peak.

So, add a quirk for qemu and don't use the watchdog in case we figure we
are running on emulated ohci.  The virtual ohci controller masquerades
as apple ohci controller, but we can identify it by subsystem id.
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a83f3099
...@@ -231,7 +231,8 @@ static int ohci_urb_enqueue ( ...@@ -231,7 +231,8 @@ static int ohci_urb_enqueue (
/* Start up the I/O watchdog timer, if it's not running */ /* Start up the I/O watchdog timer, if it's not running */
if (!timer_pending(&ohci->io_watchdog) && if (!timer_pending(&ohci->io_watchdog) &&
list_empty(&ohci->eds_in_use)) { list_empty(&ohci->eds_in_use) &&
!(ohci->flags & OHCI_QUIRK_QEMU)) {
ohci->prev_frame_no = ohci_frame_no(ohci); ohci->prev_frame_no = ohci_frame_no(ohci);
mod_timer(&ohci->io_watchdog, mod_timer(&ohci->io_watchdog,
jiffies + IO_WATCHDOG_DELAY); jiffies + IO_WATCHDOG_DELAY);
......
...@@ -164,6 +164,15 @@ static int ohci_quirk_amd700(struct usb_hcd *hcd) ...@@ -164,6 +164,15 @@ static int ohci_quirk_amd700(struct usb_hcd *hcd)
return 0; return 0;
} }
static int ohci_quirk_qemu(struct usb_hcd *hcd)
{
struct ohci_hcd *ohci = hcd_to_ohci(hcd);
ohci->flags |= OHCI_QUIRK_QEMU;
ohci_dbg(ohci, "enabled qemu quirk\n");
return 0;
}
/* List of quirks for OHCI */ /* List of quirks for OHCI */
static const struct pci_device_id ohci_pci_quirks[] = { static const struct pci_device_id ohci_pci_quirks[] = {
{ {
...@@ -214,6 +223,13 @@ static const struct pci_device_id ohci_pci_quirks[] = { ...@@ -214,6 +223,13 @@ static const struct pci_device_id ohci_pci_quirks[] = {
PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4399), PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4399),
.driver_data = (unsigned long)ohci_quirk_amd700, .driver_data = (unsigned long)ohci_quirk_amd700,
}, },
{
.vendor = PCI_VENDOR_ID_APPLE,
.device = 0x003f,
.subvendor = PCI_SUBVENDOR_ID_REDHAT_QUMRANET,
.subdevice = PCI_SUBDEVICE_ID_QEMU,
.driver_data = (unsigned long)ohci_quirk_qemu,
},
/* FIXME for some of the early AMD 760 southbridges, OHCI /* FIXME for some of the early AMD 760 southbridges, OHCI
* won't work at all. blacklist them. * won't work at all. blacklist them.
......
...@@ -418,6 +418,7 @@ struct ohci_hcd { ...@@ -418,6 +418,7 @@ struct ohci_hcd {
#define OHCI_QUIRK_AMD_PLL 0x200 /* AMD PLL quirk*/ #define OHCI_QUIRK_AMD_PLL 0x200 /* AMD PLL quirk*/
#define OHCI_QUIRK_AMD_PREFETCH 0x400 /* pre-fetch for ISO transfer */ #define OHCI_QUIRK_AMD_PREFETCH 0x400 /* pre-fetch for ISO transfer */
#define OHCI_QUIRK_GLOBAL_SUSPEND 0x800 /* must suspend ports */ #define OHCI_QUIRK_GLOBAL_SUSPEND 0x800 /* must suspend ports */
#define OHCI_QUIRK_QEMU 0x1000 /* relax timing expectations */
// there are also chip quirks/bugs in init logic // there are also chip quirks/bugs in init logic
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment