aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2017-03-20 04:11:49 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-25 09:44:36 -0400
commitfc6b678ab1d47085ee0ab3fae4d5289959b45552 (patch)
treebd9788be9ab6388611192b1b304fb0e7fdd711ca
parent809ae061d998359783c1bb0c52bba14f4a6397c4 (diff)
ohci-pci: add qemu quirk
commit 21a60f6e65181cad64fd66ccc8080d413721ba27 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: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/ohci-hcd.c3
-rw-r--r--drivers/usb/host/ohci-pci.c16
-rw-r--r--drivers/usb/host/ohci.h1
3 files changed, 19 insertions, 1 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 86612ac3fda2..f6c7a2744e5c 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -231,7 +231,8 @@ static int ohci_urb_enqueue (
231 231
232 /* Start up the I/O watchdog timer, if it's not running */ 232 /* Start up the I/O watchdog timer, if it's not running */
233 if (!timer_pending(&ohci->io_watchdog) && 233 if (!timer_pending(&ohci->io_watchdog) &&
234 list_empty(&ohci->eds_in_use)) { 234 list_empty(&ohci->eds_in_use) &&
235 !(ohci->flags & OHCI_QUIRK_QEMU)) {
235 ohci->prev_frame_no = ohci_frame_no(ohci); 236 ohci->prev_frame_no = ohci_frame_no(ohci);
236 mod_timer(&ohci->io_watchdog, 237 mod_timer(&ohci->io_watchdog,
237 jiffies + IO_WATCHDOG_DELAY); 238 jiffies + IO_WATCHDOG_DELAY);
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
index bb1509675727..a84aebe9b0a9 100644
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -164,6 +164,15 @@ static int ohci_quirk_amd700(struct usb_hcd *hcd)
164 return 0; 164 return 0;
165} 165}
166 166
167static int ohci_quirk_qemu(struct usb_hcd *hcd)
168{
169 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
170
171 ohci->flags |= OHCI_QUIRK_QEMU;
172 ohci_dbg(ohci, "enabled qemu quirk\n");
173 return 0;
174}
175
167/* List of quirks for OHCI */ 176/* List of quirks for OHCI */
168static const struct pci_device_id ohci_pci_quirks[] = { 177static const struct pci_device_id ohci_pci_quirks[] = {
169 { 178 {
@@ -214,6 +223,13 @@ static const struct pci_device_id ohci_pci_quirks[] = {
214 PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4399), 223 PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4399),
215 .driver_data = (unsigned long)ohci_quirk_amd700, 224 .driver_data = (unsigned long)ohci_quirk_amd700,
216 }, 225 },
226 {
227 .vendor = PCI_VENDOR_ID_APPLE,
228 .device = 0x003f,
229 .subvendor = PCI_SUBVENDOR_ID_REDHAT_QUMRANET,
230 .subdevice = PCI_SUBDEVICE_ID_QEMU,
231 .driver_data = (unsigned long)ohci_quirk_qemu,
232 },
217 233
218 /* FIXME for some of the early AMD 760 southbridges, OHCI 234 /* FIXME for some of the early AMD 760 southbridges, OHCI
219 * won't work at all. blacklist them. 235 * won't work at all. blacklist them.
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
index 37f1725e7a46..a51b189bdbd8 100644
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -418,6 +418,7 @@ struct ohci_hcd {
418#define OHCI_QUIRK_AMD_PLL 0x200 /* AMD PLL quirk*/ 418#define OHCI_QUIRK_AMD_PLL 0x200 /* AMD PLL quirk*/
419#define OHCI_QUIRK_AMD_PREFETCH 0x400 /* pre-fetch for ISO transfer */ 419#define OHCI_QUIRK_AMD_PREFETCH 0x400 /* pre-fetch for ISO transfer */
420#define OHCI_QUIRK_GLOBAL_SUSPEND 0x800 /* must suspend ports */ 420#define OHCI_QUIRK_GLOBAL_SUSPEND 0x800 /* must suspend ports */
421#define OHCI_QUIRK_QEMU 0x1000 /* relax timing expectations */
421 422
422 // there are also chip quirks/bugs in init logic 423 // there are also chip quirks/bugs in init logic
423 424