* [RFC/PATCH] arm: oprofile: remove locking from suspend/resume
@ 2010-05-19 0:13 ` Kevin Hilman
0 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2010-05-19 0:13 UTC (permalink / raw)
To: linux-arm-kernel; +Cc: linux-omap
Since oprofile is a sysdev, its suspend/resume methods are called with
interrupts disabled. Using a mutex (which might sleep) in this atomic
context is not safe.
Since these methods are already called in atomic context, simply
remove the locking in the suspend/resume methods.
Found using lockdep on OMAP3 (Cortex-A8)
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
arch/arm/oprofile/common.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 3fcd752..ea005d8 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -79,19 +79,15 @@ static void op_arm_stop(void)
#ifdef CONFIG_PM
static int op_arm_suspend(struct sys_device *dev, pm_message_t state)
{
- mutex_lock(&op_arm_mutex);
if (op_arm_enabled)
op_arm_model->stop();
- mutex_unlock(&op_arm_mutex);
return 0;
}
static int op_arm_resume(struct sys_device *dev)
{
- mutex_lock(&op_arm_mutex);
if (op_arm_enabled && op_arm_model->start())
op_arm_enabled = 0;
- mutex_unlock(&op_arm_mutex);
return 0;
}
--
1.7.0.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RFC/PATCH] arm: oprofile: remove locking from suspend/resume
@ 2010-05-19 0:13 ` Kevin Hilman
0 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2010-05-19 0:13 UTC (permalink / raw)
To: linux-arm-kernel
Since oprofile is a sysdev, its suspend/resume methods are called with
interrupts disabled. Using a mutex (which might sleep) in this atomic
context is not safe.
Since these methods are already called in atomic context, simply
remove the locking in the suspend/resume methods.
Found using lockdep on OMAP3 (Cortex-A8)
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
arch/arm/oprofile/common.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 3fcd752..ea005d8 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -79,19 +79,15 @@ static void op_arm_stop(void)
#ifdef CONFIG_PM
static int op_arm_suspend(struct sys_device *dev, pm_message_t state)
{
- mutex_lock(&op_arm_mutex);
if (op_arm_enabled)
op_arm_model->stop();
- mutex_unlock(&op_arm_mutex);
return 0;
}
static int op_arm_resume(struct sys_device *dev)
{
- mutex_lock(&op_arm_mutex);
if (op_arm_enabled && op_arm_model->start())
op_arm_enabled = 0;
- mutex_unlock(&op_arm_mutex);
return 0;
}
--
1.7.0.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RFC/PATCH] arm: oprofile: remove locking from suspend/resume
2010-05-19 0:13 ` Kevin Hilman
@ 2010-05-19 7:04 ` Russell King - ARM Linux
-1 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2010-05-19 7:04 UTC (permalink / raw)
To: Kevin Hilman; +Cc: linux-arm-kernel, linux-omap
On Tue, May 18, 2010 at 05:13:01PM -0700, Kevin Hilman wrote:
> Since oprofile is a sysdev, its suspend/resume methods are called with
> interrupts disabled. Using a mutex (which might sleep) in this atomic
> context is not safe.
It isn't a sysdev anymore. Suggest you take a look at the ARM tree once
in a while.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RFC/PATCH] arm: oprofile: remove locking from suspend/resume
@ 2010-05-19 7:04 ` Russell King - ARM Linux
0 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2010-05-19 7:04 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, May 18, 2010 at 05:13:01PM -0700, Kevin Hilman wrote:
> Since oprofile is a sysdev, its suspend/resume methods are called with
> interrupts disabled. Using a mutex (which might sleep) in this atomic
> context is not safe.
It isn't a sysdev anymore. Suggest you take a look at the ARM tree once
in a while.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC/PATCH] arm: oprofile: remove locking from suspend/resume
2010-05-19 7:04 ` Russell King - ARM Linux
@ 2010-05-19 22:44 ` Kevin Hilman
-1 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2010-05-19 22:44 UTC (permalink / raw)
To: Russell King - ARM Linux; +Cc: linux-arm-kernel, linux-omap
Russell King - ARM Linux <linux@arm.linux.org.uk> writes:
> On Tue, May 18, 2010 at 05:13:01PM -0700, Kevin Hilman wrote:
>> Since oprofile is a sysdev, its suspend/resume methods are called with
>> interrupts disabled. Using a mutex (which might sleep) in this atomic
>> context is not safe.
>
> It isn't a sysdev anymore. Suggest you take a look at the ARM tree once
> in a while.
Indeed, I see it is fixed already there.
Sorry for the noise,
Kevin
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RFC/PATCH] arm: oprofile: remove locking from suspend/resume
@ 2010-05-19 22:44 ` Kevin Hilman
0 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2010-05-19 22:44 UTC (permalink / raw)
To: linux-arm-kernel
Russell King - ARM Linux <linux@arm.linux.org.uk> writes:
> On Tue, May 18, 2010 at 05:13:01PM -0700, Kevin Hilman wrote:
>> Since oprofile is a sysdev, its suspend/resume methods are called with
>> interrupts disabled. Using a mutex (which might sleep) in this atomic
>> context is not safe.
>
> It isn't a sysdev anymore. Suggest you take a look at the ARM tree once
> in a while.
Indeed, I see it is fixed already there.
Sorry for the noise,
Kevin
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-05-19 22:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-19 0:13 [RFC/PATCH] arm: oprofile: remove locking from suspend/resume Kevin Hilman
2010-05-19 0:13 ` Kevin Hilman
2010-05-19 7:04 ` Russell King - ARM Linux
2010-05-19 7:04 ` Russell King - ARM Linux
2010-05-19 22:44 ` Kevin Hilman
2010-05-19 22:44 ` Kevin Hilman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.