diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-31 20:02:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-31 20:02:57 -0400 |
commit | 94559a4a81a6912f6ca22988e544a43401947c68 (patch) | |
tree | b3c798ddb053df5c687fec7500b4d9fb42137235 | |
parent | 19ed3eb975b7de9b4b0e41714eb9302cd95e7ae6 (diff) | |
parent | eba1c71819d210f5e0d522571f9b8abce94fe9c5 (diff) |
Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King:
"Various assorted fixes:
- a couple of patches from Mark Rutland to resolve an errata with
Cortex-A15 CPUs.
- fix cpuidle for the CPU part ID changes in the last merge window
- add support for a relocation which ARM binutils is generating in
some circumstances"
* 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
ARM: 8130/1: cpuidle/cpuidle-big_little: fix reading cpu id part number
ARM: 8129/1: errata: work around Cortex-A15 erratum 830321 using dummy strex
ARM: 8128/1: abort: don't clear the exclusive monitors
ARM: 8127/1: module: add support for R_ARM_TARGET1 relocations
-rw-r--r-- | arch/arm/include/asm/cacheflush.h | 1 | ||||
-rw-r--r-- | arch/arm/include/asm/cputype.h | 3 | ||||
-rw-r--r-- | arch/arm/include/asm/elf.h | 1 | ||||
-rw-r--r-- | arch/arm/include/asm/smp_plat.h | 15 | ||||
-rw-r--r-- | arch/arm/kernel/entry-header.S | 29 | ||||
-rw-r--r-- | arch/arm/kernel/module.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mcpm-exynos.c | 1 | ||||
-rw-r--r-- | arch/arm/mm/abort-ev6.S | 6 | ||||
-rw-r--r-- | arch/arm/mm/abort-ev7.S | 6 | ||||
-rw-r--r-- | drivers/cpuidle/cpuidle-big_little.c | 13 |
10 files changed, 37 insertions, 39 deletions
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h index fd43f7f55b70..79ecb4f34ffb 100644 --- a/arch/arm/include/asm/cacheflush.h +++ b/arch/arm/include/asm/cacheflush.h | |||
@@ -472,7 +472,6 @@ static inline void __sync_cache_range_r(volatile void *p, size_t size) | |||
472 | "mcr p15, 0, r0, c1, c0, 0 @ set SCTLR \n\t" \ | 472 | "mcr p15, 0, r0, c1, c0, 0 @ set SCTLR \n\t" \ |
473 | "isb \n\t" \ | 473 | "isb \n\t" \ |
474 | "bl v7_flush_dcache_"__stringify(level)" \n\t" \ | 474 | "bl v7_flush_dcache_"__stringify(level)" \n\t" \ |
475 | "clrex \n\t" \ | ||
476 | "mrc p15, 0, r0, c1, c0, 1 @ get ACTLR \n\t" \ | 475 | "mrc p15, 0, r0, c1, c0, 1 @ get ACTLR \n\t" \ |
477 | "bic r0, r0, #(1 << 6) @ disable local coherency \n\t" \ | 476 | "bic r0, r0, #(1 << 6) @ disable local coherency \n\t" \ |
478 | "mcr p15, 0, r0, c1, c0, 1 @ set ACTLR \n\t" \ | 477 | "mcr p15, 0, r0, c1, c0, 1 @ set ACTLR \n\t" \ |
diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h index 963a2515906d..819777d0e91f 100644 --- a/arch/arm/include/asm/cputype.h +++ b/arch/arm/include/asm/cputype.h | |||
@@ -74,6 +74,7 @@ | |||
74 | #define ARM_CPU_PART_CORTEX_A12 0x4100c0d0 | 74 | #define ARM_CPU_PART_CORTEX_A12 0x4100c0d0 |
75 | #define ARM_CPU_PART_CORTEX_A17 0x4100c0e0 | 75 | #define ARM_CPU_PART_CORTEX_A17 0x4100c0e0 |
76 | #define ARM_CPU_PART_CORTEX_A15 0x4100c0f0 | 76 | #define ARM_CPU_PART_CORTEX_A15 0x4100c0f0 |
77 | #define ARM_CPU_PART_MASK 0xff00fff0 | ||
77 | 78 | ||
78 | #define ARM_CPU_XSCALE_ARCH_MASK 0xe000 | 79 | #define ARM_CPU_XSCALE_ARCH_MASK 0xe000 |
79 | #define ARM_CPU_XSCALE_ARCH_V1 0x2000 | 80 | #define ARM_CPU_XSCALE_ARCH_V1 0x2000 |
@@ -179,7 +180,7 @@ static inline unsigned int __attribute_const__ read_cpuid_implementor(void) | |||
179 | */ | 180 | */ |
180 | static inline unsigned int __attribute_const__ read_cpuid_part(void) | 181 | static inline unsigned int __attribute_const__ read_cpuid_part(void) |
181 | { | 182 | { |
182 | return read_cpuid_id() & 0xff00fff0; | 183 | return read_cpuid_id() & ARM_CPU_PART_MASK; |
183 | } | 184 | } |
184 | 185 | ||
185 | static inline unsigned int __attribute_const__ __deprecated read_cpuid_part_number(void) | 186 | static inline unsigned int __attribute_const__ __deprecated read_cpuid_part_number(void) |
diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h index f4b46d39b9cf..afb9cafd3786 100644 --- a/arch/arm/include/asm/elf.h +++ b/arch/arm/include/asm/elf.h | |||
@@ -50,6 +50,7 @@ typedef struct user_fp elf_fpregset_t; | |||
50 | #define R_ARM_ABS32 2 | 50 | #define R_ARM_ABS32 2 |
51 | #define R_ARM_CALL 28 | 51 | #define R_ARM_CALL 28 |
52 | #define R_ARM_JUMP24 29 | 52 | #define R_ARM_JUMP24 29 |
53 | #define R_ARM_TARGET1 38 | ||
53 | #define R_ARM_V4BX 40 | 54 | #define R_ARM_V4BX 40 |
54 | #define R_ARM_PREL31 42 | 55 | #define R_ARM_PREL31 42 |
55 | #define R_ARM_MOVW_ABS_NC 43 | 56 | #define R_ARM_MOVW_ABS_NC 43 |
diff --git a/arch/arm/include/asm/smp_plat.h b/arch/arm/include/asm/smp_plat.h index a252c0bfacf5..0ad7d490ee6f 100644 --- a/arch/arm/include/asm/smp_plat.h +++ b/arch/arm/include/asm/smp_plat.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/cpumask.h> | 8 | #include <linux/cpumask.h> |
9 | #include <linux/err.h> | 9 | #include <linux/err.h> |
10 | 10 | ||
11 | #include <asm/cpu.h> | ||
11 | #include <asm/cputype.h> | 12 | #include <asm/cputype.h> |
12 | 13 | ||
13 | /* | 14 | /* |
@@ -25,6 +26,20 @@ static inline bool is_smp(void) | |||
25 | #endif | 26 | #endif |
26 | } | 27 | } |
27 | 28 | ||
29 | /** | ||
30 | * smp_cpuid_part() - return part id for a given cpu | ||
31 | * @cpu: logical cpu id. | ||
32 | * | ||
33 | * Return: part id of logical cpu passed as argument. | ||
34 | */ | ||
35 | static inline unsigned int smp_cpuid_part(int cpu) | ||
36 | { | ||
37 | struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpu); | ||
38 | |||
39 | return is_smp() ? cpu_info->cpuid & ARM_CPU_PART_MASK : | ||
40 | read_cpuid_part(); | ||
41 | } | ||
42 | |||
28 | /* all SMP configurations have the extended CPUID registers */ | 43 | /* all SMP configurations have the extended CPUID registers */ |
29 | #ifndef CONFIG_MMU | 44 | #ifndef CONFIG_MMU |
30 | #define tlb_ops_need_broadcast() 0 | 45 | #define tlb_ops_need_broadcast() 0 |
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index 8db307d0954b..2fdf8679b46e 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S | |||
@@ -208,26 +208,21 @@ | |||
208 | #endif | 208 | #endif |
209 | .endif | 209 | .endif |
210 | msr spsr_cxsf, \rpsr | 210 | msr spsr_cxsf, \rpsr |
211 | #if defined(CONFIG_CPU_V6) | 211 | #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_32v6K) |
212 | ldr r0, [sp] | 212 | @ We must avoid clrex due to Cortex-A15 erratum #830321 |
213 | strex r1, r2, [sp] @ clear the exclusive monitor | 213 | sub r0, sp, #4 @ uninhabited address |
214 | ldmib sp, {r1 - pc}^ @ load r1 - pc, cpsr | 214 | strex r1, r2, [r0] @ clear the exclusive monitor |
215 | #elif defined(CONFIG_CPU_32v6K) | ||
216 | clrex @ clear the exclusive monitor | ||
217 | ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr | ||
218 | #else | ||
219 | ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr | ||
220 | #endif | 215 | #endif |
216 | ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr | ||
221 | .endm | 217 | .endm |
222 | 218 | ||
223 | .macro restore_user_regs, fast = 0, offset = 0 | 219 | .macro restore_user_regs, fast = 0, offset = 0 |
224 | ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr | 220 | ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr |
225 | ldr lr, [sp, #\offset + S_PC]! @ get pc | 221 | ldr lr, [sp, #\offset + S_PC]! @ get pc |
226 | msr spsr_cxsf, r1 @ save in spsr_svc | 222 | msr spsr_cxsf, r1 @ save in spsr_svc |
227 | #if defined(CONFIG_CPU_V6) | 223 | #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_32v6K) |
224 | @ We must avoid clrex due to Cortex-A15 erratum #830321 | ||
228 | strex r1, r2, [sp] @ clear the exclusive monitor | 225 | strex r1, r2, [sp] @ clear the exclusive monitor |
229 | #elif defined(CONFIG_CPU_32v6K) | ||
230 | clrex @ clear the exclusive monitor | ||
231 | #endif | 226 | #endif |
232 | .if \fast | 227 | .if \fast |
233 | ldmdb sp, {r1 - lr}^ @ get calling r1 - lr | 228 | ldmdb sp, {r1 - lr}^ @ get calling r1 - lr |
@@ -261,7 +256,10 @@ | |||
261 | .endif | 256 | .endif |
262 | ldr lr, [sp, #S_SP] @ top of the stack | 257 | ldr lr, [sp, #S_SP] @ top of the stack |
263 | ldrd r0, r1, [sp, #S_LR] @ calling lr and pc | 258 | ldrd r0, r1, [sp, #S_LR] @ calling lr and pc |
264 | clrex @ clear the exclusive monitor | 259 | |
260 | @ We must avoid clrex due to Cortex-A15 erratum #830321 | ||
261 | strex r2, r1, [sp, #S_LR] @ clear the exclusive monitor | ||
262 | |||
265 | stmdb lr!, {r0, r1, \rpsr} @ calling lr and rfe context | 263 | stmdb lr!, {r0, r1, \rpsr} @ calling lr and rfe context |
266 | ldmia sp, {r0 - r12} | 264 | ldmia sp, {r0 - r12} |
267 | mov sp, lr | 265 | mov sp, lr |
@@ -282,13 +280,16 @@ | |||
282 | .endm | 280 | .endm |
283 | #else /* ifdef CONFIG_CPU_V7M */ | 281 | #else /* ifdef CONFIG_CPU_V7M */ |
284 | .macro restore_user_regs, fast = 0, offset = 0 | 282 | .macro restore_user_regs, fast = 0, offset = 0 |
285 | clrex @ clear the exclusive monitor | ||
286 | mov r2, sp | 283 | mov r2, sp |
287 | load_user_sp_lr r2, r3, \offset + S_SP @ calling sp, lr | 284 | load_user_sp_lr r2, r3, \offset + S_SP @ calling sp, lr |
288 | ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr | 285 | ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr |
289 | ldr lr, [sp, #\offset + S_PC] @ get pc | 286 | ldr lr, [sp, #\offset + S_PC] @ get pc |
290 | add sp, sp, #\offset + S_SP | 287 | add sp, sp, #\offset + S_SP |
291 | msr spsr_cxsf, r1 @ save in spsr_svc | 288 | msr spsr_cxsf, r1 @ save in spsr_svc |
289 | |||
290 | @ We must avoid clrex due to Cortex-A15 erratum #830321 | ||
291 | strex r1, r2, [sp] @ clear the exclusive monitor | ||
292 | |||
292 | .if \fast | 293 | .if \fast |
293 | ldmdb sp, {r1 - r12} @ get calling r1 - r12 | 294 | ldmdb sp, {r1 - r12} @ get calling r1 - r12 |
294 | .else | 295 | .else |
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c index 45e478157278..6a4dffefd357 100644 --- a/arch/arm/kernel/module.c +++ b/arch/arm/kernel/module.c | |||
@@ -91,6 +91,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, | |||
91 | break; | 91 | break; |
92 | 92 | ||
93 | case R_ARM_ABS32: | 93 | case R_ARM_ABS32: |
94 | case R_ARM_TARGET1: | ||
94 | *(u32 *)loc += sym->st_value; | 95 | *(u32 *)loc += sym->st_value; |
95 | break; | 96 | break; |
96 | 97 | ||
diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c index b2f8b60cf0e9..dc9a764a7c37 100644 --- a/arch/arm/mach-exynos/mcpm-exynos.c +++ b/arch/arm/mach-exynos/mcpm-exynos.c | |||
@@ -43,7 +43,6 @@ | |||
43 | "mcr p15, 0, r0, c1, c0, 0 @ set SCTLR\n\t" \ | 43 | "mcr p15, 0, r0, c1, c0, 0 @ set SCTLR\n\t" \ |
44 | "isb\n\t"\ | 44 | "isb\n\t"\ |
45 | "bl v7_flush_dcache_"__stringify(level)"\n\t" \ | 45 | "bl v7_flush_dcache_"__stringify(level)"\n\t" \ |
46 | "clrex\n\t"\ | ||
47 | "mrc p15, 0, r0, c1, c0, 1 @ get ACTLR\n\t" \ | 46 | "mrc p15, 0, r0, c1, c0, 1 @ get ACTLR\n\t" \ |
48 | "bic r0, r0, #(1 << 6) @ disable local coherency\n\t" \ | 47 | "bic r0, r0, #(1 << 6) @ disable local coherency\n\t" \ |
49 | /* Dummy Load of a device register to avoid Erratum 799270 */ \ | 48 | /* Dummy Load of a device register to avoid Erratum 799270 */ \ |
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S index 3815a8262af0..8c48c5c22a33 100644 --- a/arch/arm/mm/abort-ev6.S +++ b/arch/arm/mm/abort-ev6.S | |||
@@ -17,12 +17,6 @@ | |||
17 | */ | 17 | */ |
18 | .align 5 | 18 | .align 5 |
19 | ENTRY(v6_early_abort) | 19 | ENTRY(v6_early_abort) |
20 | #ifdef CONFIG_CPU_V6 | ||
21 | sub r1, sp, #4 @ Get unused stack location | ||
22 | strex r0, r1, [r1] @ Clear the exclusive monitor | ||
23 | #elif defined(CONFIG_CPU_32v6K) | ||
24 | clrex | ||
25 | #endif | ||
26 | mrc p15, 0, r1, c5, c0, 0 @ get FSR | 20 | mrc p15, 0, r1, c5, c0, 0 @ get FSR |
27 | mrc p15, 0, r0, c6, c0, 0 @ get FAR | 21 | mrc p15, 0, r0, c6, c0, 0 @ get FAR |
28 | /* | 22 | /* |
diff --git a/arch/arm/mm/abort-ev7.S b/arch/arm/mm/abort-ev7.S index 703375277ba6..4812ad054214 100644 --- a/arch/arm/mm/abort-ev7.S +++ b/arch/arm/mm/abort-ev7.S | |||
@@ -13,12 +13,6 @@ | |||
13 | */ | 13 | */ |
14 | .align 5 | 14 | .align 5 |
15 | ENTRY(v7_early_abort) | 15 | ENTRY(v7_early_abort) |
16 | /* | ||
17 | * The effect of data aborts on on the exclusive access monitor are | ||
18 | * UNPREDICTABLE. Do a CLREX to clear the state | ||
19 | */ | ||
20 | clrex | ||
21 | |||
22 | mrc p15, 0, r1, c5, c0, 0 @ get FSR | 16 | mrc p15, 0, r1, c5, c0, 0 @ get FSR |
23 | mrc p15, 0, r0, c6, c0, 0 @ get FAR | 17 | mrc p15, 0, r0, c6, c0, 0 @ get FAR |
24 | 18 | ||
diff --git a/drivers/cpuidle/cpuidle-big_little.c b/drivers/cpuidle/cpuidle-big_little.c index 344d79fa3407..ef94c3b81f18 100644 --- a/drivers/cpuidle/cpuidle-big_little.c +++ b/drivers/cpuidle/cpuidle-big_little.c | |||
@@ -138,25 +138,18 @@ static int bl_enter_powerdown(struct cpuidle_device *dev, | |||
138 | return idx; | 138 | return idx; |
139 | } | 139 | } |
140 | 140 | ||
141 | static int __init bl_idle_driver_init(struct cpuidle_driver *drv, int cpu_id) | 141 | static int __init bl_idle_driver_init(struct cpuidle_driver *drv, int part_id) |
142 | { | 142 | { |
143 | struct cpuinfo_arm *cpu_info; | ||
144 | struct cpumask *cpumask; | 143 | struct cpumask *cpumask; |
145 | unsigned long cpuid; | ||
146 | int cpu; | 144 | int cpu; |
147 | 145 | ||
148 | cpumask = kzalloc(cpumask_size(), GFP_KERNEL); | 146 | cpumask = kzalloc(cpumask_size(), GFP_KERNEL); |
149 | if (!cpumask) | 147 | if (!cpumask) |
150 | return -ENOMEM; | 148 | return -ENOMEM; |
151 | 149 | ||
152 | for_each_possible_cpu(cpu) { | 150 | for_each_possible_cpu(cpu) |
153 | cpu_info = &per_cpu(cpu_data, cpu); | 151 | if (smp_cpuid_part(cpu) == part_id) |
154 | cpuid = is_smp() ? cpu_info->cpuid : read_cpuid_id(); | ||
155 | |||
156 | /* read cpu id part number */ | ||
157 | if ((cpuid & 0xFFF0) == cpu_id) | ||
158 | cpumask_set_cpu(cpu, cpumask); | 152 | cpumask_set_cpu(cpu, cpumask); |
159 | } | ||
160 | 153 | ||
161 | drv->cpumask = cpumask; | 154 | drv->cpumask = cpumask; |
162 | 155 | ||