summaryrefslogtreecommitdiffstats
path: root/arch/arm/oprofile
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-10-28 15:52:30 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-10-28 15:52:30 +0200
commit7c5b3fc20807279d8f8e78f1e2ef275128668796 (patch)
tree393e609ef9e6cd32c9fbce258686a462b33b4ce8 /arch/arm/oprofile
parent[ARM] 1/4 Move oprofile driver model code (diff)
downloadlinux-7c5b3fc20807279d8f8e78f1e2ef275128668796.tar.xz
linux-7c5b3fc20807279d8f8e78f1e2ef275128668796.zip
[ARM] 2/4 Fix oprofile suspend/resume
The oprofile suspend/resume was missing locking. If we failed to start oprofile on resume, we still reported that it was enabled. Instead, disable oprofile on error. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/oprofile')
-rw-r--r--arch/arm/oprofile/common.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 5b1d752edbc3..02e5d6f45166 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -78,15 +78,19 @@ static void pmu_stop(void)
#ifdef CONFIG_PM
static int pmu_suspend(struct sys_device *dev, pm_message_t state)
{
+ down(&pmu_sem);
if (pmu_enabled)
- pmu_stop();
+ pmu_model->stop();
+ up(&pmu_sem);
return 0;
}
static int pmu_resume(struct sys_device *dev)
{
- if (pmu_enabled)
- pmu_start();
+ down(&pmu_sem);
+ if (pmu_enabled && pmu_model->start())
+ pmu_enabled = 0;
+ up(&pmu_sem);
return 0;
}