aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
authorYoungJun Cho <yj44.cho@samsung.com>2013-06-17 00:18:52 -0400
committerMarek Szyprowski <m.szyprowski@samsung.com>2013-06-28 09:14:27 -0400
commit836bfa0d2930b7ec236aa488f01678c92eb5f0de (patch)
treee46c0978e8f2570eee94c39cbca0fe333a55d4ce /arch/arm/mm
parent9e895ace5d82df8929b16f58e9f515f6d54ab82d (diff)
ARM: dma-mapping: Get pages if the cpu_addr is out of atomic_pool
In __iommu_get_pages(), the cpu_addr is checked wheather in atomic_pool range or not. So if the cpu_addr is in atomic_pool range, it does not need to check twice. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/dma-mapping.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index ef3e0f3aac96..1d158c223ebb 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1372,16 +1372,17 @@ static int arm_iommu_mmap_attrs(struct device *dev, struct vm_area_struct *vma,
1372void arm_iommu_free_attrs(struct device *dev, size_t size, void *cpu_addr, 1372void arm_iommu_free_attrs(struct device *dev, size_t size, void *cpu_addr,
1373 dma_addr_t handle, struct dma_attrs *attrs) 1373 dma_addr_t handle, struct dma_attrs *attrs)
1374{ 1374{
1375 struct page **pages = __iommu_get_pages(cpu_addr, attrs); 1375 struct page **pages;
1376 size = PAGE_ALIGN(size); 1376 size = PAGE_ALIGN(size);
1377 1377
1378 if (!pages) { 1378 if (__in_atomic_pool(cpu_addr, size)) {
1379 WARN(1, "trying to free invalid coherent area: %p\n", cpu_addr); 1379 __iommu_free_atomic(dev, cpu_addr, handle, size);
1380 return; 1380 return;
1381 } 1381 }
1382 1382
1383 if (__in_atomic_pool(cpu_addr, size)) { 1383 pages = __iommu_get_pages(cpu_addr, attrs);
1384 __iommu_free_atomic(dev, cpu_addr, handle, size); 1384 if (!pages) {
1385 WARN(1, "trying to free invalid coherent area: %p\n", cpu_addr);
1385 return; 1386 return;
1386 } 1387 }
1387 1388