aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/dma-mapping.c12
-rw-r--r--arch/arm/mm/flush.c2
-rw-r--r--arch/arm/mm/tlb-v7.S6
3 files changed, 9 insertions, 11 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index c2cdf6500f75..4e7d1182e8a3 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -358,7 +358,7 @@ void __init dma_contiguous_remap(void)
358 if (end > arm_lowmem_limit) 358 if (end > arm_lowmem_limit)
359 end = arm_lowmem_limit; 359 end = arm_lowmem_limit;
360 if (start >= end) 360 if (start >= end)
361 return; 361 continue;
362 362
363 map.pfn = __phys_to_pfn(start); 363 map.pfn = __phys_to_pfn(start);
364 map.virtual = __phys_to_virt(start); 364 map.virtual = __phys_to_virt(start);
@@ -423,7 +423,7 @@ static void *__alloc_from_pool(size_t size, struct page **ret_page)
423 unsigned int pageno; 423 unsigned int pageno;
424 unsigned long flags; 424 unsigned long flags;
425 void *ptr = NULL; 425 void *ptr = NULL;
426 size_t align; 426 unsigned long align_mask;
427 427
428 if (!pool->vaddr) { 428 if (!pool->vaddr) {
429 WARN(1, "coherent pool not initialised!\n"); 429 WARN(1, "coherent pool not initialised!\n");
@@ -435,11 +435,11 @@ static void *__alloc_from_pool(size_t size, struct page **ret_page)
435 * small, so align them to their order in pages, minimum is a page 435 * small, so align them to their order in pages, minimum is a page
436 * size. This helps reduce fragmentation of the DMA space. 436 * size. This helps reduce fragmentation of the DMA space.
437 */ 437 */
438 align = PAGE_SIZE << get_order(size); 438 align_mask = (1 << get_order(size)) - 1;
439 439
440 spin_lock_irqsave(&pool->lock, flags); 440 spin_lock_irqsave(&pool->lock, flags);
441 pageno = bitmap_find_next_zero_area(pool->bitmap, pool->nr_pages, 441 pageno = bitmap_find_next_zero_area(pool->bitmap, pool->nr_pages,
442 0, count, (1 << align) - 1); 442 0, count, align_mask);
443 if (pageno < pool->nr_pages) { 443 if (pageno < pool->nr_pages) {
444 bitmap_set(pool->bitmap, pageno, count); 444 bitmap_set(pool->bitmap, pageno, count);
445 ptr = pool->vaddr + PAGE_SIZE * pageno; 445 ptr = pool->vaddr + PAGE_SIZE * pageno;
@@ -648,12 +648,12 @@ void arm_dma_free(struct device *dev, size_t size, void *cpu_addr,
648 648
649 if (arch_is_coherent() || nommu()) { 649 if (arch_is_coherent() || nommu()) {
650 __dma_free_buffer(page, size); 650 __dma_free_buffer(page, size);
651 } else if (__free_from_pool(cpu_addr, size)) {
652 return;
651 } else if (!IS_ENABLED(CONFIG_CMA)) { 653 } else if (!IS_ENABLED(CONFIG_CMA)) {
652 __dma_free_remap(cpu_addr, size); 654 __dma_free_remap(cpu_addr, size);
653 __dma_free_buffer(page, size); 655 __dma_free_buffer(page, size);
654 } else { 656 } else {
655 if (__free_from_pool(cpu_addr, size))
656 return;
657 /* 657 /*
658 * Non-atomic allocations cannot be freed with IRQs disabled 658 * Non-atomic allocations cannot be freed with IRQs disabled
659 */ 659 */
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index 77458548e031..40ca11ed6e5f 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -231,8 +231,6 @@ void __sync_icache_dcache(pte_t pteval)
231 struct page *page; 231 struct page *page;
232 struct address_space *mapping; 232 struct address_space *mapping;
233 233
234 if (!pte_present_user(pteval))
235 return;
236 if (cache_is_vipt_nonaliasing() && !pte_exec(pteval)) 234 if (cache_is_vipt_nonaliasing() && !pte_exec(pteval))
237 /* only flush non-aliasing VIPT caches for exec mappings */ 235 /* only flush non-aliasing VIPT caches for exec mappings */
238 return; 236 return;
diff --git a/arch/arm/mm/tlb-v7.S b/arch/arm/mm/tlb-v7.S
index c2021139cb56..ea94765acf9a 100644
--- a/arch/arm/mm/tlb-v7.S
+++ b/arch/arm/mm/tlb-v7.S
@@ -38,10 +38,10 @@ ENTRY(v7wbi_flush_user_tlb_range)
38 dsb 38 dsb
39 mov r0, r0, lsr #PAGE_SHIFT @ align address 39 mov r0, r0, lsr #PAGE_SHIFT @ align address
40 mov r1, r1, lsr #PAGE_SHIFT 40 mov r1, r1, lsr #PAGE_SHIFT
41#ifdef CONFIG_ARM_ERRATA_720789
42 mov r3, #0
43#else
44 asid r3, r3 @ mask ASID 41 asid r3, r3 @ mask ASID
42#ifdef CONFIG_ARM_ERRATA_720789
43 ALT_SMP(W(mov) r3, #0 )
44 ALT_UP(W(nop) )
45#endif 45#endif
46 orr r0, r3, r0, lsl #PAGE_SHIFT @ Create initial MVA 46 orr r0, r3, r0, lsl #PAGE_SHIFT @ Create initial MVA
47 mov r1, r1, lsl #PAGE_SHIFT 47 mov r1, r1, lsl #PAGE_SHIFT