From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: linux-kernel@vger.kernel.org
Subject: [PATCH v3] Fix dma_mapping_error for 32bit x86
Date: Sat, 29 Nov 2008 13:46:27 +0100 (CET) [thread overview]
Message-ID: <20081129124627.F2ABDFA8C8@solo.franken.de> (raw)
Devices like b44 ethernet can't dma from addresses above 1GB. The driver
handles this cases by falling back to GFP_DMA allocation. But for detecting
the problem it needs to get an indication from dma_mapping_error.
The bug is triggered by using a VMSPLIT option of 2G/2G.
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---
diff -ru orig/linux-2.6.27.4/include/asm-x86/dma-mapping.h linux-2.6.27.4/include/asm-x86/dma-mapping.h
--- orig/linux-2.6.27.4/include/asm-x86/dma-mapping.h 2008-10-26 00:05:07.000000000 +0200
+++ linux-2.6.27.4/include/asm-x86/dma-mapping.h 2008-10-26 11:06:14.000000000 +0100
@@ -74,15 +74,13 @@
/* Make sure we keep the same behaviour */
static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
{
-#ifdef CONFIG_X86_32
- return 0;
-#else
+#ifdef CONFIG_X86_64
struct dma_mapping_ops *ops = get_dma_ops(dev);
if (ops->mapping_error)
return ops->mapping_error(dev, dma_addr);
- return (dma_addr == bad_dma_address);
#endif
+ return (dma_addr == bad_dma_address);
}
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
next reply other threads:[~2008-11-29 13:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-29 12:46 Thomas Bogendoerfer [this message]
2008-11-29 15:13 ` FUJITA Tomonori
2008-12-01 11:34 ` Joerg Roedel
2008-12-01 12:01 ` FUJITA Tomonori
2008-12-01 12:55 ` Ingo Molnar
2008-12-01 14:10 ` FUJITA Tomonori
2008-12-01 14:35 ` Ingo Molnar
2008-12-01 17:17 ` FUJITA Tomonori
2008-12-01 19:36 ` Ingo Molnar
2008-12-01 12:58 ` Joerg Roedel
2008-12-01 14:10 ` FUJITA Tomonori
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=20081129124627.F2ABDFA8C8@solo.franken.de \
--to=tsbogend@alpha.franken.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
Powered by JetHome