.. | .. |
---|
32 | 32 | } |
---|
33 | 33 | EXPORT_SYMBOL(swake_up_locked); |
---|
34 | 34 | |
---|
| 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 | + */ |
---|
35 | 42 | void swake_up_all_locked(struct swait_queue_head *q) |
---|
36 | 43 | { |
---|
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); |
---|
51 | 46 | } |
---|
52 | | -EXPORT_SYMBOL(swake_up_all_locked); |
---|
53 | 47 | |
---|
54 | 48 | void swake_up_one(struct swait_queue_head *q) |
---|
55 | 49 | { |
---|
.. | .. |
---|
70 | 64 | struct swait_queue *curr; |
---|
71 | 65 | LIST_HEAD(tmp); |
---|
72 | 66 | |
---|
73 | | - WARN_ON(irqs_disabled()); |
---|
74 | 67 | raw_spin_lock_irq(&q->lock); |
---|
75 | 68 | list_splice_init(&q->task_list, &tmp); |
---|
76 | 69 | while (!list_empty(&tmp)) { |
---|
.. | .. |
---|
113 | 106 | long ret = 0; |
---|
114 | 107 | |
---|
115 | 108 | raw_spin_lock_irqsave(&q->lock, flags); |
---|
116 | | - if (unlikely(signal_pending_state(state, current))) { |
---|
| 109 | + if (signal_pending_state(state, current)) { |
---|
117 | 110 | /* |
---|
118 | 111 | * See prepare_to_wait_event(). TL;DR, subsequent swake_up_one() |
---|
119 | 112 | * must not see us. |
---|