diff options
Diffstat (limited to 'arch/arm/mm')
| -rw-r--r-- | arch/arm/mm/alignment.c | 6 | ||||
| -rw-r--r-- | arch/arm/mm/cache-l2x0.c | 8 | ||||
| -rw-r--r-- | arch/arm/mm/cache-v7.S | 3 | ||||
| -rw-r--r-- | arch/arm/mm/context.c | 7 | ||||
| -rw-r--r-- | arch/arm/mm/dma-mapping.c | 4 | ||||
| -rw-r--r-- | arch/arm/mm/init.c | 2 | ||||
| -rw-r--r-- | arch/arm/mm/ioremap.c | 1 | ||||
| -rw-r--r-- | arch/arm/mm/mm.h | 3 | ||||
| -rw-r--r-- | arch/arm/mm/mmu.c | 8 | 
9 files changed, 28 insertions, 14 deletions
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index 9107231aacc..b9f60ebe3bc 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c @@ -699,7 +699,6 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs,  	unsigned long instr = *pinstr;  	u16 tinst1 = (instr >> 16) & 0xffff;  	u16 tinst2 = instr & 0xffff; -	poffset->un = 0;  	switch (tinst1 & 0xffe0) {  	/* A6.3.5 Load/Store multiple */ @@ -854,9 +853,10 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)  		break;  	case 0x08000000:	/* ldm or stm, or thumb-2 32bit instruction */ -		if (thumb2_32b) +		if (thumb2_32b) { +			offset.un = 0;  			handler = do_alignment_t32_to_handler(&instr, regs, &offset); -		else +		} else  			handler = do_alignment_ldmstm;  		break; diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 2a8e380501e..97ec2565805 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -368,14 +368,18 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)  		/* l2x0 controller is disabled */  		writel_relaxed(aux, l2x0_base + L2X0_AUX_CTRL); -		l2x0_saved_regs.aux_ctrl = aux; -  		l2x0_inv_all();  		/* enable L2X0 */  		writel_relaxed(1, l2x0_base + L2X0_CTRL);  	} +	/* Re-read it in case some bits are reserved. */ +	aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL); + +	/* Save the value for resuming. */ +	l2x0_saved_regs.aux_ctrl = aux; +  	outer_cache.inv_range = l2x0_inv_range;  	outer_cache.clean_range = l2x0_clean_range;  	outer_cache.flush_range = l2x0_flush_range; diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S index 39e3fb3db80..3b172275262 100644 --- a/arch/arm/mm/cache-v7.S +++ b/arch/arm/mm/cache-v7.S @@ -211,6 +211,9 @@ ENTRY(v7_coherent_user_range)   * isn't mapped, fail with -EFAULT.   */  9001: +#ifdef CONFIG_ARM_ERRATA_775420 +	dsb +#endif  	mov	r0, #-EFAULT  	mov	pc, lr   UNWIND(.fnend		) diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c index 119bc52ab93..4e07eec1270 100644 --- a/arch/arm/mm/context.c +++ b/arch/arm/mm/context.c @@ -63,10 +63,11 @@ static int contextidr_notifier(struct notifier_block *unused, unsigned long cmd,  	pid = task_pid_nr(thread->task) << ASID_BITS;  	asm volatile(  	"	mrc	p15, 0, %0, c13, c0, 1\n" -	"	bfi	%1, %0, #0, %2\n" -	"	mcr	p15, 0, %1, c13, c0, 1\n" +	"	and	%0, %0, %2\n" +	"	orr	%0, %0, %1\n" +	"	mcr	p15, 0, %0, c13, c0, 1\n"  	: "=r" (contextidr), "+r" (pid) -	: "I" (ASID_BITS)); +	: "I" (~ASID_MASK));  	isb();  	return NOTIFY_OK; diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 051204fc461..13f555d6249 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -346,6 +346,8 @@ static int __init atomic_pool_init(void)  		       (unsigned)pool->size / 1024);  		return 0;  	} + +	kfree(pages);  no_pages:  	kfree(bitmap);  no_bitmap: @@ -489,7 +491,7 @@ static bool __in_atomic_pool(void *start, size_t size)  	void *pool_start = pool->vaddr;  	void *pool_end = pool->vaddr + pool->size; -	if (start < pool_start || start > pool_end) +	if (start < pool_start || start >= pool_end)  		return false;  	if (end <= pool_end) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 9aec41fa80a..ad722f1208a 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -324,7 +324,7 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)  	BUG_ON(!arm_memblock_steal_permitted); -	phys = memblock_alloc(size, align); +	phys = memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ANYWHERE);  	memblock_free(phys, size);  	memblock_remove(phys, size); diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index 566750fa57d..491f6b3336f 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c @@ -247,6 +247,7 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,   	if (!area)   		return NULL;   	addr = (unsigned long)area->addr; +	area->phys_addr = __pfn_to_phys(pfn);  #if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)  	if (DOMAIN_IO == 0 && diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h index 6776160618e..a8ee92da354 100644 --- a/arch/arm/mm/mm.h +++ b/arch/arm/mm/mm.h @@ -55,6 +55,9 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page  /* permanent static mappings from iotable_init() */  #define VM_ARM_STATIC_MAPPING	0x40000000 +/* empty mapping */ +#define VM_ARM_EMPTY_MAPPING	0x20000000 +  /* mapping type (attributes) for permanent static mappings */  #define VM_ARM_MTYPE(mt)		((mt) << 20)  #define VM_ARM_MTYPE_MASK	(0x1f << 20) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 4c2d0451e84..c2fa21d0103 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -807,7 +807,7 @@ static void __init pmd_empty_section_gap(unsigned long addr)  	vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm));  	vm->addr = (void *)addr;  	vm->size = SECTION_SIZE; -	vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING; +	vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING;  	vm->caller = pmd_empty_section_gap;  	vm_area_add_early(vm);  } @@ -820,7 +820,7 @@ static void __init fill_pmd_gaps(void)  	/* we're still single threaded hence no lock needed here */  	for (vm = vmlist; vm; vm = vm->next) { -		if (!(vm->flags & VM_ARM_STATIC_MAPPING)) +		if (!(vm->flags & (VM_ARM_STATIC_MAPPING | VM_ARM_EMPTY_MAPPING)))  			continue;  		addr = (unsigned long)vm->addr;  		if (addr < next) @@ -961,8 +961,8 @@ void __init sanity_check_meminfo(void)  		 * Check whether this memory bank would partially overlap  		 * the vmalloc area.  		 */ -		if (__va(bank->start + bank->size) > vmalloc_min || -		    __va(bank->start + bank->size) < __va(bank->start)) { +		if (__va(bank->start + bank->size - 1) >= vmalloc_min || +		    __va(bank->start + bank->size - 1) <= __va(bank->start)) {  			unsigned long newsize = vmalloc_min - __va(bank->start);  			printk(KERN_NOTICE "Truncating RAM at %.8llx-%.8llx "  			       "to -%.8llx (vmalloc region overlap).\n",  |