Skip to contentSkip to conversation

x86: fix iommu=nodac parameter handling

PATCH In review Tejun Heo 2 participants 6 messages Mar 4, 2009 x86

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/2 x86: fix iommu=nodac parameter handling

nodac should forbid dac not instead of enabling it. Fix it.

---
 arch/x86/kernel/pci-dma.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/pci-dma.c +1 -1
index b254285..69c7a8d 100644
@@ -197,7 +197,7 @@ static __init int iommu_setup(char *p)
 		if (!strncmp(p, "allowdac", 8))
 			forbid_dac = 0;
 		if (!strncmp(p, "nodac", 5))
-			forbid_dac = -1;
+			forbid_dac = 1;
 		if (!strncmp(p, "usedac", 6)) {
 			forbid_dac = -1;
 			return 1;
author
#1 lore raw

PATCH 2/2 x86: disallow DAC for MCP51 PCI bridge

MCP51 corrupts DAC transfers. Disallow it. Reported by pgnet on bnc#463829.

https://bugzilla.novell.com/show_bug.cgi?id=463829

---
 arch/x86/kernel/pci-dma.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/x86/kernel/pci-dma.c +14 -0
index b254285..7b61798 100644
@@ -296,4 +296,18 @@ static __devinit void via_no_dac(struct pci_dev *dev)
 	}
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_ANY_ID, via_no_dac);
+
+/*
+ * MCP51 PCI bridge corrupts data for DAC.  Disable it.  Reported in
+ * bnc#463829.
+ */
+static __devinit void mcp51_no_dac(struct pci_dev *dev)
+{
+	if (forbid_dac == 0) {
+		printk(KERN_INFO
+		       "PCI: MCP51 PCI bridge detected. Disabling DAC.\n");
+		forbid_dac = 1;
+	}
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x026f, mcp51_no_dac);
 #endif
#2 lore raw

Re: [PATCH 2.6.29-rc7 2/2] x86: disallow DAC for MCP51 PCI bridge

Quoted 2 lines · On Wed, 04 Mar 2009 11:39:15 +0900 Tejun Heo <[email protected]> wrote:

MCP51 corrupts DAC transfers. Disallow it. Reported by pgnet on bnc#463829.

So you have a single piece of evidence as I read it - from a single board that represents system with a very common chipset and no supporting errata information from the vendor.

That bug could easily be a faulty motherboard or dodgy connector or a specific hardware compatibility issue between two specific components. I don't think that can be considered sufficient evidence for adding sledgehammer sized workarounds that harm everyone elses performance and cripples such systems for certain kinds of work (eg video)

Insufficient evidence and google searches and other bug searches don't seem to be turning up any parallel cases so for the moment At the very least someone needs to reproduce the hardware configuration and see the same problem, and then repeat with a different DAC enabled card.

I don't believe this patch should go in ... yet. More information/testing is needed.

Alan

author
#3 lore raw

Re: [PATCH 2.6.29-rc7 2/2] x86: disallow DAC for MCP51 PCI bridge

Quoted 16 lines · Alan Cox
Quoted 2 lines · On Wed, 04 Mar 2009 11:39:15 +0900 Tejun Heo <[email protected]> wrote:

MCP51 corrupts DAC transfers. Disallow it. Reported by pgnet on bnc#463829.

So you have a single piece of evidence as I read it - from a single board that represents system with a very common chipset and no supporting errata information from the vendor.

That bug could easily be a faulty motherboard or dodgy connector or a specific hardware compatibility issue between two specific components. I don't think that can be considered sufficient evidence for adding sledgehammer sized workarounds that harm everyone elses performance and cripples such systems for certain kinds of work (eg video)

Quoted 7 lines

Insufficient evidence and google searches and other bug searches don't seem to be turning up any parallel cases so for the moment At the very least someone needs to reproduce the hardware configuration and see the same problem, and then repeat with a different DAC enabled card.

I don't believe this patch should go in ... yet. More information/testing is needed.

x86 is blacklisting DAC for everything VIA. :-)

* MCP51 is a very old chipset at this point (it's circa 2005). Not many machine would be running with >4GB memory to begin with.

* Given the above and scarcity of DAC on most end user machines (nothing on MCP51 does DAC by default), lack of reports isn't too surprising.

* The board doesn't have a 64bit connector. It can't be dodgy connector and sil24 is known to behave well with DAC. The failure being specific to the particular machine doesn't seem likely.

I'll ping nvidia about it but I think your bar is too high.

Thanks.

Signature · 1 line
tejun
#4 lore raw

Re: [PATCH 2.6.29-rc7 2/2] x86: disallow DAC for MCP51 PCI bridge

Quoted 1 line

x86 is blacklisting DAC for everything VIA. :-)

I'd assume that comes from published docs given VIA actually publish stuff if you ask nicely.

Quoted 8 lines

* MCP51 is a very old chipset at this point (it's circa 2005). Not many machine would be running with >4GB memory to begin with.

* Given the above and scarcity of DAC on most end user machines (nothing on MCP51 does DAC by default), lack of reports isn't too surprising.

Quoted 5 lines

* The board doesn't have a 64bit connector. It can't be dodgy connector and sil24 is known to behave well with DAC. The failure being specific to the particular machine doesn't seem likely.

I'll ping nvidia about it but I think your bar is too high.

I don't think wanting to see *two* examples is a high bar.

author
#5 lore raw

Re: [PATCH 2.6.29-rc7 2/2] x86: disallow DAC for MCP51 PCI bridge

Quoted 4 lines · Alan Cox
Quoted 1 line

x86 is blacklisting DAC for everything VIA. :-)

I'd assume that comes from published docs given VIA actually publish stuff if you ask nicely.

Dunno the history but it's from the time before VIA begins publishing. It's probably worthwhile to refine the blacklisting.

Quoted 7 lines
Quoted 7 lines

* MCP51 is a very old chipset at this point (it's circa 2005). Not many machine would be running with >4GB memory to begin with.

* Given the above and scarcity of DAC on most end user machines (nothing on MCP51 does DAC by default), lack of reports isn't too surprising.

Quoted 7 lines
Quoted 5 lines

* The board doesn't have a 64bit connector. It can't be dodgy connector and sil24 is known to behave well with DAC. The failure being specific to the particular machine doesn't seem likely.

I'll ping nvidia about it but I think your bar is too high.

I don't think wanting to see *two* examples is a high bar.

I don't think it's an easy combination. Circa 2005 desktop machine with >4GB ram + DAC capable controller running Linux with owner who will report seemingly random data corruption which will end up in the correct hands and given that non-working DAC isn't too surprising of the machines of that time and isn't very likely caused by random component or connection failure, I think we'll be better off just blacklisting it. That said, I admit I'm more trigger happy with blacklists than some people (I think it's generally better to have working systems than chasing performance on not-so-common cases).

Anyways, I pinged Peer Chen on the issue. Let's see whether he can confirm it.

Thanks.

Signature · 1 line
tejun