linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/intel: disable DMAR for g4x integrated gfx
@ 2013-01-20 22:50 Daniel Vetter
  2013-01-21 19:03 ` David Woodhouse
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2013-01-20 22:50 UTC (permalink / raw)
  To: Intel Graphics Development
  Cc: DRI Development, LKML, Daniel Vetter, Adam Jackson,
	David Woodhouse, stable

DMAR support on g4x/gm45 integrated gpus seems to be totally busted.
So don't bother, but instead disable it by default to allow distros to
unconditionally enable DMAR support.

v2: Actually wire up the right quirk entry, spotted by Adam Jackson.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=51921
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=538163
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=538163
Cc: Adam Jackson <ajax@redhat.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: stable@vger.kernel.org
Tested-by: stathis <stathis@npcglib.org>
Tested-by: Mihai Moldovan <ionic@ionic.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/iommu/intel-iommu.c |   21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index d4a4cd4..9743769 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -4196,6 +4196,21 @@ static struct iommu_ops intel_iommu_ops = {
 	.pgsize_bitmap	= INTEL_IOMMU_PGSIZES,
 };
 
+static void __devinit quirk_iommu_g4x_gfx(struct pci_dev *dev)
+{
+	/* G4x/GM45 integrated gfx dmar support is totally busted. */
+	printk(KERN_INFO "DMAR: Disabling IOMMU for graphics on this chipset\n");
+	dmar_map_gfx = 0;
+}
+
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_g4x_gfx);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e00, quirk_iommu_g4x_gfx);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e10, quirk_iommu_g4x_gfx);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e20, quirk_iommu_g4x_gfx);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e30, quirk_iommu_g4x_gfx);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e40, quirk_iommu_g4x_gfx);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e90, quirk_iommu_g4x_gfx);
+
 static void __devinit quirk_iommu_rwbf(struct pci_dev *dev)
 {
 	/*
@@ -4204,12 +4219,6 @@ static void __devinit quirk_iommu_rwbf(struct pci_dev *dev)
 	 */
 	printk(KERN_INFO "DMAR: Forcing write-buffer flush capability\n");
 	rwbf_quirk = 1;
-
-	/* https://bugzilla.redhat.com/show_bug.cgi?id=538163 */
-	if (dev->revision == 0x07) {
-		printk(KERN_INFO "DMAR: Disabling IOMMU for graphics on this chipset\n");
-		dmar_map_gfx = 0;
-	}
 }
 
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iommu/intel: disable DMAR for g4x integrated gfx
  2013-01-20 22:50 [PATCH] iommu/intel: disable DMAR for g4x integrated gfx Daniel Vetter
@ 2013-01-21 19:03 ` David Woodhouse
  2013-01-22 22:39   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: David Woodhouse @ 2013-01-21 19:03 UTC (permalink / raw)
  To: Daniel Vetter, Sankaran, Rajesh
  Cc: Intel Graphics Development, DRI Development, LKML, Adam Jackson, stable

[-- Attachment #1: Type: text/plain, Size: 692 bytes --]

On Sun, 2013-01-20 at 23:50 +0100, Daniel Vetter wrote:
> DMAR support on g4x/gm45 integrated gpus seems to be totally busted.
> So don't bother, but instead disable it by default to allow distros to
> unconditionally enable DMAR support.

Acked-By: David Woodhouse <David.Woodhouse@intel.com>

It *really* winds me up that we never bother to test this hardware
before we ship it.

But I'm even *more* disappointed that we can't even diagnose it and
publish coherent errata *after* the fact. I'd really like to see each
quirk which disables features referencing a specific published erratum.
We really ought to be able to manage at least *that* much.

Rajesh?

-- 
dwmw2


[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 6171 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iommu/intel: disable DMAR for g4x integrated gfx
  2013-01-21 19:03 ` David Woodhouse
@ 2013-01-22 22:39   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2013-01-22 22:39 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Daniel Vetter, Sankaran, Rajesh, Intel Graphics Development,
	DRI Development, LKML, Adam Jackson, stable

On Mon, Jan 21, 2013 at 01:03:48PM -0600, David Woodhouse wrote:
> On Sun, 2013-01-20 at 23:50 +0100, Daniel Vetter wrote:
> > DMAR support on g4x/gm45 integrated gpus seems to be totally busted.
> > So don't bother, but instead disable it by default to allow distros to
> > unconditionally enable DMAR support.
> 
> Acked-By: David Woodhouse <David.Woodhouse@intel.com>

Ok, I've picked that up into my drm-intel-fixes tree and will send it off
to Dave in the next few days.

> It *really* winds me up that we never bother to test this hardware
> before we ship it.
> 
> But I'm even *more* disappointed that we can't even diagnose it and
> publish coherent errata *after* the fact. I'd really like to see each
> quirk which disables features referencing a specific published erratum.
> We really ought to be able to manage at least *that* much.
> 
> Rajesh?

Yeah, some real quirk notice would be nice. I've hunted down the gen4
errata sheets, but there's nothing in there about the gfx not working for
dmar. Hence I'm opting for a working gpu in case of doubts.

Also note that according to intel docs only the gm45 and g45 have vt-d
support. So with this bug report we have them all covered. I've still left
all the other gen4 ids in the quirk tables, just in case intel marketing
materials win another round against me. Instead amended the commit message
a bit.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-22 22:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-20 22:50 [PATCH] iommu/intel: disable DMAR for g4x integrated gfx Daniel Vetter
2013-01-21 19:03 ` David Woodhouse
2013-01-22 22:39   ` Daniel Vetter

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).