PM / wakeup: Make s2idle_lock a RAW_SPINLOCK
The `s2idle_lock' is acquired during suspend while interrupts are disabled even on RT. The lock is acquired for short sections only. Make it a RAW lock which avoids "sleeping while atomic" warnings on RT. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
9c8cd6b62f
commit
62fc00a661
@ -61,7 +61,7 @@ static const struct platform_s2idle_ops *s2idle_ops;
|
|||||||
static DECLARE_SWAIT_QUEUE_HEAD(s2idle_wait_head);
|
static DECLARE_SWAIT_QUEUE_HEAD(s2idle_wait_head);
|
||||||
|
|
||||||
enum s2idle_states __read_mostly s2idle_state;
|
enum s2idle_states __read_mostly s2idle_state;
|
||||||
static DEFINE_SPINLOCK(s2idle_lock);
|
static DEFINE_RAW_SPINLOCK(s2idle_lock);
|
||||||
|
|
||||||
void s2idle_set_ops(const struct platform_s2idle_ops *ops)
|
void s2idle_set_ops(const struct platform_s2idle_ops *ops)
|
||||||
{
|
{
|
||||||
@ -79,12 +79,12 @@ static void s2idle_enter(void)
|
|||||||
{
|
{
|
||||||
trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, true);
|
trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, true);
|
||||||
|
|
||||||
spin_lock_irq(&s2idle_lock);
|
raw_spin_lock_irq(&s2idle_lock);
|
||||||
if (pm_wakeup_pending())
|
if (pm_wakeup_pending())
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
s2idle_state = S2IDLE_STATE_ENTER;
|
s2idle_state = S2IDLE_STATE_ENTER;
|
||||||
spin_unlock_irq(&s2idle_lock);
|
raw_spin_unlock_irq(&s2idle_lock);
|
||||||
|
|
||||||
get_online_cpus();
|
get_online_cpus();
|
||||||
cpuidle_resume();
|
cpuidle_resume();
|
||||||
@ -98,11 +98,11 @@ static void s2idle_enter(void)
|
|||||||
cpuidle_pause();
|
cpuidle_pause();
|
||||||
put_online_cpus();
|
put_online_cpus();
|
||||||
|
|
||||||
spin_lock_irq(&s2idle_lock);
|
raw_spin_lock_irq(&s2idle_lock);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
s2idle_state = S2IDLE_STATE_NONE;
|
s2idle_state = S2IDLE_STATE_NONE;
|
||||||
spin_unlock_irq(&s2idle_lock);
|
raw_spin_unlock_irq(&s2idle_lock);
|
||||||
|
|
||||||
trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, false);
|
trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, false);
|
||||||
}
|
}
|
||||||
@ -157,12 +157,12 @@ void s2idle_wake(void)
|
|||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock_irqsave(&s2idle_lock, flags);
|
raw_spin_lock_irqsave(&s2idle_lock, flags);
|
||||||
if (s2idle_state > S2IDLE_STATE_NONE) {
|
if (s2idle_state > S2IDLE_STATE_NONE) {
|
||||||
s2idle_state = S2IDLE_STATE_WAKE;
|
s2idle_state = S2IDLE_STATE_WAKE;
|
||||||
swake_up(&s2idle_wait_head);
|
swake_up(&s2idle_wait_head);
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&s2idle_lock, flags);
|
raw_spin_unlock_irqrestore(&s2idle_lock, flags);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(s2idle_wake);
|
EXPORT_SYMBOL_GPL(s2idle_wake);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user