aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/x86_pkg_temp_thermal.c
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2013-07-11 12:50:30 -0400
committerZhang Rui <rui.zhang@intel.com>2013-07-15 04:20:58 -0400
commitf3ed0a17f0292300b3caca32d823ecd32554a667 (patch)
tree21f0f2978f6119311d40e9d576156d25ce3f18d4 /drivers/thermal/x86_pkg_temp_thermal.c
parent47188d39b5deeebf41f87a02af1b3935866364cf (diff)
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: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reported-by: Daniel Walker <dwalker@fifo99.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/x86_pkg_temp_thermal.c')
-rw-r--r--drivers/thermal/x86_pkg_temp_thermal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c
index 5de56f671a9d..034604c021d6 100644
--- a/drivers/thermal/x86_pkg_temp_thermal.c
+++ b/drivers/thermal/x86_pkg_temp_thermal.c
@@ -511,7 +511,7 @@ static int get_core_online(unsigned int cpu)
511 511
512 /* Check if there is already an instance for this package */ 512 /* Check if there is already an instance for this package */
513 if (!phdev) { 513 if (!phdev) {
514 if (!cpu_has(c, X86_FEATURE_DTHERM) && 514 if (!cpu_has(c, X86_FEATURE_DTHERM) ||
515 !cpu_has(c, X86_FEATURE_PTS)) 515 !cpu_has(c, X86_FEATURE_PTS))
516 return -ENODEV; 516 return -ENODEV;
517 if (pkg_temp_thermal_device_add(cpu)) 517 if (pkg_temp_thermal_device_add(cpu))
@@ -562,7 +562,7 @@ static struct notifier_block pkg_temp_thermal_notifier __refdata = {
562}; 562};
563 563
564static const struct x86_cpu_id __initconst pkg_temp_thermal_ids[] = { 564static const struct x86_cpu_id __initconst pkg_temp_thermal_ids[] = {
565 { X86_VENDOR_INTEL, X86_FAMILY_ANY, X86_MODEL_ANY, X86_FEATURE_DTHERM }, 565 { X86_VENDOR_INTEL, X86_FAMILY_ANY, X86_MODEL_ANY, X86_FEATURE_PTS },
566 {} 566 {}
567}; 567};
568MODULE_DEVICE_TABLE(x86cpu, pkg_temp_thermal_ids); 568MODULE_DEVICE_TABLE(x86cpu, pkg_temp_thermal_ids);