Skip to content

Commit

Permalink
[ARM] 2/4 Fix oprofile suspend/resume
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King authored and Russell King committed Oct 28, 2005
1 parent b5893c5 commit 7c5b3fc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions arch/arm/oprofile/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7c5b3fc

Please sign in to comment.