hc
2023-11-06 36f0949ef9854b82a9a3154d970da4e3b8d12a61
kernel/kernel/power/wakeup_reason.c
....@@ -44,7 +44,7 @@
4444 const char *irq_name;
4545 };
4646
47
-static DEFINE_SPINLOCK(wakeup_reason_lock);
47
+static DEFINE_RAW_SPINLOCK(wakeup_reason_lock);
4848
4949 static LIST_HEAD(leaf_irqs); /* kept in ascending IRQ sorted order */
5050 static LIST_HEAD(parent_irqs); /* unordered */
....@@ -149,17 +149,17 @@
149149 {
150150 unsigned long flags;
151151
152
- spin_lock_irqsave(&wakeup_reason_lock, flags);
152
+ raw_spin_lock_irqsave(&wakeup_reason_lock, flags);
153153
154154 if (!capture_reasons) {
155
- spin_unlock_irqrestore(&wakeup_reason_lock, flags);
155
+ raw_spin_unlock_irqrestore(&wakeup_reason_lock, flags);
156156 return;
157157 }
158158
159159 if (find_node_in_list(&parent_irqs, irq) == NULL)
160160 add_sibling_node_sorted(&leaf_irqs, irq);
161161
162
- spin_unlock_irqrestore(&wakeup_reason_lock, flags);
162
+ raw_spin_unlock_irqrestore(&wakeup_reason_lock, flags);
163163 }
164164
165165 void log_threaded_irq_wakeup_reason(int irq, int parent_irq)
....@@ -177,10 +177,10 @@
177177 if (!capture_reasons)
178178 return;
179179
180
- spin_lock_irqsave(&wakeup_reason_lock, flags);
180
+ raw_spin_lock_irqsave(&wakeup_reason_lock, flags);
181181
182182 if (!capture_reasons || (find_node_in_list(&leaf_irqs, irq) != NULL)) {
183
- spin_unlock_irqrestore(&wakeup_reason_lock, flags);
183
+ raw_spin_unlock_irqrestore(&wakeup_reason_lock, flags);
184184 return;
185185 }
186186
....@@ -196,7 +196,7 @@
196196 }
197197 }
198198
199
- spin_unlock_irqrestore(&wakeup_reason_lock, flags);
199
+ raw_spin_unlock_irqrestore(&wakeup_reason_lock, flags);
200200 }
201201
202202 static void __log_abort_or_abnormal_wake(bool abort, const char *fmt,
....@@ -204,11 +204,11 @@
204204 {
205205 unsigned long flags;
206206
207
- spin_lock_irqsave(&wakeup_reason_lock, flags);
207
+ raw_spin_lock_irqsave(&wakeup_reason_lock, flags);
208208
209209 /* Suspend abort or abnormal wake reason has already been logged. */
210210 if (suspend_abort || abnormal_wake) {
211
- spin_unlock_irqrestore(&wakeup_reason_lock, flags);
211
+ raw_spin_unlock_irqrestore(&wakeup_reason_lock, flags);
212212 return;
213213 }
214214
....@@ -216,7 +216,7 @@
216216 abnormal_wake = !abort;
217217 vsnprintf(non_irq_wake_reason, MAX_SUSPEND_ABORT_LEN, fmt, args);
218218
219
- spin_unlock_irqrestore(&wakeup_reason_lock, flags);
219
+ raw_spin_unlock_irqrestore(&wakeup_reason_lock, flags);
220220 }
221221
222222 void log_suspend_abort_reason(const char *fmt, ...)
....@@ -241,7 +241,7 @@
241241 {
242242 unsigned long flags;
243243
244
- spin_lock_irqsave(&wakeup_reason_lock, flags);
244
+ raw_spin_lock_irqsave(&wakeup_reason_lock, flags);
245245
246246 delete_list(&leaf_irqs);
247247 delete_list(&parent_irqs);
....@@ -249,7 +249,7 @@
249249 abnormal_wake = false;
250250 capture_reasons = true;
251251
252
- spin_unlock_irqrestore(&wakeup_reason_lock, flags);
252
+ raw_spin_unlock_irqrestore(&wakeup_reason_lock, flags);
253253 }
254254
255255 static void print_wakeup_sources(void)
....@@ -257,13 +257,13 @@
257257 struct wakeup_irq_node *n;
258258 unsigned long flags;
259259
260
- spin_lock_irqsave(&wakeup_reason_lock, flags);
260
+ raw_spin_lock_irqsave(&wakeup_reason_lock, flags);
261261
262262 capture_reasons = false;
263263
264264 if (suspend_abort) {
265265 pr_info("Abort: %s\n", non_irq_wake_reason);
266
- spin_unlock_irqrestore(&wakeup_reason_lock, flags);
266
+ raw_spin_unlock_irqrestore(&wakeup_reason_lock, flags);
267267 return;
268268 }
269269
....@@ -276,7 +276,7 @@
276276 else
277277 pr_info("Resume cause unknown\n");
278278
279
- spin_unlock_irqrestore(&wakeup_reason_lock, flags);
279
+ raw_spin_unlock_irqrestore(&wakeup_reason_lock, flags);
280280 }
281281
282282 static ssize_t last_resume_reason_show(struct kobject *kobj,
....@@ -286,12 +286,12 @@
286286 struct wakeup_irq_node *n;
287287 unsigned long flags;
288288
289
- spin_lock_irqsave(&wakeup_reason_lock, flags);
289
+ raw_spin_lock_irqsave(&wakeup_reason_lock, flags);
290290
291291 if (suspend_abort) {
292292 buf_offset = scnprintf(buf, PAGE_SIZE, "Abort: %s",
293293 non_irq_wake_reason);
294
- spin_unlock_irqrestore(&wakeup_reason_lock, flags);
294
+ raw_spin_unlock_irqrestore(&wakeup_reason_lock, flags);
295295 return buf_offset;
296296 }
297297
....@@ -304,7 +304,7 @@
304304 buf_offset = scnprintf(buf, PAGE_SIZE, "-1 %s",
305305 non_irq_wake_reason);
306306
307
- spin_unlock_irqrestore(&wakeup_reason_lock, flags);
307
+ raw_spin_unlock_irqrestore(&wakeup_reason_lock, flags);
308308
309309 return buf_offset;
310310 }