* [PATCH] Quirk for IVB graphics FLR errata
@ 2012-02-20 2:27 Hao, Xudong
2012-02-23 18:48 ` Jesse Barnes
0 siblings, 1 reply; 2+ messages in thread
From: Hao, Xudong @ 2012-02-20 2:27 UTC (permalink / raw)
To: jbarnes@virtuousgeek.org, linux-pci@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Kay, Allen M,
Zhang, Xiantao
For IvyBridge Mobile platform, a system hang may occur if a FLR(Function Level Reset) is asserted to internal graphics.
This quirk patch is workaround for the IVB FLR errata issue.
Signed-off-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Kay, Allen M <allen.m.kay@intel.com>
---
drivers/pci/quirks.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 6476547..8bf5b88 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -29,6 +29,10 @@
#include <asm/dma.h> /* isa_dma_bridge_buggy */
#include "pci.h"
+#include <asm/tsc.h>
+/* 10 seconds */
+#define IGD_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000)
+
/*
* This quirk function disables memory decoding and releases memory resources
* of the device specified by kernel's boot parameter 'pci=resource_alignment='.
@@ -3069,11 +3073,53 @@ static int reset_intel_82599_sfp_virtfn(struct pci_dev *dev, int probe)
return 0;
}
+static int reset_ivb_igd(struct pci_dev *dev, int probe)
+{
+ u8 *mmio_base;
+ u32 val;
+
+ if (probe)
+ return 0;
+
+ mmio_base = ioremap_nocache(pci_resource_start(dev, 0),
+ pci_resource_len(dev, 0));
+ if (!mmio_base)
+ return -ENOMEM;
+
+ /* work around */
+ *((u32 *)(mmio_base + 0x45010)) = 0x00000002;
+ *((u32 *)(mmio_base + 0xc2004)) = 0x00000005;
+ val = *((u32 *)(mmio_base + 0xc7204)) & 0xfffffffe;
+ *((u32 *)(mmio_base + 0xc7204)) = val;
+ do {
+ cycles_t start_time = get_cycles();
+ while (1) {
+ val = *((u32 *)(mmio_base + 0xc7200));
+ if (((val & 0x80000000) == 0)
+ && ((val & 0x30000000) == 0))
+ break;
+ if (IGD_OPERATION_TIMEOUT < (get_cycles() - start_time))
+ break;
+ cpu_relax();
+ }
+ } while (0);
+ *((u32 *)(mmio_base + 0xd0100)) = 0x00000002;
+
+ iounmap(pci_resource_start(dev, 0));
+ return 0;
+}
+
#define PCI_DEVICE_ID_INTEL_82599_SFP_VF 0x10ed
+#define PCI_DEVICE_ID_INTEL_IVB_M_VGA 0x0156
+#define PCI_DEVICE_ID_INTEL_IVB_M2_VGA 0x0166
static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82599_SFP_VF,
reset_intel_82599_sfp_virtfn },
+ { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IVB_M_VGA,
+ reset_ivb_igd },
+ { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IVB_M2_VGA,
+ reset_ivb_igd },
{ PCI_VENDOR_ID_INTEL, PCI_ANY_ID,
reset_intel_generic_dev },
{ 0 }
--
1.6.0.rc1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Quirk for IVB graphics FLR errata
2012-02-20 2:27 [PATCH] Quirk for IVB graphics FLR errata Hao, Xudong
@ 2012-02-23 18:48 ` Jesse Barnes
0 siblings, 0 replies; 2+ messages in thread
From: Jesse Barnes @ 2012-02-23 18:48 UTC (permalink / raw)
To: Hao, Xudong
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org, Kay, Allen M, Zhang, Xiantao
[-- Attachment #1: Type: text/plain, Size: 559 bytes --]
On Mon, 20 Feb 2012 02:27:25 +0000
"Hao, Xudong" <xudong.hao@intel.com> wrote:
> For IvyBridge Mobile platform, a system hang may occur if a FLR(Function Level Reset) is asserted to internal graphics.
>
> This quirk patch is workaround for the IVB FLR errata issue.
>
Can you name the magic constants and offsets and document what the FLR
quirk is actually trying to do? IIRC it had something to do with
waiting for the PCH acknowledge for the display portion of the reset...
Thanks,
--
Jesse Barnes, Intel Open Source Technology Center
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-23 18:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-20 2:27 [PATCH] Quirk for IVB graphics FLR errata Hao, Xudong
2012-02-23 18:48 ` Jesse Barnes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).