mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
ARM: 7477/1: vfp: Always save VFP state in vfp_pm_suspend on UP
vfp_pm_suspend should save the VFP state in suspend after
any lazy context switch. If it only saves when the VFP is enabled,
the state can get lost when, on a UP system:
Thread 1 uses the VFP
Context switch occurs to thread 2, VFP is disabled but the
VFP context is not saved
Thread 2 initiates suspend
vfp_pm_suspend is called with the VFP disabled, and the unsaved
VFP context of Thread 1 in the registers
Modify vfp_pm_suspend to save the VFP context whenever
vfp_current_hw_state is not NULL.
Includes a fix from Ido Yariv <ido@wizery.com>, who pointed out that on
SMP systems, the state pointer can be pointing to a freed task struct if
a task exited on another cpu, fixed by using #ifndef CONFIG_SMP in the
new if clause.
Cc: Barry Song <bs14@csr.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ido Yariv <ido@wizery.com>
Cc: Daniel Drake <dsd@laptop.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
a84b895a23
commit
24b35521b8
1 changed files with 6 additions and 0 deletions
|
|
@ -457,6 +457,12 @@ static int vfp_pm_suspend(void)
|
||||||
|
|
||||||
/* disable, just in case */
|
/* disable, just in case */
|
||||||
fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
|
fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
|
||||||
|
} else if (vfp_current_hw_state[ti->cpu]) {
|
||||||
|
#ifndef CONFIG_SMP
|
||||||
|
fmxr(FPEXC, fpexc | FPEXC_EN);
|
||||||
|
vfp_save_state(vfp_current_hw_state[ti->cpu], fpexc);
|
||||||
|
fmxr(FPEXC, fpexc);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clear any information we had about last context state */
|
/* clear any information we had about last context state */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue