diff options
author | Vineet Gupta | 2016-03-16 15:04:39 +0530 |
---|---|---|
committer | Vineet Gupta | 2016-03-19 14:34:09 +0530 |
commit | f5db19e93f680160a0fb3e2b05ceb4832b24d486 (patch) | |
tree | 80d91649de37151166d0eed3cb3a541b78bc1f7c /arch/arc/mm/dma.c | |
parent | 971573cf57394775deb591c3920e565c80cbc800 (diff) |
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.c | 12 |
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; } |