forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/kernel/sched/swait.c
....@@ -32,24 +32,18 @@
3232 }
3333 EXPORT_SYMBOL(swake_up_locked);
3434
35
+/*
36
+ * Wake up all waiters. This is an interface which is solely exposed for
37
+ * completions and not for general usage.
38
+ *
39
+ * It is intentionally different from swake_up_all() to allow usage from
40
+ * hard interrupt context and interrupt disabled regions.
41
+ */
3542 void swake_up_all_locked(struct swait_queue_head *q)
3643 {
37
- struct swait_queue *curr;
38
- int wakes = 0;
39
-
40
- while (!list_empty(&q->task_list)) {
41
-
42
- curr = list_first_entry(&q->task_list, typeof(*curr),
43
- task_list);
44
- wake_up_process(curr->task);
45
- list_del_init(&curr->task_list);
46
- wakes++;
47
- }
48
- if (pm_in_action)
49
- return;
50
- WARN(wakes > 2, "complete_all() with %d waiters\n", wakes);
44
+ while (!list_empty(&q->task_list))
45
+ swake_up_locked(q);
5146 }
52
-EXPORT_SYMBOL(swake_up_all_locked);
5347
5448 void swake_up_one(struct swait_queue_head *q)
5549 {
....@@ -113,7 +107,7 @@
113107 long ret = 0;
114108
115109 raw_spin_lock_irqsave(&q->lock, flags);
116
- if (unlikely(signal_pending_state(state, current))) {
110
+ if (signal_pending_state(state, current)) {
117111 /*
118112 * See prepare_to_wait_event(). TL;DR, subsequent swake_up_one()
119113 * must not see us.