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 02/03] i386_and_x86_64: check broken_dac to i386 dma_supported()
Date: Wed, 28 Sep 2005 21:44:16 +0900 (KST) [thread overview]
Message-ID: <20050928124148.907D946F@htj.dyndns.org> (raw)
In-Reply-To: <20050928124148.EBEDFAFE@htj.dyndns.org>
02_i386_and_x86_64_add-broken-dac-check-to-i386.patch
check for broken_dac in i386 dma_supported() routine. This
disables 64-bit DMA for devices hanging off broken bridges.
Signed-off-by: Tejun Heo <htejun@gmail.com>
arch/i386/kernel/pci-dma.c | 22 ++++++++++++++++++++++
include/asm-i386/dma-mapping.h | 14 +-------------
2 files changed, 23 insertions(+), 13 deletions(-)
Index: linux-work/arch/i386/kernel/pci-dma.c
===================================================================
--- linux-work.orig/arch/i386/kernel/pci-dma.c 2005-09-28 21:41:46.000000000 +0900
+++ linux-work/arch/i386/kernel/pci-dma.c 2005-09-28 21:41:46.000000000 +0900
@@ -72,6 +72,28 @@ void dma_free_coherent(struct device *de
}
EXPORT_SYMBOL(dma_free_coherent);
+int dma_broken_dac(struct device *dev); /* arch/i386/kernel/quirks.c */
+
+int dma_supported(struct device *dev, u64 mask)
+{
+ /*
+ * we fall back to GFP_DMA when the mask isn't all 1s,
+ * so we can't guarantee allocations that must be
+ * within a tighter range than GFP_DMA..
+ */
+ if(mask < 0x00ffffff)
+ return 0;
+
+ /*
+ * Check if there is any bridge with broken DAC support
+ * between the device and memory.
+ */
+ if (mask > 0xffffffff && dma_broken_dac(dev))
+ return 0;
+
+ return 1;
+}
+
int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
dma_addr_t device_addr, size_t size, int flags)
{
Index: linux-work/include/asm-i386/dma-mapping.h
===================================================================
--- linux-work.orig/include/asm-i386/dma-mapping.h 2005-09-28 21:41:46.000000000 +0900
+++ linux-work/include/asm-i386/dma-mapping.h 2005-09-28 21:41:46.000000000 +0900
@@ -120,19 +120,7 @@ dma_mapping_error(dma_addr_t dma_addr)
return 0;
}
-static inline int
-dma_supported(struct device *dev, u64 mask)
-{
- /*
- * we fall back to GFP_DMA when the mask isn't all 1s,
- * so we can't guarantee allocations that must be
- * within a tighter range than GFP_DMA..
- */
- if(mask < 0x00ffffff)
- return 0;
-
- return 1;
-}
+int dma_supported(struct device *dev, u64 mask);
static inline int
dma_set_mask(struct device *dev, u64 mask)
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 ` Tejun Heo [this message]
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.907D946F@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).