aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/iovmm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-omap/iovmm.c')
-rw-r--r--arch/arm/plat-omap/iovmm.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index dc3fac3dd0ea..65c6d1ff7237 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -11,6 +11,7 @@
11 */ 11 */
12 12
13#include <linux/err.h> 13#include <linux/err.h>
14#include <linux/slab.h>
14#include <linux/vmalloc.h> 15#include <linux/vmalloc.h>
15#include <linux/device.h> 16#include <linux/device.h>
16#include <linux/scatterlist.h> 17#include <linux/scatterlist.h>
@@ -18,8 +19,8 @@
18#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
19#include <asm/mach/map.h> 20#include <asm/mach/map.h>
20 21
21#include <mach/iommu.h> 22#include <plat/iommu.h>
22#include <mach/iovmm.h> 23#include <plat/iovmm.h>
23 24
24#include "iopgtable.h" 25#include "iopgtable.h"
25 26
@@ -392,7 +393,6 @@ static void sgtable_fill_vmalloc(struct sg_table *sgt, void *_va)
392 } 393 }
393 394
394 va_end = _va + PAGE_SIZE * i; 395 va_end = _va + PAGE_SIZE * i;
395 flush_cache_vmap((unsigned long)_va, (unsigned long)va_end);
396} 396}
397 397
398static inline void sgtable_drain_vmalloc(struct sg_table *sgt) 398static inline void sgtable_drain_vmalloc(struct sg_table *sgt)
@@ -427,8 +427,6 @@ static void sgtable_fill_kmalloc(struct sg_table *sgt, u32 pa, size_t len)
427 len -= bytes; 427 len -= bytes;
428 } 428 }
429 BUG_ON(len); 429 BUG_ON(len);
430
431 clean_dcache_area(va, len);
432} 430}
433 431
434static inline void sgtable_drain_kmalloc(struct sg_table *sgt) 432static inline void sgtable_drain_kmalloc(struct sg_table *sgt)
@@ -449,7 +447,7 @@ static int map_iovm_area(struct iommu *obj, struct iovm_struct *new,
449 struct scatterlist *sg; 447 struct scatterlist *sg;
450 u32 da = new->da_start; 448 u32 da = new->da_start;
451 449
452 if (!obj || !new || !sgt) 450 if (!obj || !sgt)
453 return -EINVAL; 451 return -EINVAL;
454 452
455 BUG_ON(!sgtable_ok(sgt)); 453 BUG_ON(!sgtable_ok(sgt));
@@ -617,7 +615,7 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt,
617 u32 flags) 615 u32 flags)
618{ 616{
619 size_t bytes; 617 size_t bytes;
620 void *va; 618 void *va = NULL;
621 619
622 if (!obj || !obj->dev || !sgt) 620 if (!obj || !obj->dev || !sgt)
623 return -EINVAL; 621 return -EINVAL;
@@ -627,9 +625,11 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt,
627 return -EINVAL; 625 return -EINVAL;
628 bytes = PAGE_ALIGN(bytes); 626 bytes = PAGE_ALIGN(bytes);
629 627
630 va = vmap_sg(sgt); 628 if (flags & IOVMF_MMIO) {
631 if (IS_ERR(va)) 629 va = vmap_sg(sgt);
632 return PTR_ERR(va); 630 if (IS_ERR(va))
631 return PTR_ERR(va);
632 }
633 633
634 flags &= IOVMF_HW_MASK; 634 flags &= IOVMF_HW_MASK;
635 flags |= IOVMF_DISCONT; 635 flags |= IOVMF_DISCONT;