diff mbox series

arm: imx6: cpuidle: Use raw_spinlock_t

Message ID 20190529154229.14911-1-bigeasy@linutronix.de
State New
Headers show
Series arm: imx6: cpuidle: Use raw_spinlock_t | expand

Commit Message

Sebastian Andrzej Siewior May 29, 2019, 3:42 p.m. UTC
The idle call back is invoked with disabled interrupts and requires
raw_spinlock_t locks to work.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 arch/arm/mach-imx/cpuidle-imx6q.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Fabio Estevam May 30, 2019, 1:54 p.m. UTC | #1
Hi Sebastian,

On Wed, May 29, 2019 at 12:42 PM Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
>
> The idle call back is invoked with disabled interrupts and requires
> raw_spinlock_t locks to work.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Should this fix go to the stable trees? If so, please add a Fixes tag
and Cc stable.

Thanks
Sebastian Andrzej Siewior May 30, 2019, 2:03 p.m. UTC | #2
On 2019-05-30 10:54:16 [-0300], Fabio Estevam wrote:
> Hi Sebastian,
Hi Fabio,

> Should this fix go to the stable trees? If so, please add a Fixes tag
> and Cc stable.

It makes no difference for !RT builds so I would avoid it. The RT
releases for the relevant kernels will pick it up along with other RT
related fixes.

> Thanks

Sebastian
Fabio Estevam May 30, 2019, 2:06 p.m. UTC | #3
On Thu, May 30, 2019 at 11:03 AM Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:

> It makes no difference for !RT builds so I would avoid it. The RT
> releases for the relevant kernels will pick it up along with other RT
> related fixes.

Thanks for the clarification:

Reviewed-by: Fabio Estevam <festevam@gmail.com>
Shawn Guo June 6, 2019, 12:59 a.m. UTC | #4
On Wed, May 29, 2019 at 05:42:29PM +0200, Sebastian Andrzej Siewior wrote:
> The idle call back is invoked with disabled interrupts and requires
> raw_spinlock_t locks to work.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Applied with changing subject prefix to 'ARM: imx6: ...', thanks.

Shawn
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c
index 326e870d71239..d9ac80aa1eb0a 100644
--- a/arch/arm/mach-imx/cpuidle-imx6q.c
+++ b/arch/arm/mach-imx/cpuidle-imx6q.c
@@ -17,22 +17,22 @@ 
 #include "hardware.h"
 
 static int num_idle_cpus = 0;
-static DEFINE_SPINLOCK(cpuidle_lock);
+static DEFINE_RAW_SPINLOCK(cpuidle_lock);
 
 static int imx6q_enter_wait(struct cpuidle_device *dev,
 			    struct cpuidle_driver *drv, int index)
 {
-	spin_lock(&cpuidle_lock);
+	raw_spin_lock(&cpuidle_lock);
 	if (++num_idle_cpus == num_online_cpus())
 		imx6_set_lpm(WAIT_UNCLOCKED);
-	spin_unlock(&cpuidle_lock);
+	raw_spin_unlock(&cpuidle_lock);
 
 	cpu_do_idle();
 
-	spin_lock(&cpuidle_lock);
+	raw_spin_lock(&cpuidle_lock);
 	if (num_idle_cpus-- == num_online_cpus())
 		imx6_set_lpm(WAIT_CLOCKED);
-	spin_unlock(&cpuidle_lock);
+	raw_spin_unlock(&cpuidle_lock);
 
 	return index;
 }