aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/armksyms.c4
-rw-r--r--arch/arm/kernel/calls.S2
-rw-r--r--arch/arm/kernel/devtree.c4
-rw-r--r--arch/arm/kernel/entry-armv.S2
-rw-r--r--arch/arm/kernel/entry-v7m.S2
-rw-r--r--arch/arm/kernel/etm.c6
-rw-r--r--arch/arm/kernel/head-common.S12
-rw-r--r--arch/arm/kernel/head.S5
-rw-r--r--arch/arm/kernel/io.c35
-rw-r--r--arch/arm/kernel/perf_event.c4
-rw-r--r--arch/arm/kernel/perf_event_cpu.c2
-rw-r--r--arch/arm/kernel/setup.c59
-rw-r--r--arch/arm/kernel/smp.c6
-rw-r--r--arch/arm/kernel/tcm.c4
-rw-r--r--arch/arm/kernel/topology.c12
-rw-r--r--arch/arm/kernel/traps.c7
16 files changed, 113 insertions, 53 deletions
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 1f031ddd0667..85e664b6a5f1 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -35,6 +35,8 @@ extern void __ucmpdi2(void);
35extern void __udivsi3(void); 35extern void __udivsi3(void);
36extern void __umodsi3(void); 36extern void __umodsi3(void);
37extern void __do_div64(void); 37extern void __do_div64(void);
38extern void __bswapsi2(void);
39extern void __bswapdi2(void);
38 40
39extern void __aeabi_idiv(void); 41extern void __aeabi_idiv(void);
40extern void __aeabi_idivmod(void); 42extern void __aeabi_idivmod(void);
@@ -114,6 +116,8 @@ EXPORT_SYMBOL(__ucmpdi2);
114EXPORT_SYMBOL(__udivsi3); 116EXPORT_SYMBOL(__udivsi3);
115EXPORT_SYMBOL(__umodsi3); 117EXPORT_SYMBOL(__umodsi3);
116EXPORT_SYMBOL(__do_div64); 118EXPORT_SYMBOL(__do_div64);
119EXPORT_SYMBOL(__bswapsi2);
120EXPORT_SYMBOL(__bswapdi2);
117 121
118#ifdef CONFIG_AEABI 122#ifdef CONFIG_AEABI
119EXPORT_SYMBOL(__aeabi_idiv); 123EXPORT_SYMBOL(__aeabi_idiv);
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index c6ca7e376773..166e945de832 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -389,6 +389,8 @@
389 CALL(sys_process_vm_writev) 389 CALL(sys_process_vm_writev)
390 CALL(sys_kcmp) 390 CALL(sys_kcmp)
391 CALL(sys_finit_module) 391 CALL(sys_finit_module)
392/* 380 */ CALL(sys_sched_setattr)
393 CALL(sys_sched_getattr)
392#ifndef syscalls_counted 394#ifndef syscalls_counted
393.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls 395.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
394#define syscalls_counted 396#define syscalls_counted
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index 739c3dfc1da2..f751714d52c1 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -33,7 +33,7 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
33 33
34void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) 34void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
35{ 35{
36 return alloc_bootmem_align(size, align); 36 return memblock_virt_alloc(size, align);
37} 37}
38 38
39void __init arm_dt_memblock_reserve(void) 39void __init arm_dt_memblock_reserve(void)
@@ -171,7 +171,7 @@ void __init arm_dt_init_cpu_maps(void)
171 171
172bool arch_match_cpu_phys_id(int cpu, u64 phys_id) 172bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
173{ 173{
174 return (phys_id & MPIDR_HWID_BITMASK) == cpu_logical_map(cpu); 174 return phys_id == cpu_logical_map(cpu);
175} 175}
176 176
177static const void * __init arch_get_next_mach(const char *const **match) 177static const void * __init arch_get_next_mach(const char *const **match)
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index b3fb8c9e1ff2..1879e8dd2acc 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -451,9 +451,11 @@ __und_usr_thumb:
451 .arch armv6t2 451 .arch armv6t2
452#endif 452#endif
4532: ldrht r5, [r4] 4532: ldrht r5, [r4]
454ARM_BE8(rev16 r5, r5) @ little endian instruction
454 cmp r5, #0xe800 @ 32bit instruction if xx != 0 455 cmp r5, #0xe800 @ 32bit instruction if xx != 0
455 blo __und_usr_fault_16 @ 16bit undefined instruction 456 blo __und_usr_fault_16 @ 16bit undefined instruction
4563: ldrht r0, [r2] 4573: ldrht r0, [r2]
458ARM_BE8(rev16 r0, r0) @ little endian instruction
457 add r2, r2, #2 @ r2 is PC + 2, make it PC + 4 459 add r2, r2, #2 @ r2 is PC + 2, make it PC + 4
458 str r2, [sp, #S_PC] @ it's a 2x16bit instr, update 460 str r2, [sp, #S_PC] @ it's a 2x16bit instr, update
459 orr r0, r0, r5, lsl #16 461 orr r0, r0, r5, lsl #16
diff --git a/arch/arm/kernel/entry-v7m.S b/arch/arm/kernel/entry-v7m.S
index 52b26432c9a9..2260f1855820 100644
--- a/arch/arm/kernel/entry-v7m.S
+++ b/arch/arm/kernel/entry-v7m.S
@@ -14,8 +14,6 @@
14#include <asm/thread_notify.h> 14#include <asm/thread_notify.h>
15#include <asm/v7m.h> 15#include <asm/v7m.h>
16 16
17#include <mach/entry-macro.S>
18
19#include "entry-header.S" 17#include "entry-header.S"
20 18
21#ifdef CONFIG_TRACE_IRQFLAGS 19#ifdef CONFIG_TRACE_IRQFLAGS
diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c
index 8ff0ecdc637f..131a6ab5f355 100644
--- a/arch/arm/kernel/etm.c
+++ b/arch/arm/kernel/etm.c
@@ -385,7 +385,6 @@ out:
385 return ret; 385 return ret;
386 386
387out_unmap: 387out_unmap:
388 amba_set_drvdata(dev, NULL);
389 iounmap(t->etb_regs); 388 iounmap(t->etb_regs);
390 389
391out_release: 390out_release:
@@ -398,8 +397,6 @@ static int etb_remove(struct amba_device *dev)
398{ 397{
399 struct tracectx *t = amba_get_drvdata(dev); 398 struct tracectx *t = amba_get_drvdata(dev);
400 399
401 amba_set_drvdata(dev, NULL);
402
403 iounmap(t->etb_regs); 400 iounmap(t->etb_regs);
404 t->etb_regs = NULL; 401 t->etb_regs = NULL;
405 402
@@ -588,7 +585,6 @@ out:
588 return ret; 585 return ret;
589 586
590out_unmap: 587out_unmap:
591 amba_set_drvdata(dev, NULL);
592 iounmap(t->etm_regs); 588 iounmap(t->etm_regs);
593 589
594out_release: 590out_release:
@@ -601,8 +597,6 @@ static int etm_remove(struct amba_device *dev)
601{ 597{
602 struct tracectx *t = amba_get_drvdata(dev); 598 struct tracectx *t = amba_get_drvdata(dev);
603 599
604 amba_set_drvdata(dev, NULL);
605
606 iounmap(t->etm_regs); 600 iounmap(t->etm_regs);
607 t->etm_regs = NULL; 601 t->etm_regs = NULL;
608 602
diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
index 47cd974e57ea..c96ecacb2021 100644
--- a/arch/arm/kernel/head-common.S
+++ b/arch/arm/kernel/head-common.S
@@ -177,6 +177,18 @@ __lookup_processor_type_data:
177 .long __proc_info_end 177 .long __proc_info_end
178 .size __lookup_processor_type_data, . - __lookup_processor_type_data 178 .size __lookup_processor_type_data, . - __lookup_processor_type_data
179 179
180__error_lpae:
181#ifdef CONFIG_DEBUG_LL
182 adr r0, str_lpae
183 bl printascii
184 b __error
185str_lpae: .asciz "\nError: Kernel with LPAE support, but CPU does not support LPAE.\n"
186#else
187 b __error
188#endif
189 .align
190ENDPROC(__error_lpae)
191
180__error_p: 192__error_p:
181#ifdef CONFIG_DEBUG_LL 193#ifdef CONFIG_DEBUG_LL
182 adr r0, str_p1 194 adr r0, str_p1
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 32f317e5828a..f5f381d91556 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -52,7 +52,8 @@
52 .equ swapper_pg_dir, KERNEL_RAM_VADDR - PG_DIR_SIZE 52 .equ swapper_pg_dir, KERNEL_RAM_VADDR - PG_DIR_SIZE
53 53
54 .macro pgtbl, rd, phys 54 .macro pgtbl, rd, phys
55 add \rd, \phys, #TEXT_OFFSET - PG_DIR_SIZE 55 add \rd, \phys, #TEXT_OFFSET
56 sub \rd, \rd, #PG_DIR_SIZE
56 .endm 57 .endm
57 58
58/* 59/*
@@ -101,7 +102,7 @@ ENTRY(stext)
101 and r3, r3, #0xf @ extract VMSA support 102 and r3, r3, #0xf @ extract VMSA support
102 cmp r3, #5 @ long-descriptor translation table format? 103 cmp r3, #5 @ long-descriptor translation table format?
103 THUMB( it lo ) @ force fixup-able long branch encoding 104 THUMB( it lo ) @ force fixup-able long branch encoding
104 blo __error_p @ only classic page table format 105 blo __error_lpae @ only classic page table format
105#endif 106#endif
106 107
107#ifndef CONFIG_XIP_KERNEL 108#ifndef CONFIG_XIP_KERNEL
diff --git a/arch/arm/kernel/io.c b/arch/arm/kernel/io.c
index dcd5b4d86143..9203cf883330 100644
--- a/arch/arm/kernel/io.c
+++ b/arch/arm/kernel/io.c
@@ -1,6 +1,41 @@
1#include <linux/export.h> 1#include <linux/export.h>
2#include <linux/types.h> 2#include <linux/types.h>
3#include <linux/io.h> 3#include <linux/io.h>
4#include <linux/spinlock.h>
5
6static DEFINE_RAW_SPINLOCK(__io_lock);
7
8/*
9 * Generic atomic MMIO modify.
10 *
11 * Allows thread-safe access to registers shared by unrelated subsystems.
12 * The access is protected by a single MMIO-wide lock.
13 */
14void atomic_io_modify_relaxed(void __iomem *reg, u32 mask, u32 set)
15{
16 unsigned long flags;
17 u32 value;
18
19 raw_spin_lock_irqsave(&__io_lock, flags);
20 value = readl_relaxed(reg) & ~mask;
21 value |= (set & mask);
22 writel_relaxed(value, reg);
23 raw_spin_unlock_irqrestore(&__io_lock, flags);
24}
25EXPORT_SYMBOL(atomic_io_modify_relaxed);
26
27void atomic_io_modify(void __iomem *reg, u32 mask, u32 set)
28{
29 unsigned long flags;
30 u32 value;
31
32 raw_spin_lock_irqsave(&__io_lock, flags);
33 value = readl_relaxed(reg) & ~mask;
34 value |= (set & mask);
35 writel(value, reg);
36 raw_spin_unlock_irqrestore(&__io_lock, flags);
37}
38EXPORT_SYMBOL(atomic_io_modify);
4 39
5/* 40/*
6 * Copy data from IO memory space to "real" memory space. 41 * Copy data from IO memory space to "real" memory space.
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index bc3f2efa0d86..789d846a9184 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -99,10 +99,6 @@ int armpmu_event_set_period(struct perf_event *event)
99 s64 period = hwc->sample_period; 99 s64 period = hwc->sample_period;
100 int ret = 0; 100 int ret = 0;
101 101
102 /* The period may have been changed by PERF_EVENT_IOC_PERIOD */
103 if (unlikely(period != hwc->last_period))
104 left = period - (hwc->last_period - left);
105
106 if (unlikely(left <= -period)) { 102 if (unlikely(left <= -period)) {
107 left = period; 103 left = period;
108 local64_set(&hwc->period_left, left); 104 local64_set(&hwc->period_left, left);
diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c
index d85055cd24ba..20d553c9f5e2 100644
--- a/arch/arm/kernel/perf_event_cpu.c
+++ b/arch/arm/kernel/perf_event_cpu.c
@@ -254,7 +254,7 @@ static int probe_current_pmu(struct arm_pmu *pmu)
254static int cpu_pmu_device_probe(struct platform_device *pdev) 254static int cpu_pmu_device_probe(struct platform_device *pdev)
255{ 255{
256 const struct of_device_id *of_id; 256 const struct of_device_id *of_id;
257 int (*init_fn)(struct arm_pmu *); 257 const int (*init_fn)(struct arm_pmu *);
258 struct device_node *node = pdev->dev.of_node; 258 struct device_node *node = pdev->dev.of_node;
259 struct arm_pmu *pmu; 259 struct arm_pmu *pmu;
260 int ret = -ENODEV; 260 int ret = -ENODEV;
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 987a7f5bce5f..1e8b030dbefd 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -334,7 +334,7 @@ static void __init cacheid_init(void)
334 cacheid = CACHEID_VIVT; 334 cacheid = CACHEID_VIVT;
335 } 335 }
336 336
337 printk("CPU: %s data cache, %s instruction cache\n", 337 pr_info("CPU: %s data cache, %s instruction cache\n",
338 cache_is_vivt() ? "VIVT" : 338 cache_is_vivt() ? "VIVT" :
339 cache_is_vipt_aliasing() ? "VIPT aliasing" : 339 cache_is_vipt_aliasing() ? "VIPT aliasing" :
340 cache_is_vipt_nonaliasing() ? "PIPT / VIPT nonaliasing" : "unknown", 340 cache_is_vipt_nonaliasing() ? "PIPT / VIPT nonaliasing" : "unknown",
@@ -416,7 +416,7 @@ void notrace cpu_init(void)
416 struct stack *stk = &stacks[cpu]; 416 struct stack *stk = &stacks[cpu];
417 417
418 if (cpu >= NR_CPUS) { 418 if (cpu >= NR_CPUS) {
419 printk(KERN_CRIT "CPU%u: bad primary CPU number\n", cpu); 419 pr_crit("CPU%u: bad primary CPU number\n", cpu);
420 BUG(); 420 BUG();
421 } 421 }
422 422
@@ -484,7 +484,7 @@ void __init smp_setup_processor_id(void)
484 */ 484 */
485 set_my_cpu_offset(0); 485 set_my_cpu_offset(0);
486 486
487 printk(KERN_INFO "Booting Linux on physical CPU 0x%x\n", mpidr); 487 pr_info("Booting Linux on physical CPU 0x%x\n", mpidr);
488} 488}
489 489
490struct mpidr_hash mpidr_hash; 490struct mpidr_hash mpidr_hash;
@@ -564,8 +564,8 @@ static void __init setup_processor(void)
564 */ 564 */
565 list = lookup_processor_type(read_cpuid_id()); 565 list = lookup_processor_type(read_cpuid_id());
566 if (!list) { 566 if (!list) {
567 printk("CPU configuration botched (ID %08x), unable " 567 pr_err("CPU configuration botched (ID %08x), unable to continue.\n",
568 "to continue.\n", read_cpuid_id()); 568 read_cpuid_id());
569 while (1); 569 while (1);
570 } 570 }
571 571
@@ -585,9 +585,9 @@ static void __init setup_processor(void)
585 cpu_cache = *list->cache; 585 cpu_cache = *list->cache;
586#endif 586#endif
587 587
588 printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n", 588 pr_info("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
589 cpu_name, read_cpuid_id(), read_cpuid_id() & 15, 589 cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
590 proc_arch[cpu_architecture()], cr_alignment); 590 proc_arch[cpu_architecture()], cr_alignment);
591 591
592 snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c", 592 snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c",
593 list->arch_name, ENDIANNESS); 593 list->arch_name, ENDIANNESS);
@@ -629,8 +629,8 @@ int __init arm_add_memory(u64 start, u64 size)
629 u64 aligned_start; 629 u64 aligned_start;
630 630
631 if (meminfo.nr_banks >= NR_BANKS) { 631 if (meminfo.nr_banks >= NR_BANKS) {
632 printk(KERN_CRIT "NR_BANKS too low, " 632 pr_crit("NR_BANKS too low, ignoring memory at 0x%08llx\n",
633 "ignoring memory at 0x%08llx\n", (long long)start); 633 (long long)start);
634 return -EINVAL; 634 return -EINVAL;
635 } 635 }
636 636
@@ -643,14 +643,14 @@ int __init arm_add_memory(u64 start, u64 size)
643 643
644#ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT 644#ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT
645 if (aligned_start > ULONG_MAX) { 645 if (aligned_start > ULONG_MAX) {
646 printk(KERN_CRIT "Ignoring memory at 0x%08llx outside " 646 pr_crit("Ignoring memory at 0x%08llx outside 32-bit physical address space\n",
647 "32-bit physical address space\n", (long long)start); 647 (long long)start);
648 return -EINVAL; 648 return -EINVAL;
649 } 649 }
650 650
651 if (aligned_start + size > ULONG_MAX) { 651 if (aligned_start + size > ULONG_MAX) {
652 printk(KERN_CRIT "Truncating memory at 0x%08llx to fit in " 652 pr_crit("Truncating memory at 0x%08llx to fit in 32-bit physical address space\n",
653 "32-bit physical address space\n", (long long)start); 653 (long long)start);
654 /* 654 /*
655 * To ensure bank->start + bank->size is representable in 655 * To ensure bank->start + bank->size is representable in
656 * 32 bits, we use ULONG_MAX as the upper limit rather than 4GB. 656 * 32 bits, we use ULONG_MAX as the upper limit rather than 4GB.
@@ -660,6 +660,20 @@ int __init arm_add_memory(u64 start, u64 size)
660 } 660 }
661#endif 661#endif
662 662
663 if (aligned_start < PHYS_OFFSET) {
664 if (aligned_start + size <= PHYS_OFFSET) {
665 pr_info("Ignoring memory below PHYS_OFFSET: 0x%08llx-0x%08llx\n",
666 aligned_start, aligned_start + size);
667 return -EINVAL;
668 }
669
670 pr_info("Ignoring memory below PHYS_OFFSET: 0x%08llx-0x%08llx\n",
671 aligned_start, (u64)PHYS_OFFSET);
672
673 size -= PHYS_OFFSET - aligned_start;
674 aligned_start = PHYS_OFFSET;
675 }
676
663 bank->start = aligned_start; 677 bank->start = aligned_start;
664 bank->size = size & ~(phys_addr_t)(PAGE_SIZE - 1); 678 bank->size = size & ~(phys_addr_t)(PAGE_SIZE - 1);
665 679
@@ -717,7 +731,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
717 kernel_data.end = virt_to_phys(_end - 1); 731 kernel_data.end = virt_to_phys(_end - 1);
718 732
719 for_each_memblock(memory, region) { 733 for_each_memblock(memory, region) {
720 res = alloc_bootmem_low(sizeof(*res)); 734 res = memblock_virt_alloc(sizeof(*res), 0);
721 res->name = "System RAM"; 735 res->name = "System RAM";
722 res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region)); 736 res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
723 res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1; 737 res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
@@ -817,18 +831,17 @@ static void __init reserve_crashkernel(void)
817 if (ret) 831 if (ret)
818 return; 832 return;
819 833
820 ret = reserve_bootmem(crash_base, crash_size, BOOTMEM_EXCLUSIVE); 834 ret = memblock_reserve(crash_base, crash_size);
821 if (ret < 0) { 835 if (ret < 0) {
822 printk(KERN_WARNING "crashkernel reservation failed - " 836 pr_warn("crashkernel reservation failed - memory is in use (0x%lx)\n",
823 "memory is in use (0x%lx)\n", (unsigned long)crash_base); 837 (unsigned long)crash_base);
824 return; 838 return;
825 } 839 }
826 840
827 printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " 841 pr_info("Reserving %ldMB of memory at %ldMB for crashkernel (System RAM: %ldMB)\n",
828 "for crashkernel (System RAM: %ldMB)\n", 842 (unsigned long)(crash_size >> 20),
829 (unsigned long)(crash_size >> 20), 843 (unsigned long)(crash_base >> 20),
830 (unsigned long)(crash_base >> 20), 844 (unsigned long)(total_mem >> 20));
831 (unsigned long)(total_mem >> 20));
832 845
833 crashk_res.start = crash_base; 846 crashk_res.start = crash_base;
834 crashk_res.end = crash_base + crash_size - 1; 847 crashk_res.end = crash_base + crash_size - 1;
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index dc894ab3622b..b7b4c86e338b 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -105,8 +105,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
105 secondary_data.pgdir = get_arch_pgd(idmap_pgd); 105 secondary_data.pgdir = get_arch_pgd(idmap_pgd);
106 secondary_data.swapper_pg_dir = get_arch_pgd(swapper_pg_dir); 106 secondary_data.swapper_pg_dir = get_arch_pgd(swapper_pg_dir);
107#endif 107#endif
108 __cpuc_flush_dcache_area(&secondary_data, sizeof(secondary_data)); 108 sync_cache_w(&secondary_data);
109 outer_clean_range(__pa(&secondary_data), __pa(&secondary_data + 1));
110 109
111 /* 110 /*
112 * Now bring the CPU into our world. 111 * Now bring the CPU into our world.
@@ -294,6 +293,9 @@ void __ref cpu_die(void)
294 if (smp_ops.cpu_die) 293 if (smp_ops.cpu_die)
295 smp_ops.cpu_die(cpu); 294 smp_ops.cpu_die(cpu);
296 295
296 pr_warn("CPU%u: smp_ops.cpu_die() returned, trying to resuscitate\n",
297 cpu);
298
297 /* 299 /*
298 * Do not return to the idle loop - jump back to the secondary 300 * Do not return to the idle loop - jump back to the secondary
299 * cpu initialisation. There's some initialisation which needs 301 * cpu initialisation. There's some initialisation which needs
diff --git a/arch/arm/kernel/tcm.c b/arch/arm/kernel/tcm.c
index f50f19e5c138..7a3be1d4d0b1 100644
--- a/arch/arm/kernel/tcm.c
+++ b/arch/arm/kernel/tcm.c
@@ -52,7 +52,7 @@ static struct map_desc dtcm_iomap[] __initdata = {
52 .virtual = DTCM_OFFSET, 52 .virtual = DTCM_OFFSET,
53 .pfn = __phys_to_pfn(DTCM_OFFSET), 53 .pfn = __phys_to_pfn(DTCM_OFFSET),
54 .length = 0, 54 .length = 0,
55 .type = MT_MEMORY_DTCM 55 .type = MT_MEMORY_RW_DTCM
56 } 56 }
57}; 57};
58 58
@@ -61,7 +61,7 @@ static struct map_desc itcm_iomap[] __initdata = {
61 .virtual = ITCM_OFFSET, 61 .virtual = ITCM_OFFSET,
62 .pfn = __phys_to_pfn(ITCM_OFFSET), 62 .pfn = __phys_to_pfn(ITCM_OFFSET),
63 .length = 0, 63 .length = 0,
64 .type = MT_MEMORY_ITCM 64 .type = MT_MEMORY_RWX_ITCM,
65 } 65 }
66}; 66};
67 67
diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
index 85a87370f144..0bc94b1fd1ae 100644
--- a/arch/arm/kernel/topology.c
+++ b/arch/arm/kernel/topology.c
@@ -68,16 +68,16 @@ struct cpu_efficiency {
68 * Processors that are not defined in the table, 68 * Processors that are not defined in the table,
69 * use the default SCHED_POWER_SCALE value for cpu_scale. 69 * use the default SCHED_POWER_SCALE value for cpu_scale.
70 */ 70 */
71struct cpu_efficiency table_efficiency[] = { 71static const struct cpu_efficiency table_efficiency[] = {
72 {"arm,cortex-a15", 3891}, 72 {"arm,cortex-a15", 3891},
73 {"arm,cortex-a7", 2048}, 73 {"arm,cortex-a7", 2048},
74 {NULL, }, 74 {NULL, },
75}; 75};
76 76
77unsigned long *__cpu_capacity; 77static unsigned long *__cpu_capacity;
78#define cpu_capacity(cpu) __cpu_capacity[cpu] 78#define cpu_capacity(cpu) __cpu_capacity[cpu]
79 79
80unsigned long middle_capacity = 1; 80static unsigned long middle_capacity = 1;
81 81
82/* 82/*
83 * Iterate all CPUs' descriptor in DT and compute the efficiency 83 * Iterate all CPUs' descriptor in DT and compute the efficiency
@@ -89,7 +89,7 @@ unsigned long middle_capacity = 1;
89 */ 89 */
90static void __init parse_dt_topology(void) 90static void __init parse_dt_topology(void)
91{ 91{
92 struct cpu_efficiency *cpu_eff; 92 const struct cpu_efficiency *cpu_eff;
93 struct device_node *cn = NULL; 93 struct device_node *cn = NULL;
94 unsigned long min_capacity = (unsigned long)(-1); 94 unsigned long min_capacity = (unsigned long)(-1);
95 unsigned long max_capacity = 0; 95 unsigned long max_capacity = 0;
@@ -158,7 +158,7 @@ static void __init parse_dt_topology(void)
158 * boot. The update of all CPUs is in O(n^2) for heteregeneous system but the 158 * boot. The update of all CPUs is in O(n^2) for heteregeneous system but the
159 * function returns directly for SMP system. 159 * function returns directly for SMP system.
160 */ 160 */
161void update_cpu_power(unsigned int cpu) 161static void update_cpu_power(unsigned int cpu)
162{ 162{
163 if (!cpu_capacity(cpu)) 163 if (!cpu_capacity(cpu))
164 return; 164 return;
@@ -185,7 +185,7 @@ const struct cpumask *cpu_coregroup_mask(int cpu)
185 return &cpu_topology[cpu].core_sibling; 185 return &cpu_topology[cpu].core_sibling;
186} 186}
187 187
188void update_siblings_masks(unsigned int cpuid) 188static void update_siblings_masks(unsigned int cpuid)
189{ 189{
190 struct cputopo_arm *cpu_topo, *cpuid_topo = &cpu_topology[cpuid]; 190 struct cputopo_arm *cpu_topo, *cpuid_topo = &cpu_topology[cpuid];
191 int cpu; 191 int cpu;
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 6eda3bf85c52..172ee18ff124 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -62,7 +62,7 @@ static void dump_mem(const char *, const char *, unsigned long, unsigned long);
62void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame) 62void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame)
63{ 63{
64#ifdef CONFIG_KALLSYMS 64#ifdef CONFIG_KALLSYMS
65 printk("[<%08lx>] (%pS) from [<%08lx>] (%pS)\n", where, (void *)where, from, (void *)from); 65 printk("[<%08lx>] (%ps) from [<%08lx>] (%pS)\n", where, (void *)where, from, (void *)from);
66#else 66#else
67 printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from); 67 printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from);
68#endif 68#endif
@@ -431,9 +431,10 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
431 instr2 = __mem_to_opcode_thumb16(instr2); 431 instr2 = __mem_to_opcode_thumb16(instr2);
432 instr = __opcode_thumb32_compose(instr, instr2); 432 instr = __opcode_thumb32_compose(instr, instr2);
433 } 433 }
434 } else if (get_user(instr, (u32 __user *)pc)) { 434 } else {
435 if (get_user(instr, (u32 __user *)pc))
436 goto die_sig;
435 instr = __mem_to_opcode_arm(instr); 437 instr = __mem_to_opcode_arm(instr);
436 goto die_sig;
437 } 438 }
438 439
439 if (call_undef_hook(regs, instr) == 0) 440 if (call_undef_hook(regs, instr) == 0)