aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/dma-mapping.h
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2009-08-04 15:08:22 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-08-28 00:24:09 -0400
commit762afb7317b1987fa0851135fe4f2947f68c3c2a (patch)
tree1cf83145c1bdd55b6a166d428af8ee195b09985b /arch/powerpc/include/asm/dma-mapping.h
parent2864697cefb6e7596e39aef933b4131f6c9fa9e1 (diff)
powerpc: Remove addr_needs_map in struct dma_mapping_ops
This patch adds max_direct_dma_addr to struct dev_archdata to remove addr_needs_map in struct dma_mapping_ops. It also converts dma_capable() to use max_direct_dma_addr. max_direct_dma_addr is initialized in pci_dma_dev_setup_swiotlb(), called via ppc_md.pci_dma_dev_setup hook. For further information: http://marc.info/?t=124719060200001&r=1&w=2 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Becky Bruce <beckyb@kernel.crashing.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/dma-mapping.h')
-rw-r--r--arch/powerpc/include/asm/dma-mapping.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index 0c34371ec49c..1765c379138a 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -87,8 +87,6 @@ struct dma_mapping_ops {
87 dma_addr_t dma_address, size_t size, 87 dma_addr_t dma_address, size_t size,
88 enum dma_data_direction direction, 88 enum dma_data_direction direction,
89 struct dma_attrs *attrs); 89 struct dma_attrs *attrs);
90 int (*addr_needs_map)(struct device *dev, dma_addr_t addr,
91 size_t size);
92#ifdef CONFIG_PPC_NEED_DMA_SYNC_OPS 90#ifdef CONFIG_PPC_NEED_DMA_SYNC_OPS
93 void (*sync_single_range_for_cpu)(struct device *hwdev, 91 void (*sync_single_range_for_cpu)(struct device *hwdev,
94 dma_addr_t dma_handle, unsigned long offset, 92 dma_addr_t dma_handle, unsigned long offset,
@@ -426,10 +424,12 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
426 424
427static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) 425static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
428{ 426{
429 struct dma_mapping_ops *ops = get_dma_ops(dev); 427#ifdef CONFIG_SWIOTLB
428 struct dev_archdata *sd = &dev->archdata;
430 429
431 if (ops->addr_needs_map && ops->addr_needs_map(dev, addr, size)) 430 if (sd->max_direct_dma_addr && addr + size > sd->max_direct_dma_addr)
432 return 0; 431 return 0;
432#endif
433 433
434 if (!dev->dma_mask) 434 if (!dev->dma_mask)
435 return 0; 435 return 0;