| .. | .. |
|---|
| 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 | + */ |
|---|
| 42 | +void swake_up_all_locked(struct swait_queue_head *q) |
|---|
| 43 | +{ |
|---|
| 44 | + while (!list_empty(&q->task_list)) |
|---|
| 45 | + swake_up_locked(q); |
|---|
| 46 | +} |
|---|
| 47 | + |
|---|
| 35 | 48 | void swake_up_one(struct swait_queue_head *q) |
|---|
| 36 | 49 | { |
|---|
| 37 | 50 | unsigned long flags; |
|---|
| .. | .. |
|---|
| 51 | 64 | struct swait_queue *curr; |
|---|
| 52 | 65 | LIST_HEAD(tmp); |
|---|
| 53 | 66 | |
|---|
| 67 | + WARN_ON(irqs_disabled()); |
|---|
| 54 | 68 | raw_spin_lock_irq(&q->lock); |
|---|
| 55 | 69 | list_splice_init(&q->task_list, &tmp); |
|---|
| 56 | 70 | while (!list_empty(&tmp)) { |
|---|
| .. | .. |
|---|
| 69 | 83 | } |
|---|
| 70 | 84 | EXPORT_SYMBOL(swake_up_all); |
|---|
| 71 | 85 | |
|---|
| 72 | | -static void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait) |
|---|
| 86 | +void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait) |
|---|
| 73 | 87 | { |
|---|
| 74 | 88 | wait->task = current; |
|---|
| 75 | 89 | if (list_empty(&wait->task_list)) |
|---|
| .. | .. |
|---|
| 93 | 107 | long ret = 0; |
|---|
| 94 | 108 | |
|---|
| 95 | 109 | raw_spin_lock_irqsave(&q->lock, flags); |
|---|
| 96 | | - if (unlikely(signal_pending_state(state, current))) { |
|---|
| 110 | + if (signal_pending_state(state, current)) { |
|---|
| 97 | 111 | /* |
|---|
| 98 | 112 | * See prepare_to_wait_event(). TL;DR, subsequent swake_up_one() |
|---|
| 99 | 113 | * must not see us. |
|---|