diff options
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/boot/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/common/gic.c | 25 | ||||
-rw-r--r-- | arch/arm/include/asm/delay.h | 1 | ||||
-rw-r--r-- | arch/arm/include/asm/memory.h | 2 | ||||
-rw-r--r-- | arch/arm/include/asm/pgtable.h | 3 | ||||
-rw-r--r-- | arch/arm/kernel/sched_clock.c | 4 | ||||
-rw-r--r-- | arch/arm/kernel/smp.c | 3 | ||||
-rw-r--r-- | arch/arm/lib/delay.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-realview/include/mach/irqs-eb.h | 2 | ||||
-rw-r--r-- | arch/arm/mm/alignment.c | 11 | ||||
-rw-r--r-- | arch/arm/mm/dma-mapping.c | 2 | ||||
-rw-r--r-- | arch/arm/vfp/vfphw.S | 36 | ||||
-rw-r--r-- | arch/arm/vfp/vfpmodule.c | 2 |
14 files changed, 64 insertions, 34 deletions
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile index abfce280f57b..71768b8a1ab9 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile | |||
@@ -68,8 +68,8 @@ else | |||
68 | endif | 68 | endif |
69 | 69 | ||
70 | check_for_multiple_loadaddr = \ | 70 | check_for_multiple_loadaddr = \ |
71 | if [ $(words $(UIMAGE_LOADADDR)) -gt 1 ]; then \ | 71 | if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \ |
72 | echo 'multiple load addresses: $(UIMAGE_LOADADDR)'; \ | 72 | echo 'multiple (or no) load addresses: $(UIMAGE_LOADADDR)'; \ |
73 | echo 'This is incompatible with uImages'; \ | 73 | echo 'This is incompatible with uImages'; \ |
74 | echo 'Specify LOADADDR on the commandline to build an uImage'; \ | 74 | echo 'Specify LOADADDR on the commandline to build an uImage'; \ |
75 | false; \ | 75 | false; \ |
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c index 36ae03a3f5d1..87dfa9026c5b 100644 --- a/arch/arm/common/gic.c +++ b/arch/arm/common/gic.c | |||
@@ -351,6 +351,25 @@ void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq) | |||
351 | irq_set_chained_handler(irq, gic_handle_cascade_irq); | 351 | irq_set_chained_handler(irq, gic_handle_cascade_irq); |
352 | } | 352 | } |
353 | 353 | ||
354 | static u8 gic_get_cpumask(struct gic_chip_data *gic) | ||
355 | { | ||
356 | void __iomem *base = gic_data_dist_base(gic); | ||
357 | u32 mask, i; | ||
358 | |||
359 | for (i = mask = 0; i < 32; i += 4) { | ||
360 | mask = readl_relaxed(base + GIC_DIST_TARGET + i); | ||
361 | mask |= mask >> 16; | ||
362 | mask |= mask >> 8; | ||
363 | if (mask) | ||
364 | break; | ||
365 | } | ||
366 | |||
367 | if (!mask) | ||
368 | pr_crit("GIC CPU mask not found - kernel will fail to boot.\n"); | ||
369 | |||
370 | return mask; | ||
371 | } | ||
372 | |||
354 | static void __init gic_dist_init(struct gic_chip_data *gic) | 373 | static void __init gic_dist_init(struct gic_chip_data *gic) |
355 | { | 374 | { |
356 | unsigned int i; | 375 | unsigned int i; |
@@ -369,7 +388,9 @@ static void __init gic_dist_init(struct gic_chip_data *gic) | |||
369 | /* | 388 | /* |
370 | * Set all global interrupts to this CPU only. | 389 | * Set all global interrupts to this CPU only. |
371 | */ | 390 | */ |
372 | cpumask = readl_relaxed(base + GIC_DIST_TARGET + 0); | 391 | cpumask = gic_get_cpumask(gic); |
392 | cpumask |= cpumask << 8; | ||
393 | cpumask |= cpumask << 16; | ||
373 | for (i = 32; i < gic_irqs; i += 4) | 394 | for (i = 32; i < gic_irqs; i += 4) |
374 | writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4); | 395 | writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4); |
375 | 396 | ||
@@ -400,7 +421,7 @@ static void __cpuinit gic_cpu_init(struct gic_chip_data *gic) | |||
400 | * Get what the GIC says our CPU mask is. | 421 | * Get what the GIC says our CPU mask is. |
401 | */ | 422 | */ |
402 | BUG_ON(cpu >= NR_GIC_CPU_IF); | 423 | BUG_ON(cpu >= NR_GIC_CPU_IF); |
403 | cpu_mask = readl_relaxed(dist_base + GIC_DIST_TARGET + 0); | 424 | cpu_mask = gic_get_cpumask(gic); |
404 | gic_cpu_map[cpu] = cpu_mask; | 425 | gic_cpu_map[cpu] = cpu_mask; |
405 | 426 | ||
406 | /* | 427 | /* |
diff --git a/arch/arm/include/asm/delay.h b/arch/arm/include/asm/delay.h index ab98fdd083bd..720799fd3a81 100644 --- a/arch/arm/include/asm/delay.h +++ b/arch/arm/include/asm/delay.h | |||
@@ -24,6 +24,7 @@ extern struct arm_delay_ops { | |||
24 | void (*delay)(unsigned long); | 24 | void (*delay)(unsigned long); |
25 | void (*const_udelay)(unsigned long); | 25 | void (*const_udelay)(unsigned long); |
26 | void (*udelay)(unsigned long); | 26 | void (*udelay)(unsigned long); |
27 | bool const_clock; | ||
27 | } arm_delay_ops; | 28 | } arm_delay_ops; |
28 | 29 | ||
29 | #define __delay(n) arm_delay_ops.delay(n) | 30 | #define __delay(n) arm_delay_ops.delay(n) |
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 73cf03aa981e..1c4df27f9332 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h | |||
@@ -37,7 +37,7 @@ | |||
37 | */ | 37 | */ |
38 | #define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET) | 38 | #define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET) |
39 | #define TASK_SIZE (UL(CONFIG_PAGE_OFFSET) - UL(0x01000000)) | 39 | #define TASK_SIZE (UL(CONFIG_PAGE_OFFSET) - UL(0x01000000)) |
40 | #define TASK_UNMAPPED_BASE (UL(CONFIG_PAGE_OFFSET) / 3) | 40 | #define TASK_UNMAPPED_BASE ALIGN(TASK_SIZE / 3, SZ_16M) |
41 | 41 | ||
42 | /* | 42 | /* |
43 | * The maximum size of a 26-bit user space task. | 43 | * The maximum size of a 26-bit user space task. |
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index f30ac3b55ba9..80d6fc4dbe4a 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h | |||
@@ -247,7 +247,8 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | |||
247 | 247 | ||
248 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 248 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
249 | { | 249 | { |
250 | const pteval_t mask = L_PTE_XN | L_PTE_RDONLY | L_PTE_USER | L_PTE_NONE; | 250 | const pteval_t mask = L_PTE_XN | L_PTE_RDONLY | L_PTE_USER | |
251 | L_PTE_NONE | L_PTE_VALID; | ||
251 | pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); | 252 | pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); |
252 | return pte; | 253 | return pte; |
253 | } | 254 | } |
diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c index fc6692e2b603..bd6f56b9ec21 100644 --- a/arch/arm/kernel/sched_clock.c +++ b/arch/arm/kernel/sched_clock.c | |||
@@ -93,11 +93,11 @@ static void notrace update_sched_clock(void) | |||
93 | * detectable in cyc_to_fixed_sched_clock(). | 93 | * detectable in cyc_to_fixed_sched_clock(). |
94 | */ | 94 | */ |
95 | raw_local_irq_save(flags); | 95 | raw_local_irq_save(flags); |
96 | cd.epoch_cyc = cyc; | 96 | cd.epoch_cyc_copy = cyc; |
97 | smp_wmb(); | 97 | smp_wmb(); |
98 | cd.epoch_ns = ns; | 98 | cd.epoch_ns = ns; |
99 | smp_wmb(); | 99 | smp_wmb(); |
100 | cd.epoch_cyc_copy = cyc; | 100 | cd.epoch_cyc = cyc; |
101 | raw_local_irq_restore(flags); | 101 | raw_local_irq_restore(flags); |
102 | } | 102 | } |
103 | 103 | ||
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index ab9458d62cbb..87d30e704fec 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -686,6 +686,9 @@ static int cpufreq_callback(struct notifier_block *nb, | |||
686 | if (freq->flags & CPUFREQ_CONST_LOOPS) | 686 | if (freq->flags & CPUFREQ_CONST_LOOPS) |
687 | return NOTIFY_OK; | 687 | return NOTIFY_OK; |
688 | 688 | ||
689 | if (arm_delay_ops.const_clock) | ||
690 | return NOTIFY_OK; | ||
691 | |||
689 | if (!per_cpu(l_p_j_ref, cpu)) { | 692 | if (!per_cpu(l_p_j_ref, cpu)) { |
690 | per_cpu(l_p_j_ref, cpu) = | 693 | per_cpu(l_p_j_ref, cpu) = |
691 | per_cpu(cpu_data, cpu).loops_per_jiffy; | 694 | per_cpu(cpu_data, cpu).loops_per_jiffy; |
diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c index 0dc53854a5d8..6b93f6a1a3c7 100644 --- a/arch/arm/lib/delay.c +++ b/arch/arm/lib/delay.c | |||
@@ -77,6 +77,7 @@ void __init register_current_timer_delay(const struct delay_timer *timer) | |||
77 | arm_delay_ops.delay = __timer_delay; | 77 | arm_delay_ops.delay = __timer_delay; |
78 | arm_delay_ops.const_udelay = __timer_const_udelay; | 78 | arm_delay_ops.const_udelay = __timer_const_udelay; |
79 | arm_delay_ops.udelay = __timer_udelay; | 79 | arm_delay_ops.udelay = __timer_udelay; |
80 | arm_delay_ops.const_clock = true; | ||
80 | delay_calibrated = true; | 81 | delay_calibrated = true; |
81 | } else { | 82 | } else { |
82 | pr_info("Ignoring duplicate/late registration of read_current_timer delay\n"); | 83 | pr_info("Ignoring duplicate/late registration of read_current_timer delay\n"); |
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index e103c290bc9e..85afb031b676 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig | |||
@@ -414,7 +414,7 @@ config MACH_EXYNOS4_DT | |||
414 | select CPU_EXYNOS4210 | 414 | select CPU_EXYNOS4210 |
415 | select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD | 415 | select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD |
416 | select PINCTRL | 416 | select PINCTRL |
417 | select PINCTRL_EXYNOS4 | 417 | select PINCTRL_EXYNOS |
418 | select USE_OF | 418 | select USE_OF |
419 | help | 419 | help |
420 | Machine support for Samsung Exynos4 machine with device tree enabled. | 420 | Machine support for Samsung Exynos4 machine with device tree enabled. |
diff --git a/arch/arm/mach-realview/include/mach/irqs-eb.h b/arch/arm/mach-realview/include/mach/irqs-eb.h index d6b5073692d2..44754230fdcc 100644 --- a/arch/arm/mach-realview/include/mach/irqs-eb.h +++ b/arch/arm/mach-realview/include/mach/irqs-eb.h | |||
@@ -115,7 +115,7 @@ | |||
115 | /* | 115 | /* |
116 | * Only define NR_IRQS if less than NR_IRQS_EB | 116 | * Only define NR_IRQS if less than NR_IRQS_EB |
117 | */ | 117 | */ |
118 | #define NR_IRQS_EB (IRQ_EB_GIC_START + 96) | 118 | #define NR_IRQS_EB (IRQ_EB_GIC_START + 128) |
119 | 119 | ||
120 | #if defined(CONFIG_MACH_REALVIEW_EB) \ | 120 | #if defined(CONFIG_MACH_REALVIEW_EB) \ |
121 | && (!defined(NR_IRQS) || (NR_IRQS < NR_IRQS_EB)) | 121 | && (!defined(NR_IRQS) || (NR_IRQS < NR_IRQS_EB)) |
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index b820edaf3184..db26e2e543f4 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c | |||
@@ -749,7 +749,6 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
749 | unsigned long instr = 0, instrptr; | 749 | unsigned long instr = 0, instrptr; |
750 | int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs); | 750 | int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs); |
751 | unsigned int type; | 751 | unsigned int type; |
752 | mm_segment_t fs; | ||
753 | unsigned int fault; | 752 | unsigned int fault; |
754 | u16 tinstr = 0; | 753 | u16 tinstr = 0; |
755 | int isize = 4; | 754 | int isize = 4; |
@@ -760,16 +759,15 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
760 | 759 | ||
761 | instrptr = instruction_pointer(regs); | 760 | instrptr = instruction_pointer(regs); |
762 | 761 | ||
763 | fs = get_fs(); | ||
764 | set_fs(KERNEL_DS); | ||
765 | if (thumb_mode(regs)) { | 762 | if (thumb_mode(regs)) { |
766 | fault = __get_user(tinstr, (u16 *)(instrptr & ~1)); | 763 | u16 *ptr = (u16 *)(instrptr & ~1); |
764 | fault = probe_kernel_address(ptr, tinstr); | ||
767 | if (!fault) { | 765 | if (!fault) { |
768 | if (cpu_architecture() >= CPU_ARCH_ARMv7 && | 766 | if (cpu_architecture() >= CPU_ARCH_ARMv7 && |
769 | IS_T32(tinstr)) { | 767 | IS_T32(tinstr)) { |
770 | /* Thumb-2 32-bit */ | 768 | /* Thumb-2 32-bit */ |
771 | u16 tinst2 = 0; | 769 | u16 tinst2 = 0; |
772 | fault = __get_user(tinst2, (u16 *)(instrptr+2)); | 770 | fault = probe_kernel_address(ptr + 1, tinst2); |
773 | instr = (tinstr << 16) | tinst2; | 771 | instr = (tinstr << 16) | tinst2; |
774 | thumb2_32b = 1; | 772 | thumb2_32b = 1; |
775 | } else { | 773 | } else { |
@@ -778,8 +776,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
778 | } | 776 | } |
779 | } | 777 | } |
780 | } else | 778 | } else |
781 | fault = __get_user(instr, (u32 *)instrptr); | 779 | fault = probe_kernel_address(instrptr, instr); |
782 | set_fs(fs); | ||
783 | 780 | ||
784 | if (fault) { | 781 | if (fault) { |
785 | type = TYPE_FAULT; | 782 | type = TYPE_FAULT; |
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 076c26d43864..dda3904dc64c 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -640,7 +640,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, | |||
640 | 640 | ||
641 | if (is_coherent || nommu()) | 641 | if (is_coherent || nommu()) |
642 | addr = __alloc_simple_buffer(dev, size, gfp, &page); | 642 | addr = __alloc_simple_buffer(dev, size, gfp, &page); |
643 | else if (gfp & GFP_ATOMIC) | 643 | else if (!(gfp & __GFP_WAIT)) |
644 | addr = __alloc_from_pool(size, &page); | 644 | addr = __alloc_from_pool(size, &page); |
645 | else if (!IS_ENABLED(CONFIG_CMA)) | 645 | else if (!IS_ENABLED(CONFIG_CMA)) |
646 | addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller); | 646 | addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller); |
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S index dd5e56f95f3f..8d10dc8a1e17 100644 --- a/arch/arm/vfp/vfphw.S +++ b/arch/arm/vfp/vfphw.S | |||
@@ -22,12 +22,14 @@ | |||
22 | .macro DBGSTR, str | 22 | .macro DBGSTR, str |
23 | #ifdef DEBUG | 23 | #ifdef DEBUG |
24 | stmfd sp!, {r0-r3, ip, lr} | 24 | stmfd sp!, {r0-r3, ip, lr} |
25 | add r0, pc, #4 | 25 | ldr r0, =1f |
26 | bl printk | 26 | bl printk |
27 | b 1f | 27 | ldmfd sp!, {r0-r3, ip, lr} |
28 | .asciz KERN_DEBUG "VFP: \str\n" | 28 | |
29 | .balign 4 | 29 | .pushsection .rodata, "a" |
30 | 1: ldmfd sp!, {r0-r3, ip, lr} | 30 | 1: .ascii KERN_DEBUG "VFP: \str\n" |
31 | .byte 0 | ||
32 | .previous | ||
31 | #endif | 33 | #endif |
32 | .endm | 34 | .endm |
33 | 35 | ||
@@ -35,12 +37,14 @@ | |||
35 | #ifdef DEBUG | 37 | #ifdef DEBUG |
36 | stmfd sp!, {r0-r3, ip, lr} | 38 | stmfd sp!, {r0-r3, ip, lr} |
37 | mov r1, \arg | 39 | mov r1, \arg |
38 | add r0, pc, #4 | 40 | ldr r0, =1f |
39 | bl printk | 41 | bl printk |
40 | b 1f | 42 | ldmfd sp!, {r0-r3, ip, lr} |
41 | .asciz KERN_DEBUG "VFP: \str\n" | 43 | |
42 | .balign 4 | 44 | .pushsection .rodata, "a" |
43 | 1: ldmfd sp!, {r0-r3, ip, lr} | 45 | 1: .ascii KERN_DEBUG "VFP: \str\n" |
46 | .byte 0 | ||
47 | .previous | ||
44 | #endif | 48 | #endif |
45 | .endm | 49 | .endm |
46 | 50 | ||
@@ -50,12 +54,14 @@ | |||
50 | mov r3, \arg3 | 54 | mov r3, \arg3 |
51 | mov r2, \arg2 | 55 | mov r2, \arg2 |
52 | mov r1, \arg1 | 56 | mov r1, \arg1 |
53 | add r0, pc, #4 | 57 | ldr r0, =1f |
54 | bl printk | 58 | bl printk |
55 | b 1f | 59 | ldmfd sp!, {r0-r3, ip, lr} |
56 | .asciz KERN_DEBUG "VFP: \str\n" | 60 | |
57 | .balign 4 | 61 | .pushsection .rodata, "a" |
58 | 1: ldmfd sp!, {r0-r3, ip, lr} | 62 | 1: .ascii KERN_DEBUG "VFP: \str\n" |
63 | .byte 0 | ||
64 | .previous | ||
59 | #endif | 65 | #endif |
60 | .endm | 66 | .endm |
61 | 67 | ||
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index 3b44e0dd0a93..5dfbb0b8e7f4 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c | |||
@@ -413,7 +413,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) | |||
413 | * If there isn't a second FP instruction, exit now. Note that | 413 | * If there isn't a second FP instruction, exit now. Note that |
414 | * the FPEXC.FP2V bit is valid only if FPEXC.EX is 1. | 414 | * the FPEXC.FP2V bit is valid only if FPEXC.EX is 1. |
415 | */ | 415 | */ |
416 | if (fpexc ^ (FPEXC_EX | FPEXC_FP2V)) | 416 | if ((fpexc & (FPEXC_EX | FPEXC_FP2V)) != (FPEXC_EX | FPEXC_FP2V)) |
417 | goto exit; | 417 | goto exit; |
418 | 418 | ||
419 | /* | 419 | /* |