mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
ARM: imx6: cpuidle: Use raw_spinlock_t
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> Reviewed-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
This commit is contained in:
parent
a188339ca5
commit
99ae52edeb
1 changed files with 5 additions and 5 deletions
|
@ -17,22 +17,22 @@
|
||||||
#include "hardware.h"
|
#include "hardware.h"
|
||||||
|
|
||||||
static int num_idle_cpus = 0;
|
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,
|
static int imx6q_enter_wait(struct cpuidle_device *dev,
|
||||||
struct cpuidle_driver *drv, int index)
|
struct cpuidle_driver *drv, int index)
|
||||||
{
|
{
|
||||||
spin_lock(&cpuidle_lock);
|
raw_spin_lock(&cpuidle_lock);
|
||||||
if (++num_idle_cpus == num_online_cpus())
|
if (++num_idle_cpus == num_online_cpus())
|
||||||
imx6_set_lpm(WAIT_UNCLOCKED);
|
imx6_set_lpm(WAIT_UNCLOCKED);
|
||||||
spin_unlock(&cpuidle_lock);
|
raw_spin_unlock(&cpuidle_lock);
|
||||||
|
|
||||||
cpu_do_idle();
|
cpu_do_idle();
|
||||||
|
|
||||||
spin_lock(&cpuidle_lock);
|
raw_spin_lock(&cpuidle_lock);
|
||||||
if (num_idle_cpus-- == num_online_cpus())
|
if (num_idle_cpus-- == num_online_cpus())
|
||||||
imx6_set_lpm(WAIT_CLOCKED);
|
imx6_set_lpm(WAIT_CLOCKED);
|
||||||
spin_unlock(&cpuidle_lock);
|
raw_spin_unlock(&cpuidle_lock);
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue