提交 7c5b3fc2 编写于 作者: R Russell King 提交者: Russell King

[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: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 b5893c56
...@@ -78,15 +78,19 @@ static void pmu_stop(void) ...@@ -78,15 +78,19 @@ static void pmu_stop(void)
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int pmu_suspend(struct sys_device *dev, pm_message_t state) static int pmu_suspend(struct sys_device *dev, pm_message_t state)
{ {
down(&pmu_sem);
if (pmu_enabled) if (pmu_enabled)
pmu_stop(); pmu_model->stop();
up(&pmu_sem);
return 0; return 0;
} }
static int pmu_resume(struct sys_device *dev) static int pmu_resume(struct sys_device *dev)
{ {
if (pmu_enabled) down(&pmu_sem);
pmu_start(); if (pmu_enabled && pmu_model->start())
pmu_enabled = 0;
up(&pmu_sem);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册