Skip to content

Commit 9c8cd6b

Browse files
Sebastian Andrzej Siewiorrafaeljw
authored andcommitted
PM / s2idle: Make s2idle_wait_head swait based
s2idle_wait_head is used during s2idle with interrupts disabled even on RT. There is no "custom" wake up function so swait could be used instead which is also lower weight compared to the wait_queue. Make s2idle_wait_head a swait_queue_head. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent bccaada commit 9c8cd6b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

kernel/power/suspend.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/export.h>
2828
#include <linux/suspend.h>
2929
#include <linux/syscore_ops.h>
30+
#include <linux/swait.h>
3031
#include <linux/ftrace.h>
3132
#include <trace/events/power.h>
3233
#include <linux/compiler.h>
@@ -57,7 +58,7 @@ EXPORT_SYMBOL_GPL(pm_suspend_global_flags);
5758

5859
static const struct platform_suspend_ops *suspend_ops;
5960
static const struct platform_s2idle_ops *s2idle_ops;
60-
static DECLARE_WAIT_QUEUE_HEAD(s2idle_wait_head);
61+
static DECLARE_SWAIT_QUEUE_HEAD(s2idle_wait_head);
6162

6263
enum s2idle_states __read_mostly s2idle_state;
6364
static DEFINE_SPINLOCK(s2idle_lock);
@@ -91,8 +92,8 @@ static void s2idle_enter(void)
9192
/* Push all the CPUs into the idle loop. */
9293
wake_up_all_idle_cpus();
9394
/* Make the current CPU wait so it can enter the idle loop too. */
94-
wait_event(s2idle_wait_head,
95-
s2idle_state == S2IDLE_STATE_WAKE);
95+
swait_event(s2idle_wait_head,
96+
s2idle_state == S2IDLE_STATE_WAKE);
9697

9798
cpuidle_pause();
9899
put_online_cpus();
@@ -159,7 +160,7 @@ void s2idle_wake(void)
159160
spin_lock_irqsave(&s2idle_lock, flags);
160161
if (s2idle_state > S2IDLE_STATE_NONE) {
161162
s2idle_state = S2IDLE_STATE_WAKE;
162-
wake_up(&s2idle_wait_head);
163+
swake_up(&s2idle_wait_head);
163164
}
164165
spin_unlock_irqrestore(&s2idle_lock, flags);
165166
}

0 commit comments

Comments
 (0)