Skip to content

Commit 167c3ad

Browse files
committed
Merge branch 'x86_pkg_temp' of .git into for-rc
2 parents 6ddcb7e + 7bed1b3 commit 167c3ad

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

drivers/thermal/x86_pkg_temp_thermal.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,18 +316,19 @@ static void pkg_temp_thermal_threshold_work_fn(struct work_struct *work)
316316
int phy_id = topology_physical_package_id(cpu);
317317
struct phy_dev_entry *phdev = pkg_temp_thermal_get_phy_entry(cpu);
318318
bool notify = false;
319+
unsigned long flags;
319320

320321
if (!phdev)
321322
return;
322323

323-
spin_lock(&pkg_work_lock);
324+
spin_lock_irqsave(&pkg_work_lock, flags);
324325
++pkg_work_cnt;
325326
if (unlikely(phy_id > max_phy_id)) {
326-
spin_unlock(&pkg_work_lock);
327+
spin_unlock_irqrestore(&pkg_work_lock, flags);
327328
return;
328329
}
329330
pkg_work_scheduled[phy_id] = 0;
330-
spin_unlock(&pkg_work_lock);
331+
spin_unlock_irqrestore(&pkg_work_lock, flags);
331332

332333
enable_pkg_thres_interrupt();
333334
rdmsrl(MSR_IA32_PACKAGE_THERM_STATUS, msr_val);
@@ -397,6 +398,7 @@ static int pkg_temp_thermal_device_add(unsigned int cpu)
397398
int thres_count;
398399
u32 eax, ebx, ecx, edx;
399400
u8 *temp;
401+
unsigned long flags;
400402

401403
cpuid(6, &eax, &ebx, &ecx, &edx);
402404
thres_count = ebx & 0x07;
@@ -420,19 +422,19 @@ static int pkg_temp_thermal_device_add(unsigned int cpu)
420422
goto err_ret_unlock;
421423
}
422424

423-
spin_lock(&pkg_work_lock);
425+
spin_lock_irqsave(&pkg_work_lock, flags);
424426
if (topology_physical_package_id(cpu) > max_phy_id)
425427
max_phy_id = topology_physical_package_id(cpu);
426428
temp = krealloc(pkg_work_scheduled,
427429
(max_phy_id+1) * sizeof(u8), GFP_ATOMIC);
428430
if (!temp) {
429-
spin_unlock(&pkg_work_lock);
431+
spin_unlock_irqrestore(&pkg_work_lock, flags);
430432
err = -ENOMEM;
431433
goto err_ret_free;
432434
}
433435
pkg_work_scheduled = temp;
434436
pkg_work_scheduled[topology_physical_package_id(cpu)] = 0;
435-
spin_unlock(&pkg_work_lock);
437+
spin_unlock_irqrestore(&pkg_work_lock, flags);
436438

437439
phy_dev_entry->phys_proc_id = topology_physical_package_id(cpu);
438440
phy_dev_entry->first_cpu = cpu;

0 commit comments

Comments
 (0)