From c3a44d7c9334f966032927dd605d9592b0fccf1f Mon Sep 17 00:00:00 2001
From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Date: Fri, 15 Sep 2017 15:44:42 +0300
Subject: [PATCH] PCI: Disable broken RTIT_BAR of Intel TH
Patch-mainline: No, from Ubunutu downstream kernel patch
References: bsc#1120318
On some intergrations of the Intel TH the reported size of RTIT_BAR
doesn't match its actual size, which leads to overlaps with other
devices' resources.
For this reason, we need to disable the RTIT_BAR on Denverton where
it would overlap with XHCI MMIO space and effectively kill usb dead.
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
drivers/pci/quirks.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4971,6 +4971,27 @@ static void quirk_intel_no_flr(struct pc
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1502, quirk_intel_no_flr);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1503, quirk_intel_no_flr);
+static void quirk_intel_th_rtit_bar(struct pci_dev *dev)
+{
+ struct resource *r = &dev->resource[4];
+
+ /*
+ * Hello, Denverton!
+ * Denverton reports 2k of RTIT_BAR (resource 4), which can't be
+ * right given the 16 threads. When Intel TH gets enabled, the
+ * actual resource overlaps the XHCI MMIO space and causes it
+ * to die.
+ * We're not really using RTIT_BAR at all at the moment, so it's
+ * a safe choice to disable this resource.
+ */
+ if (r->end == r->start + 0x7ff) {
+ r->flags = 0;
+ r->start = 0;
+ r->end = 0;
+ }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x19e1, quirk_intel_th_rtit_bar);
+
#ifdef CONFIG_PCI_ATS
/*
* Some devices have a broken ATS implementation causing IOMMU stalls.