summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-10-09 02:33:47 +0100
committerAndy Green <andy.green@linaro.org>2011-10-09 02:33:47 +0100
commit9b72338a2f951ba4074c2e6d8db28b48c91c5b11 (patch)
treede3699c6e433f700a9d7f33595098ab44235b6f5
parent9aaee2a932be9112b2a1c9a3ec203dcc8cb2af1e (diff)
ARM: vfp: Always save VFP state in vfp_pm_suspend
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. Change-Id: I91f29722d256a3afc1cc04df8b227541434ccffb Cc: Russell King <linux@arm.linux.org.uk> Cc: Barry Song <bs14@csr.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Colin Cross <ccross@android.com>
-rw-r--r--arch/arm/vfp/vfpmodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 79bcb431693..d676dd76166 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -451,6 +451,10 @@ static int vfp_pm_suspend(void)
/* disable, just in case */
fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
+ } else if (vfp_current_hw_state[ti->cpu]) {
+ fmxr(FPEXC, fpexc | FPEXC_EN);
+ vfp_save_state(vfp_current_hw_state[ti->cpu], fpexc);
+ fmxr(FPEXC, fpexc);
}
/* clear any information we had about last context state */