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 03/03] i386_and_x86_64: check broken_dac to x86_64 dma_supported()
Date: Wed, 28 Sep 2005 21:44:21 +0900 (KST) [thread overview]
Message-ID: <20050928124148.47752BE1@htj.dyndns.org> (raw)
In-Reply-To: <20050928124148.EBEDFAFE@htj.dyndns.org>
03_i386_and_x86_64_add-broken-dac-check-to-x86_64.patch
check for broken_dac in x86-64 dma_supported() routine. This
disables 64-bit DMA for devices hanging off broken bridges.
Signed-off-by: Tejun Heo <htejun@gmail.com>
arch/x86_64/kernel/pci-gart.c | 5 +++++
arch/x86_64/kernel/pci-nommu.c | 7 +++++++
include/asm-x86_64/proto.h | 3 +++
3 files changed, 15 insertions(+)
Index: linux-work/arch/x86_64/kernel/pci-gart.c
===================================================================
--- linux-work.orig/arch/x86_64/kernel/pci-gart.c 2005-09-28 21:41:46.000000000 +0900
+++ linux-work/arch/x86_64/kernel/pci-gart.c 2005-09-28 21:41:46.000000000 +0900
@@ -645,6 +645,11 @@ int dma_supported(struct device *dev, u6
return 0;
}
+ /* Check if there is any bridge with broken DAC support
+ between the device and memory. Declared in asm/proto.h */
+ if (mask > 0xffffffff && dma_broken_dac(dev))
+ return 0;
+
return 1;
}
Index: linux-work/arch/x86_64/kernel/pci-nommu.c
===================================================================
--- linux-work.orig/arch/x86_64/kernel/pci-nommu.c 2005-09-28 21:41:46.000000000 +0900
+++ linux-work/arch/x86_64/kernel/pci-nommu.c 2005-09-28 21:41:46.000000000 +0900
@@ -71,6 +71,13 @@ int dma_supported(struct device *hwdev,
if (mask < 0x00ffffff)
return 0;
+ /*
+ * Check if there is any bridge with broken DAC support
+ * between the device and memory. Declared in asm/proto.h
+ */
+ if (mask > 0xffffffff && dma_broken_dac(hwdev))
+ return 0;
+
return 1;
}
EXPORT_SYMBOL(dma_supported);
Index: linux-work/include/asm-x86_64/proto.h
===================================================================
--- linux-work.orig/include/asm-x86_64/proto.h 2005-09-28 21:41:46.000000000 +0900
+++ linux-work/include/asm-x86_64/proto.h 2005-09-28 21:41:46.000000000 +0900
@@ -116,6 +116,9 @@ extern void smp_local_timer_interrupt(st
long do_arch_prctl(struct task_struct *task, int code, unsigned long addr);
+struct device;
+extern int dma_broken_dac(struct device *dev); /* arch/i386/kernel/quirks.c */
+
#define round_up(x,y) (((x) + (y) - 1) & ~((y)-1))
#define round_down(x,y) ((x) & ~((y)-1))
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 ` [PATCH linux-2.6 01/03] i386_and_x86_64: implement dma_broken_dac() test for i386 and x86_64 Tejun Heo
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 ` Tejun Heo [this message]
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.47752BE1@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;
as well as URLs for NNTP newsgroup(s).