summaryrefslogtreecommitdiffstats
path: root/arch/arc/mm/dma.c
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2016-03-16 10:34:39 +0100
committerVineet Gupta <vgupta@synopsys.com>2016-03-19 10:04:09 +0100
commitf5db19e93f680160a0fb3e2b05ceb4832b24d486 (patch)
tree80d91649de37151166d0eed3cb3a541b78bc1f7c /arch/arc/mm/dma.c
parentARC: dma: pass_phys() not sg_virt() to cache ops (diff)
downloadlinux-f5db19e93f680160a0fb3e2b05ceb4832b24d486.tar.xz
linux-f5db19e93f680160a0fb3e2b05ceb4832b24d486.zip
ARC: dma: ioremap: use phys_addr_t consistenctly in code paths
To support dma in physical memory beyond 4GB with PAE40 Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/mm/dma.c')
-rw-r--r--arch/arc/mm/dma.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/arc/mm/dma.c b/arch/arc/mm/dma.c
index d6b30f65d692..608c143e9d38 100644
--- a/arch/arc/mm/dma.c
+++ b/arch/arc/mm/dma.c
@@ -65,13 +65,13 @@ static void *arc_dma_alloc(struct device *dev, size_t size,
/* This is kernel Virtual address (0x7000_0000 based) */
if (need_kvaddr) {
- kvaddr = ioremap_nocache((unsigned long)paddr, size);
+ kvaddr = ioremap_nocache(paddr, size);
if (kvaddr == NULL) {
__free_pages(page, order);
return NULL;
}
} else {
- kvaddr = (void *)paddr;
+ kvaddr = (void *)(u32)paddr;
}
/*
@@ -85,7 +85,7 @@ static void *arc_dma_alloc(struct device *dev, size_t size,
* will be optimized as a separate commit
*/
if (need_coh)
- dma_cache_wback_inv((unsigned long)paddr, size);
+ dma_cache_wback_inv(paddr, size);
return kvaddr;
}
@@ -110,7 +110,7 @@ static void arc_dma_free(struct device *dev, size_t size, void *vaddr,
* CPU accesses page via normal paddr, thus needs to explicitly made
* consistent before each use
*/
-static void _dma_cache_sync(unsigned long paddr, size_t size,
+static void _dma_cache_sync(phys_addr_t paddr, size_t size,
enum dma_data_direction dir)
{
switch (dir) {
@@ -124,7 +124,7 @@ static void _dma_cache_sync(unsigned long paddr, size_t size,
dma_cache_wback_inv(paddr, size);
break;
default:
- pr_err("Invalid DMA dir [%d] for OP @ %lx\n", dir, paddr);
+ pr_err("Invalid DMA dir [%d] for OP @ %pa[p]\n", dir, &paddr);
}
}
@@ -132,7 +132,7 @@ static dma_addr_t arc_dma_map_page(struct device *dev, struct page *page,
unsigned long offset, size_t size, enum dma_data_direction dir,
struct dma_attrs *attrs)
{
- unsigned long paddr = page_to_phys(page) + offset;
+ phys_addr_t paddr = page_to_phys(page) + offset;
_dma_cache_sync(paddr, size, dir);
return (dma_addr_t)paddr;
}