Skip to content

Commit 62fc00a

Browse files
Sebastian Andrzej Siewiorrafaeljw
authored andcommitted
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>
1 parent 9c8cd6b commit 62fc00a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

kernel/power/suspend.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static const struct platform_s2idle_ops *s2idle_ops;
6161
static DECLARE_SWAIT_QUEUE_HEAD(s2idle_wait_head);
6262

6363
enum s2idle_states __read_mostly s2idle_state;
64-
static DEFINE_SPINLOCK(s2idle_lock);
64+
static DEFINE_RAW_SPINLOCK(s2idle_lock);
6565

6666
void s2idle_set_ops(const struct platform_s2idle_ops *ops)
6767
{
@@ -79,12 +79,12 @@ static void s2idle_enter(void)
7979
{
8080
trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, true);
8181

82-
spin_lock_irq(&s2idle_lock);
82+
raw_spin_lock_irq(&s2idle_lock);
8383
if (pm_wakeup_pending())
8484
goto out;
8585

8686
s2idle_state = S2IDLE_STATE_ENTER;
87-
spin_unlock_irq(&s2idle_lock);
87+
raw_spin_unlock_irq(&s2idle_lock);
8888

8989
get_online_cpus();
9090
cpuidle_resume();
@@ -98,11 +98,11 @@ static void s2idle_enter(void)
9898
cpuidle_pause();
9999
put_online_cpus();
100100

101-
spin_lock_irq(&s2idle_lock);
101+
raw_spin_lock_irq(&s2idle_lock);
102102

103103
out:
104104
s2idle_state = S2IDLE_STATE_NONE;
105-
spin_unlock_irq(&s2idle_lock);
105+
raw_spin_unlock_irq(&s2idle_lock);
106106

107107
trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, false);
108108
}
@@ -157,12 +157,12 @@ void s2idle_wake(void)
157157
{
158158
unsigned long flags;
159159

160-
spin_lock_irqsave(&s2idle_lock, flags);
160+
raw_spin_lock_irqsave(&s2idle_lock, flags);
161161
if (s2idle_state > S2IDLE_STATE_NONE) {
162162
s2idle_state = S2IDLE_STATE_WAKE;
163163
swake_up(&s2idle_wait_head);
164164
}
165-
spin_unlock_irqrestore(&s2idle_lock, flags);
165+
raw_spin_unlock_irqrestore(&s2idle_lock, flags);
166166
}
167167
EXPORT_SYMBOL_GPL(s2idle_wake);
168168

0 commit comments

Comments
 (0)