hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/kernel/kthread.c
....@@ -638,7 +638,7 @@
638638 struct lock_class_key *key)
639639 {
640640 memset(worker, 0, sizeof(struct kthread_worker));
641
- spin_lock_init(&worker->lock);
641
+ raw_spin_lock_init(&worker->lock);
642642 lockdep_set_class_and_name(&worker->lock, key, name);
643643 INIT_LIST_HEAD(&worker->work_list);
644644 INIT_LIST_HEAD(&worker->delayed_work_list);
....@@ -680,21 +680,21 @@
680680
681681 if (kthread_should_stop()) {
682682 __set_current_state(TASK_RUNNING);
683
- spin_lock_irq(&worker->lock);
683
+ raw_spin_lock_irq(&worker->lock);
684684 worker->task = NULL;
685
- spin_unlock_irq(&worker->lock);
685
+ raw_spin_unlock_irq(&worker->lock);
686686 return 0;
687687 }
688688
689689 work = NULL;
690
- spin_lock_irq(&worker->lock);
690
+ raw_spin_lock_irq(&worker->lock);
691691 if (!list_empty(&worker->work_list)) {
692692 work = list_first_entry(&worker->work_list,
693693 struct kthread_work, node);
694694 list_del_init(&work->node);
695695 }
696696 worker->current_work = work;
697
- spin_unlock_irq(&worker->lock);
697
+ raw_spin_unlock_irq(&worker->lock);
698698
699699 if (work) {
700700 __set_current_state(TASK_RUNNING);
....@@ -851,12 +851,12 @@
851851 bool ret = false;
852852 unsigned long flags;
853853
854
- spin_lock_irqsave(&worker->lock, flags);
854
+ raw_spin_lock_irqsave(&worker->lock, flags);
855855 if (!queuing_blocked(worker, work)) {
856856 kthread_insert_work(worker, work, &worker->work_list);
857857 ret = true;
858858 }
859
- spin_unlock_irqrestore(&worker->lock, flags);
859
+ raw_spin_unlock_irqrestore(&worker->lock, flags);
860860 return ret;
861861 }
862862 EXPORT_SYMBOL_GPL(kthread_queue_work);
....@@ -882,7 +882,7 @@
882882 if (WARN_ON_ONCE(!worker))
883883 return;
884884
885
- spin_lock(&worker->lock);
885
+ raw_spin_lock(&worker->lock);
886886 /* Work must not be used with >1 worker, see kthread_queue_work(). */
887887 WARN_ON_ONCE(work->worker != worker);
888888
....@@ -892,7 +892,7 @@
892892 if (!work->canceling)
893893 kthread_insert_work(worker, work, &worker->work_list);
894894
895
- spin_unlock(&worker->lock);
895
+ raw_spin_unlock(&worker->lock);
896896 }
897897 EXPORT_SYMBOL(kthread_delayed_work_timer_fn);
898898
....@@ -948,14 +948,14 @@
948948 unsigned long flags;
949949 bool ret = false;
950950
951
- spin_lock_irqsave(&worker->lock, flags);
951
+ raw_spin_lock_irqsave(&worker->lock, flags);
952952
953953 if (!queuing_blocked(worker, work)) {
954954 __kthread_queue_delayed_work(worker, dwork, delay);
955955 ret = true;
956956 }
957957
958
- spin_unlock_irqrestore(&worker->lock, flags);
958
+ raw_spin_unlock_irqrestore(&worker->lock, flags);
959959 return ret;
960960 }
961961 EXPORT_SYMBOL_GPL(kthread_queue_delayed_work);
....@@ -991,7 +991,7 @@
991991 if (!worker)
992992 return;
993993
994
- spin_lock_irq(&worker->lock);
994
+ raw_spin_lock_irq(&worker->lock);
995995 /* Work must not be used with >1 worker, see kthread_queue_work(). */
996996 WARN_ON_ONCE(work->worker != worker);
997997
....@@ -1003,7 +1003,7 @@
10031003 else
10041004 noop = true;
10051005
1006
- spin_unlock_irq(&worker->lock);
1006
+ raw_spin_unlock_irq(&worker->lock);
10071007
10081008 if (!noop)
10091009 wait_for_completion(&fwork.done);
....@@ -1031,9 +1031,9 @@
10311031 * any queuing is blocked by setting the canceling counter.
10321032 */
10331033 work->canceling++;
1034
- spin_unlock_irqrestore(&worker->lock, *flags);
1034
+ raw_spin_unlock_irqrestore(&worker->lock, *flags);
10351035 del_timer_sync(&dwork->timer);
1036
- spin_lock_irqsave(&worker->lock, *flags);
1036
+ raw_spin_lock_irqsave(&worker->lock, *flags);
10371037 work->canceling--;
10381038 }
10391039
....@@ -1095,7 +1095,7 @@
10951095 unsigned long flags;
10961096 int ret = false;
10971097
1098
- spin_lock_irqsave(&worker->lock, flags);
1098
+ raw_spin_lock_irqsave(&worker->lock, flags);
10991099
11001100 /* Do not bother with canceling when never queued. */
11011101 if (!work->worker)
....@@ -1124,7 +1124,7 @@
11241124 fast_queue:
11251125 __kthread_queue_delayed_work(worker, dwork, delay);
11261126 out:
1127
- spin_unlock_irqrestore(&worker->lock, flags);
1127
+ raw_spin_unlock_irqrestore(&worker->lock, flags);
11281128 return ret;
11291129 }
11301130 EXPORT_SYMBOL_GPL(kthread_mod_delayed_work);
....@@ -1138,7 +1138,7 @@
11381138 if (!worker)
11391139 goto out;
11401140
1141
- spin_lock_irqsave(&worker->lock, flags);
1141
+ raw_spin_lock_irqsave(&worker->lock, flags);
11421142 /* Work must not be used with >1 worker, see kthread_queue_work(). */
11431143 WARN_ON_ONCE(work->worker != worker);
11441144
....@@ -1155,13 +1155,13 @@
11551155 * In the meantime, block any queuing by setting the canceling counter.
11561156 */
11571157 work->canceling++;
1158
- spin_unlock_irqrestore(&worker->lock, flags);
1158
+ raw_spin_unlock_irqrestore(&worker->lock, flags);
11591159 kthread_flush_work(work);
1160
- spin_lock_irqsave(&worker->lock, flags);
1160
+ raw_spin_lock_irqsave(&worker->lock, flags);
11611161 work->canceling--;
11621162
11631163 out_fast:
1164
- spin_unlock_irqrestore(&worker->lock, flags);
1164
+ raw_spin_unlock_irqrestore(&worker->lock, flags);
11651165 out:
11661166 return ret;
11671167 }