diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-01 19:30:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-01 19:30:45 -0400 |
commit | 9a2533c3eb91b3e769c2612c5d68e811bfc0ecf6 (patch) | |
tree | 74865c4c40442d109e42bcc72009ebd0c320eba3 /arch/arm/vfp | |
parent | d4fdc32517efaab0493c134d5cc070c252d51275 (diff) | |
parent | b74253f78400f9a4b42da84bb1de7540b88ce7c4 (diff) |
Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm
Pull ARM fixes from Russell King:
"This fixes various issues found during July"
* 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
ARM: 7479/1: mm: avoid NULL dereference when flushing gate_vma with VIVT caches
ARM: Fix undefined instruction exception handling
ARM: 7480/1: only call smp_send_stop() on SMP
ARM: 7478/1: errata: extend workaround for erratum #720789
ARM: 7477/1: vfp: Always save VFP state in vfp_pm_suspend on UP
ARM: 7476/1: vfp: only clear vfp state for current cpu in vfp_pm_suspend
ARM: 7468/1: ftrace: Trace function entry before updating index
ARM: 7467/1: mutex: use generic xchg-based implementation for ARMv6+
ARM: 7466/1: disable interrupt before spinning endlessly
ARM: 7465/1: Handle >4GB memory sizes in device tree and mem=size@start option
Diffstat (limited to 'arch/arm/vfp')
-rw-r--r-- | arch/arm/vfp/entry.S | 16 | ||||
-rw-r--r-- | arch/arm/vfp/vfphw.S | 19 | ||||
-rw-r--r-- | arch/arm/vfp/vfpmodule.c | 8 |
3 files changed, 27 insertions, 16 deletions
diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S index 4fa9903b83cf..cc926c985981 100644 --- a/arch/arm/vfp/entry.S +++ b/arch/arm/vfp/entry.S | |||
@@ -7,18 +7,20 @@ | |||
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | * | ||
11 | * Basic entry code, called from the kernel's undefined instruction trap. | ||
12 | * r0 = faulted instruction | ||
13 | * r5 = faulted PC+4 | ||
14 | * r9 = successful return | ||
15 | * r10 = thread_info structure | ||
16 | * lr = failure return | ||
17 | */ | 10 | */ |
18 | #include <asm/thread_info.h> | 11 | #include <asm/thread_info.h> |
19 | #include <asm/vfpmacros.h> | 12 | #include <asm/vfpmacros.h> |
20 | #include "../kernel/entry-header.S" | 13 | #include "../kernel/entry-header.S" |
21 | 14 | ||
15 | @ VFP entry point. | ||
16 | @ | ||
17 | @ r0 = instruction opcode (32-bit ARM or two 16-bit Thumb) | ||
18 | @ r2 = PC value to resume execution after successful emulation | ||
19 | @ r9 = normal "successful" return address | ||
20 | @ r10 = this threads thread_info structure | ||
21 | @ lr = unrecognised instruction return address | ||
22 | @ IRQs disabled. | ||
23 | @ | ||
22 | ENTRY(do_vfp) | 24 | ENTRY(do_vfp) |
23 | #ifdef CONFIG_PREEMPT | 25 | #ifdef CONFIG_PREEMPT |
24 | ldr r4, [r10, #TI_PREEMPT] @ get preempt count | 26 | ldr r4, [r10, #TI_PREEMPT] @ get preempt count |
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S index d50f0e486cf2..ea0349f63586 100644 --- a/arch/arm/vfp/vfphw.S +++ b/arch/arm/vfp/vfphw.S | |||
@@ -62,13 +62,13 @@ | |||
62 | 62 | ||
63 | @ VFP hardware support entry point. | 63 | @ VFP hardware support entry point. |
64 | @ | 64 | @ |
65 | @ r0 = faulted instruction | 65 | @ r0 = instruction opcode (32-bit ARM or two 16-bit Thumb) |
66 | @ r2 = faulted PC+4 | 66 | @ r2 = PC value to resume execution after successful emulation |
67 | @ r9 = successful return | 67 | @ r9 = normal "successful" return address |
68 | @ r10 = vfp_state union | 68 | @ r10 = vfp_state union |
69 | @ r11 = CPU number | 69 | @ r11 = CPU number |
70 | @ lr = failure return | 70 | @ lr = unrecognised instruction return address |
71 | 71 | @ IRQs enabled. | |
72 | ENTRY(vfp_support_entry) | 72 | ENTRY(vfp_support_entry) |
73 | DBGSTR3 "instr %08x pc %08x state %p", r0, r2, r10 | 73 | DBGSTR3 "instr %08x pc %08x state %p", r0, r2, r10 |
74 | 74 | ||
@@ -162,9 +162,12 @@ vfp_hw_state_valid: | |||
162 | @ exception before retrying branch | 162 | @ exception before retrying branch |
163 | @ out before setting an FPEXC that | 163 | @ out before setting an FPEXC that |
164 | @ stops us reading stuff | 164 | @ stops us reading stuff |
165 | VFPFMXR FPEXC, r1 @ restore FPEXC last | 165 | VFPFMXR FPEXC, r1 @ Restore FPEXC last |
166 | sub r2, r2, #4 | 166 | sub r2, r2, #4 @ Retry current instruction - if Thumb |
167 | str r2, [sp, #S_PC] @ retry the instruction | 167 | str r2, [sp, #S_PC] @ mode it's two 16-bit instructions, |
168 | @ else it's one 32-bit instruction, so | ||
169 | @ always subtract 4 from the following | ||
170 | @ instruction address. | ||
168 | #ifdef CONFIG_PREEMPT | 171 | #ifdef CONFIG_PREEMPT |
169 | get_thread_info r10 | 172 | get_thread_info r10 |
170 | ldr r4, [r10, #TI_PREEMPT] @ get preempt count | 173 | ldr r4, [r10, #TI_PREEMPT] @ get preempt count |
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index 586961929e96..fb849d044bde 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c | |||
@@ -457,10 +457,16 @@ static int vfp_pm_suspend(void) | |||
457 | 457 | ||
458 | /* disable, just in case */ | 458 | /* disable, just in case */ |
459 | fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN); | 459 | fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN); |
460 | } else if (vfp_current_hw_state[ti->cpu]) { | ||
461 | #ifndef CONFIG_SMP | ||
462 | fmxr(FPEXC, fpexc | FPEXC_EN); | ||
463 | vfp_save_state(vfp_current_hw_state[ti->cpu], fpexc); | ||
464 | fmxr(FPEXC, fpexc); | ||
465 | #endif | ||
460 | } | 466 | } |
461 | 467 | ||
462 | /* clear any information we had about last context state */ | 468 | /* clear any information we had about last context state */ |
463 | memset(vfp_current_hw_state, 0, sizeof(vfp_current_hw_state)); | 469 | vfp_current_hw_state[ti->cpu] = NULL; |
464 | 470 | ||
465 | return 0; | 471 | return 0; |
466 | } | 472 | } |