thermal/x86_pkg_temp: Cleanup thermal interrupt handling
Wenn a package is removed nothing restores the thermal interrupt MSR so the content will be stale when a CPU of that package becomes online again. Aside of that the work function reenables interrupts before acknowledging the current one, which is the wrong order to begin with. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>zero-colors
parent
c6068a6edd
commit
768bd13c93
|
@ -334,7 +334,6 @@ static void pkg_temp_thermal_threshold_work_fn(struct work_struct *work)
|
||||||
pkg_work_scheduled[phy_id] = 0;
|
pkg_work_scheduled[phy_id] = 0;
|
||||||
spin_unlock_irqrestore(&pkg_work_lock, flags);
|
spin_unlock_irqrestore(&pkg_work_lock, flags);
|
||||||
|
|
||||||
enable_pkg_thres_interrupt();
|
|
||||||
rdmsrl(MSR_IA32_PACKAGE_THERM_STATUS, msr_val);
|
rdmsrl(MSR_IA32_PACKAGE_THERM_STATUS, msr_val);
|
||||||
if (msr_val & THERM_LOG_THRESHOLD0) {
|
if (msr_val & THERM_LOG_THRESHOLD0) {
|
||||||
wrmsrl(MSR_IA32_PACKAGE_THERM_STATUS,
|
wrmsrl(MSR_IA32_PACKAGE_THERM_STATUS,
|
||||||
|
@ -346,6 +345,9 @@ static void pkg_temp_thermal_threshold_work_fn(struct work_struct *work)
|
||||||
msr_val & ~THERM_LOG_THRESHOLD1);
|
msr_val & ~THERM_LOG_THRESHOLD1);
|
||||||
notify = true;
|
notify = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enable_pkg_thres_interrupt();
|
||||||
|
|
||||||
if (notify) {
|
if (notify) {
|
||||||
pr_debug("thermal_zone_device_update\n");
|
pr_debug("thermal_zone_device_update\n");
|
||||||
thermal_zone_device_update(phdev->tzone,
|
thermal_zone_device_update(phdev->tzone,
|
||||||
|
@ -505,6 +507,13 @@ static int pkg_temp_thermal_device_remove(unsigned int cpu)
|
||||||
list_for_each_entry_safe(phdev, n, &phy_dev_list, list) {
|
list_for_each_entry_safe(phdev, n, &phy_dev_list, list) {
|
||||||
if (phdev->phys_proc_id == phys_proc_id) {
|
if (phdev->phys_proc_id == phys_proc_id) {
|
||||||
thermal_zone_device_unregister(phdev->tzone);
|
thermal_zone_device_unregister(phdev->tzone);
|
||||||
|
/*
|
||||||
|
* Restore original MSR value for package
|
||||||
|
* thermal interrupt.
|
||||||
|
*/
|
||||||
|
wrmsr_on_cpu(cpu, MSR_IA32_PACKAGE_THERM_INTERRUPT,
|
||||||
|
phdev->start_pkg_therm_low,
|
||||||
|
phdev->start_pkg_therm_high);
|
||||||
list_del(&phdev->list);
|
list_del(&phdev->list);
|
||||||
kfree(phdev);
|
kfree(phdev);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue