.. | .. |
---|
32 | 32 | } |
---|
33 | 33 | EXPORT_SYMBOL(swake_up_locked); |
---|
34 | 34 | |
---|
| 35 | +void swake_up_all_locked(struct swait_queue_head *q) |
---|
| 36 | +{ |
---|
| 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); |
---|
| 51 | +} |
---|
| 52 | +EXPORT_SYMBOL(swake_up_all_locked); |
---|
| 53 | + |
---|
35 | 54 | void swake_up_one(struct swait_queue_head *q) |
---|
36 | 55 | { |
---|
37 | 56 | unsigned long flags; |
---|
.. | .. |
---|
51 | 70 | struct swait_queue *curr; |
---|
52 | 71 | LIST_HEAD(tmp); |
---|
53 | 72 | |
---|
| 73 | + WARN_ON(irqs_disabled()); |
---|
54 | 74 | raw_spin_lock_irq(&q->lock); |
---|
55 | 75 | list_splice_init(&q->task_list, &tmp); |
---|
56 | 76 | while (!list_empty(&tmp)) { |
---|
.. | .. |
---|
69 | 89 | } |
---|
70 | 90 | EXPORT_SYMBOL(swake_up_all); |
---|
71 | 91 | |
---|
72 | | -static void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait) |
---|
| 92 | +void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait) |
---|
73 | 93 | { |
---|
74 | 94 | wait->task = current; |
---|
75 | 95 | if (list_empty(&wait->task_list)) |
---|