| .. | .. |
|---|
| 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 | { |
|---|
| .. | .. |
|---|
| 113 | 107 | long ret = 0; |
|---|
| 114 | 108 | |
|---|
| 115 | 109 | raw_spin_lock_irqsave(&q->lock, flags); |
|---|
| 116 | | - if (unlikely(signal_pending_state(state, current))) { |
|---|
| 110 | + if (signal_pending_state(state, current)) { |
|---|
| 117 | 111 | /* |
|---|
| 118 | 112 | * See prepare_to_wait_event(). TL;DR, subsequent swake_up_one() |
|---|
| 119 | 113 | * must not see us. |
|---|