Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 161781
b: refs/heads/master
c: 80d3e8a
h: refs/heads/master
i:
  161779: f4d4d50
v: v3
  • Loading branch information
FUJITA Tomonori authored and Benjamin Herrenschmidt committed Aug 28, 2009
1 parent e292a02 commit f1878b5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4a9a6bfe707cfe5bcb0a20eabe240293a095cd10
refs/heads/master: 80d3e8abb73dad3983fef2597b52cab8fbcd876b
1 change: 1 addition & 0 deletions trunk/arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ config PPC
select HAVE_ARCH_TRACEHOOK
select HAVE_LMB
select HAVE_DMA_ATTRS
select HAVE_DMA_API_DEBUG
select USE_GENERIC_SMP_HELPERS if SMP
select HAVE_OPROFILE
select HAVE_SYSCALL_WRAPPERS if PPC64
Expand Down
11 changes: 10 additions & 1 deletion trunk/arch/powerpc/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,15 @@ static inline void *dma_alloc_coherent(struct device *dev, size_t size,
dma_addr_t *dma_handle, gfp_t flag)
{
struct dma_map_ops *dma_ops = get_dma_ops(dev);
void *cpu_addr;

BUG_ON(!dma_ops);
return dma_ops->alloc_coherent(dev, size, dma_handle, flag);

cpu_addr = dma_ops->alloc_coherent(dev, size, dma_handle, flag);

debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr);

return cpu_addr;
}

static inline void dma_free_coherent(struct device *dev, size_t size,
Expand All @@ -138,6 +144,9 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
struct dma_map_ops *dma_ops = get_dma_ops(dev);

BUG_ON(!dma_ops);

debug_dma_free_coherent(dev, size, cpu_addr, dma_handle);

dma_ops->free_coherent(dev, size, cpu_addr, dma_handle);
}

Expand Down
11 changes: 11 additions & 0 deletions trunk/arch/powerpc/kernel/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/dma-debug.h>
#include <linux/lmb.h>
#include <asm/bug.h>
#include <asm/abs_addr.h>
Expand Down Expand Up @@ -156,3 +157,13 @@ struct dma_map_ops dma_direct_ops = {
#endif
};
EXPORT_SYMBOL(dma_direct_ops);

#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)

static int __init dma_init(void)
{
dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);

return 0;
}
fs_initcall(dma_init);

0 comments on commit f1878b5

Please sign in to comment.