Commit f3ed0a17 authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Zhang Rui

Thermal: x86 package temp thermal crash

On systems with no package MSR support this caused crash as there
is a bug in the logic to check presence of DTHERM and PTS feature
together. Added a change so that when there is no PTS support, module
doesn't get loaded. Even if some CPU comes online with the PTS
feature disabled, and other CPUs has this support, this patch
will still prevent such MSR accesses.
Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reported-by: default avatarDaniel Walker <dwalker@fifo99.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 47188d39
...@@ -511,7 +511,7 @@ static int get_core_online(unsigned int cpu) ...@@ -511,7 +511,7 @@ static int get_core_online(unsigned int cpu)
/* Check if there is already an instance for this package */ /* Check if there is already an instance for this package */
if (!phdev) { if (!phdev) {
if (!cpu_has(c, X86_FEATURE_DTHERM) && if (!cpu_has(c, X86_FEATURE_DTHERM) ||
!cpu_has(c, X86_FEATURE_PTS)) !cpu_has(c, X86_FEATURE_PTS))
return -ENODEV; return -ENODEV;
if (pkg_temp_thermal_device_add(cpu)) if (pkg_temp_thermal_device_add(cpu))
...@@ -562,7 +562,7 @@ static struct notifier_block pkg_temp_thermal_notifier __refdata = { ...@@ -562,7 +562,7 @@ static struct notifier_block pkg_temp_thermal_notifier __refdata = {
}; };
static const struct x86_cpu_id __initconst pkg_temp_thermal_ids[] = { static const struct x86_cpu_id __initconst pkg_temp_thermal_ids[] = {
{ X86_VENDOR_INTEL, X86_FAMILY_ANY, X86_MODEL_ANY, X86_FEATURE_DTHERM }, { X86_VENDOR_INTEL, X86_FAMILY_ANY, X86_MODEL_ANY, X86_FEATURE_PTS },
{} {}
}; };
MODULE_DEVICE_TABLE(x86cpu, pkg_temp_thermal_ids); MODULE_DEVICE_TABLE(x86cpu, pkg_temp_thermal_ids);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment