.. | .. |
---|
638 | 638 | struct lock_class_key *key) |
---|
639 | 639 | { |
---|
640 | 640 | memset(worker, 0, sizeof(struct kthread_worker)); |
---|
641 | | - spin_lock_init(&worker->lock); |
---|
| 641 | + raw_spin_lock_init(&worker->lock); |
---|
642 | 642 | lockdep_set_class_and_name(&worker->lock, key, name); |
---|
643 | 643 | INIT_LIST_HEAD(&worker->work_list); |
---|
644 | 644 | INIT_LIST_HEAD(&worker->delayed_work_list); |
---|
.. | .. |
---|
680 | 680 | |
---|
681 | 681 | if (kthread_should_stop()) { |
---|
682 | 682 | __set_current_state(TASK_RUNNING); |
---|
683 | | - spin_lock_irq(&worker->lock); |
---|
| 683 | + raw_spin_lock_irq(&worker->lock); |
---|
684 | 684 | worker->task = NULL; |
---|
685 | | - spin_unlock_irq(&worker->lock); |
---|
| 685 | + raw_spin_unlock_irq(&worker->lock); |
---|
686 | 686 | return 0; |
---|
687 | 687 | } |
---|
688 | 688 | |
---|
689 | 689 | work = NULL; |
---|
690 | | - spin_lock_irq(&worker->lock); |
---|
| 690 | + raw_spin_lock_irq(&worker->lock); |
---|
691 | 691 | if (!list_empty(&worker->work_list)) { |
---|
692 | 692 | work = list_first_entry(&worker->work_list, |
---|
693 | 693 | struct kthread_work, node); |
---|
694 | 694 | list_del_init(&work->node); |
---|
695 | 695 | } |
---|
696 | 696 | worker->current_work = work; |
---|
697 | | - spin_unlock_irq(&worker->lock); |
---|
| 697 | + raw_spin_unlock_irq(&worker->lock); |
---|
698 | 698 | |
---|
699 | 699 | if (work) { |
---|
700 | 700 | __set_current_state(TASK_RUNNING); |
---|
.. | .. |
---|
851 | 851 | bool ret = false; |
---|
852 | 852 | unsigned long flags; |
---|
853 | 853 | |
---|
854 | | - spin_lock_irqsave(&worker->lock, flags); |
---|
| 854 | + raw_spin_lock_irqsave(&worker->lock, flags); |
---|
855 | 855 | if (!queuing_blocked(worker, work)) { |
---|
856 | 856 | kthread_insert_work(worker, work, &worker->work_list); |
---|
857 | 857 | ret = true; |
---|
858 | 858 | } |
---|
859 | | - spin_unlock_irqrestore(&worker->lock, flags); |
---|
| 859 | + raw_spin_unlock_irqrestore(&worker->lock, flags); |
---|
860 | 860 | return ret; |
---|
861 | 861 | } |
---|
862 | 862 | EXPORT_SYMBOL_GPL(kthread_queue_work); |
---|
.. | .. |
---|
882 | 882 | if (WARN_ON_ONCE(!worker)) |
---|
883 | 883 | return; |
---|
884 | 884 | |
---|
885 | | - spin_lock(&worker->lock); |
---|
| 885 | + raw_spin_lock(&worker->lock); |
---|
886 | 886 | /* Work must not be used with >1 worker, see kthread_queue_work(). */ |
---|
887 | 887 | WARN_ON_ONCE(work->worker != worker); |
---|
888 | 888 | |
---|
.. | .. |
---|
892 | 892 | if (!work->canceling) |
---|
893 | 893 | kthread_insert_work(worker, work, &worker->work_list); |
---|
894 | 894 | |
---|
895 | | - spin_unlock(&worker->lock); |
---|
| 895 | + raw_spin_unlock(&worker->lock); |
---|
896 | 896 | } |
---|
897 | 897 | EXPORT_SYMBOL(kthread_delayed_work_timer_fn); |
---|
898 | 898 | |
---|
.. | .. |
---|
948 | 948 | unsigned long flags; |
---|
949 | 949 | bool ret = false; |
---|
950 | 950 | |
---|
951 | | - spin_lock_irqsave(&worker->lock, flags); |
---|
| 951 | + raw_spin_lock_irqsave(&worker->lock, flags); |
---|
952 | 952 | |
---|
953 | 953 | if (!queuing_blocked(worker, work)) { |
---|
954 | 954 | __kthread_queue_delayed_work(worker, dwork, delay); |
---|
955 | 955 | ret = true; |
---|
956 | 956 | } |
---|
957 | 957 | |
---|
958 | | - spin_unlock_irqrestore(&worker->lock, flags); |
---|
| 958 | + raw_spin_unlock_irqrestore(&worker->lock, flags); |
---|
959 | 959 | return ret; |
---|
960 | 960 | } |
---|
961 | 961 | EXPORT_SYMBOL_GPL(kthread_queue_delayed_work); |
---|
.. | .. |
---|
991 | 991 | if (!worker) |
---|
992 | 992 | return; |
---|
993 | 993 | |
---|
994 | | - spin_lock_irq(&worker->lock); |
---|
| 994 | + raw_spin_lock_irq(&worker->lock); |
---|
995 | 995 | /* Work must not be used with >1 worker, see kthread_queue_work(). */ |
---|
996 | 996 | WARN_ON_ONCE(work->worker != worker); |
---|
997 | 997 | |
---|
.. | .. |
---|
1003 | 1003 | else |
---|
1004 | 1004 | noop = true; |
---|
1005 | 1005 | |
---|
1006 | | - spin_unlock_irq(&worker->lock); |
---|
| 1006 | + raw_spin_unlock_irq(&worker->lock); |
---|
1007 | 1007 | |
---|
1008 | 1008 | if (!noop) |
---|
1009 | 1009 | wait_for_completion(&fwork.done); |
---|
.. | .. |
---|
1031 | 1031 | * any queuing is blocked by setting the canceling counter. |
---|
1032 | 1032 | */ |
---|
1033 | 1033 | work->canceling++; |
---|
1034 | | - spin_unlock_irqrestore(&worker->lock, *flags); |
---|
| 1034 | + raw_spin_unlock_irqrestore(&worker->lock, *flags); |
---|
1035 | 1035 | del_timer_sync(&dwork->timer); |
---|
1036 | | - spin_lock_irqsave(&worker->lock, *flags); |
---|
| 1036 | + raw_spin_lock_irqsave(&worker->lock, *flags); |
---|
1037 | 1037 | work->canceling--; |
---|
1038 | 1038 | } |
---|
1039 | 1039 | |
---|
.. | .. |
---|
1095 | 1095 | unsigned long flags; |
---|
1096 | 1096 | int ret = false; |
---|
1097 | 1097 | |
---|
1098 | | - spin_lock_irqsave(&worker->lock, flags); |
---|
| 1098 | + raw_spin_lock_irqsave(&worker->lock, flags); |
---|
1099 | 1099 | |
---|
1100 | 1100 | /* Do not bother with canceling when never queued. */ |
---|
1101 | 1101 | if (!work->worker) |
---|
.. | .. |
---|
1124 | 1124 | fast_queue: |
---|
1125 | 1125 | __kthread_queue_delayed_work(worker, dwork, delay); |
---|
1126 | 1126 | out: |
---|
1127 | | - spin_unlock_irqrestore(&worker->lock, flags); |
---|
| 1127 | + raw_spin_unlock_irqrestore(&worker->lock, flags); |
---|
1128 | 1128 | return ret; |
---|
1129 | 1129 | } |
---|
1130 | 1130 | EXPORT_SYMBOL_GPL(kthread_mod_delayed_work); |
---|
.. | .. |
---|
1138 | 1138 | if (!worker) |
---|
1139 | 1139 | goto out; |
---|
1140 | 1140 | |
---|
1141 | | - spin_lock_irqsave(&worker->lock, flags); |
---|
| 1141 | + raw_spin_lock_irqsave(&worker->lock, flags); |
---|
1142 | 1142 | /* Work must not be used with >1 worker, see kthread_queue_work(). */ |
---|
1143 | 1143 | WARN_ON_ONCE(work->worker != worker); |
---|
1144 | 1144 | |
---|
.. | .. |
---|
1155 | 1155 | * In the meantime, block any queuing by setting the canceling counter. |
---|
1156 | 1156 | */ |
---|
1157 | 1157 | work->canceling++; |
---|
1158 | | - spin_unlock_irqrestore(&worker->lock, flags); |
---|
| 1158 | + raw_spin_unlock_irqrestore(&worker->lock, flags); |
---|
1159 | 1159 | kthread_flush_work(work); |
---|
1160 | | - spin_lock_irqsave(&worker->lock, flags); |
---|
| 1160 | + raw_spin_lock_irqsave(&worker->lock, flags); |
---|
1161 | 1161 | work->canceling--; |
---|
1162 | 1162 | |
---|
1163 | 1163 | out_fast: |
---|
1164 | | - spin_unlock_irqrestore(&worker->lock, flags); |
---|
| 1164 | + raw_spin_unlock_irqrestore(&worker->lock, flags); |
---|
1165 | 1165 | out: |
---|
1166 | 1166 | return ret; |
---|
1167 | 1167 | } |
---|