dma-mapping: ia64: add CONFIG_DMA_API_DEBUG support

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Joerg Roedel <joerg.roedel@amd.com>
Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: "Luck, Tony" <tony.luck@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc; "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
FUJITA Tomonori 2009-06-17 16:28:14 -07:00 committed by Linus Torvalds
parent d6d0a6aee2
commit 9916219579
2 changed files with 8 additions and 1 deletions

View File

@ -28,6 +28,7 @@ config IA64
select HAVE_DMA_ATTRS select HAVE_DMA_ATTRS
select HAVE_KVM select HAVE_KVM
select HAVE_ARCH_TRACEHOOK select HAVE_ARCH_TRACEHOOK
select HAVE_DMA_API_DEBUG
default y default y
help help
The Itanium Processor Family is Intel's 64-bit successor to The Itanium Processor Family is Intel's 64-bit successor to

View File

@ -8,6 +8,7 @@
#include <asm/machvec.h> #include <asm/machvec.h>
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include <asm/swiotlb.h> #include <asm/swiotlb.h>
#include <linux/dma-debug.h>
#define ARCH_HAS_DMA_GET_REQUIRED_MASK #define ARCH_HAS_DMA_GET_REQUIRED_MASK
@ -24,13 +25,18 @@ static inline void *dma_alloc_coherent(struct device *dev, size_t size,
dma_addr_t *daddr, gfp_t gfp) dma_addr_t *daddr, gfp_t gfp)
{ {
struct dma_map_ops *ops = platform_dma_get_ops(dev); struct dma_map_ops *ops = platform_dma_get_ops(dev);
return ops->alloc_coherent(dev, size, daddr, gfp); void *caddr;
caddr = ops->alloc_coherent(dev, size, daddr, gfp);
debug_dma_alloc_coherent(dev, size, *daddr, caddr);
return caddr;
} }
static inline void dma_free_coherent(struct device *dev, size_t size, static inline void dma_free_coherent(struct device *dev, size_t size,
void *caddr, dma_addr_t daddr) void *caddr, dma_addr_t daddr)
{ {
struct dma_map_ops *ops = platform_dma_get_ops(dev); struct dma_map_ops *ops = platform_dma_get_ops(dev);
debug_dma_free_coherent(dev, size, caddr, daddr);
ops->free_coherent(dev, size, caddr, daddr); ops->free_coherent(dev, size, caddr, daddr);
} }