hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/drivers/thermal/x86_pkg_temp_thermal.c
....@@ -75,7 +75,7 @@
7575 /* Array of package pointers */
7676 static struct pkg_device **packages;
7777 /* Serializes interrupt notification, work and hotplug */
78
-static DEFINE_SPINLOCK(pkg_temp_lock);
78
+static DEFINE_RAW_SPINLOCK(pkg_temp_lock);
7979 /* Protects zone operation in the work function against hotplug removal */
8080 static DEFINE_MUTEX(thermal_zone_mutex);
8181
....@@ -291,12 +291,12 @@
291291 u64 msr_val, wr_val;
292292
293293 mutex_lock(&thermal_zone_mutex);
294
- spin_lock_irq(&pkg_temp_lock);
294
+ raw_spin_lock_irq(&pkg_temp_lock);
295295 ++pkg_work_cnt;
296296
297297 pkgdev = pkg_temp_thermal_get_dev(cpu);
298298 if (!pkgdev) {
299
- spin_unlock_irq(&pkg_temp_lock);
299
+ raw_spin_unlock_irq(&pkg_temp_lock);
300300 mutex_unlock(&thermal_zone_mutex);
301301 return;
302302 }
....@@ -310,7 +310,7 @@
310310 }
311311
312312 enable_pkg_thres_interrupt();
313
- spin_unlock_irq(&pkg_temp_lock);
313
+ raw_spin_unlock_irq(&pkg_temp_lock);
314314
315315 /*
316316 * If tzone is not NULL, then thermal_zone_mutex will prevent the
....@@ -335,7 +335,7 @@
335335 struct pkg_device *pkgdev;
336336 unsigned long flags;
337337
338
- spin_lock_irqsave(&pkg_temp_lock, flags);
338
+ raw_spin_lock_irqsave(&pkg_temp_lock, flags);
339339 ++pkg_interrupt_cnt;
340340
341341 disable_pkg_thres_interrupt();
....@@ -347,7 +347,7 @@
347347 pkg_thermal_schedule_work(pkgdev->cpu, &pkgdev->work);
348348 }
349349
350
- spin_unlock_irqrestore(&pkg_temp_lock, flags);
350
+ raw_spin_unlock_irqrestore(&pkg_temp_lock, flags);
351351 return 0;
352352 }
353353
....@@ -393,9 +393,9 @@
393393 pkgdev->msr_pkg_therm_high);
394394
395395 cpumask_set_cpu(cpu, &pkgdev->cpumask);
396
- spin_lock_irq(&pkg_temp_lock);
396
+ raw_spin_lock_irq(&pkg_temp_lock);
397397 packages[pkgid] = pkgdev;
398
- spin_unlock_irq(&pkg_temp_lock);
398
+ raw_spin_unlock_irq(&pkg_temp_lock);
399399 return 0;
400400 }
401401
....@@ -432,7 +432,7 @@
432432 }
433433
434434 /* Protect against work and interrupts */
435
- spin_lock_irq(&pkg_temp_lock);
435
+ raw_spin_lock_irq(&pkg_temp_lock);
436436
437437 /*
438438 * Check whether this cpu was the current target and store the new
....@@ -464,9 +464,9 @@
464464 * To cancel the work we need to drop the lock, otherwise
465465 * we might deadlock if the work needs to be flushed.
466466 */
467
- spin_unlock_irq(&pkg_temp_lock);
467
+ raw_spin_unlock_irq(&pkg_temp_lock);
468468 cancel_delayed_work_sync(&pkgdev->work);
469
- spin_lock_irq(&pkg_temp_lock);
469
+ raw_spin_lock_irq(&pkg_temp_lock);
470470 /*
471471 * If this is not the last cpu in the package and the work
472472 * did not run after we dropped the lock above, then we
....@@ -477,7 +477,7 @@
477477 pkg_thermal_schedule_work(target, &pkgdev->work);
478478 }
479479
480
- spin_unlock_irq(&pkg_temp_lock);
480
+ raw_spin_unlock_irq(&pkg_temp_lock);
481481
482482 /* Final cleanup if this is the last cpu */
483483 if (lastcpu)