Re: [PATCH linux-2.6 01/03] i386_and_x86_64: implement dma_broken_dac() test for i386 and x86_64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



01_i386_and_x86_64_implement-dma_broken_dac.patch

	CK804 PCI bridge fails to forward DAC commands from the
	secondary bus to the primary, which is required by PCI
	specification from ver1.1.  This patch implements
	dma_broken_dac() which tests whether there is any such bridge
	among parents of a given device.

Signed-off-by: Tejun Heo <[email protected]>

 quirks.c |   39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

Index: linux-work/arch/i386/kernel/quirks.c
===================================================================
--- linux-work.orig/arch/i386/kernel/quirks.c	2005-09-28 21:41:46.000000000 +0900
+++ linux-work/arch/i386/kernel/quirks.c	2005-09-28 21:41:46.000000000 +0900
@@ -5,6 +5,45 @@
 #include <linux/pci.h>
 #include <linux/irq.h>
 
+/*
+ * The following function is called from dma_supported and needed by
+ * both i386 and x86_64.
+ *
+ * Some bridges fail to forward DAC commands upwards even though it's
+ * required by PCI specification (from 1.1).
+ */
+static struct pci_device_id bridges_with_broken_dac[] = {
+	/* nVidia CK804 PCI Bridge */
+	{ PCI_VENDOR_ID_NVIDIA, 0x005c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+	{ }
+};
+
+int __devinit dma_broken_dac(struct device *dev)
+{
+	struct device *bridge;
+
+	/*
+	 * Disable DAC if any parent bridge has broken DAC support on
+	 * the assumption that memory is located above host bridge.
+	 */
+	bridge = dev->parent;
+	while (bridge && bridge->bus == &pci_bus_type) {
+		const struct pci_device_id *id;
+		id = pci_match_id(bridges_with_broken_dac, to_pci_dev(bridge));
+		if (id) {
+			printk(KERN_WARNING "PCI %s: bridge %s has broken DAC support, 64bit DMA disabled\n",
+			       dev->bus_id, bridge->bus_id);
+			return 1;
+		}
+		bridge = bridge->parent;
+	}
+
+	return 0;
+}
+
+/*
+ * PCI fixups start here
+ */
 #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI)
 
 static void __devinit quirk_intel_irqbalance(struct pci_dev *dev)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux