From: Tejun Heo <htejun@gmail.com>
To: ak@suse.de, gregkh@suse.de
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH linux-2.6 01/03] i386_and_x86_64: implement dma_broken_dac() test for i386 and x86_64
Date: Wed, 28 Sep 2005 21:44:11 +0900 (KST) [thread overview]
Message-ID: <20050928124148.A477CC67@htj.dyndns.org> (raw)
In-Reply-To: <20050928124148.EBEDFAFE@htj.dyndns.org>
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 <htejun@gmail.com>
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)
next prev parent reply other threads:[~2005-09-28 12:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-28 12:44 [PATCH linux-2.6 00/03] i386_and_x86_64: implement dma_broken_dac() test Tejun Heo
2005-09-28 12:44 ` Tejun Heo [this message]
2005-09-28 12:44 ` [PATCH linux-2.6 02/03] i386_and_x86_64: check broken_dac to i386 dma_supported() Tejun Heo
2005-09-28 12:44 ` [PATCH linux-2.6 03/03] i386_and_x86_64: check broken_dac to x86_64 dma_supported() Tejun Heo
2005-09-28 12:48 ` [PATCH linux-2.6 00/03] i386_and_x86_64: implement dma_broken_dac() test Andi Kleen
2005-09-28 13:03 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050928124148.A477CC67@htj.dyndns.org \
--to=htejun@gmail.com \
--cc=ak@suse.de \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®