diff options
author | Nicolas Pitre <nico@cam.org> | 2008-09-09 15:54:13 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2009-03-15 21:01:21 -0400 |
commit | 58edb515724f9e63e569536d01ac8d8f8ddb367a (patch) | |
tree | 627d3eafefd38b031e776b48d8d04d764912ec92 /arch/arm/common/dmabounce.c | |
parent | 43377453af83b8ff8c1c731da1508bd6b84ebfea (diff) |
[ARM] make page_to_dma() highmem aware
If a machine class has a custom __virt_to_bus() implementation then it
must provide a __arch_page_to_dma() implementation as well which is
_not_ based on page_address() to support highmem.
This patch fixes existing __arch_page_to_dma() and provide a default
implementation otherwise. The default implementation for highmem is
based on __pfn_to_bus() which is defined only when no custom
__virt_to_bus() is provided by the machine class.
That leaves only ebsa110 and footbridge which cannot support highmem
until they provide their own __arch_page_to_dma() implementation.
But highmem support on those legacy platforms with limited memory is
certainly not a priority.
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'arch/arm/common/dmabounce.c')
-rw-r--r-- | arch/arm/common/dmabounce.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c index f030f0775be7..734ac9135998 100644 --- a/arch/arm/common/dmabounce.c +++ b/arch/arm/common/dmabounce.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/init.h> | 26 | #include <linux/init.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/page-flags.h> | ||
28 | #include <linux/device.h> | 29 | #include <linux/device.h> |
29 | #include <linux/dma-mapping.h> | 30 | #include <linux/dma-mapping.h> |
30 | #include <linux/dmapool.h> | 31 | #include <linux/dmapool.h> |
@@ -349,6 +350,12 @@ dma_addr_t dma_map_page(struct device *dev, struct page *page, | |||
349 | 350 | ||
350 | BUG_ON(!valid_dma_direction(dir)); | 351 | BUG_ON(!valid_dma_direction(dir)); |
351 | 352 | ||
353 | if (PageHighMem(page)) { | ||
354 | dev_err(dev, "DMA buffer bouncing of HIGHMEM pages " | ||
355 | "is not supported\n"); | ||
356 | return ~0; | ||
357 | } | ||
358 | |||
352 | return map_single(dev, page_address(page) + offset, size, dir); | 359 | return map_single(dev, page_address(page) + offset, size, dir); |
353 | } | 360 | } |
354 | EXPORT_SYMBOL(dma_map_page); | 361 | EXPORT_SYMBOL(dma_map_page); |