aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/intel_ips.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2010-09-23 17:49:28 -0400
committerMatthew Garrett <mjg@redhat.com>2010-10-05 14:59:09 -0400
commit354aeeb1ca8f82ea133ede21987034addc75057a (patch)
treedd398a9bc263ecd2cfe10dfecaa18aec87abab4c /drivers/platform/x86/intel_ips.c
parenta7abda8d721359363d679c5f2de964f29419568c (diff)
IPS driver: don't toggle CPU turbo on unsupported CPUs
If the CPU doesn't support turbo, don't try to enable/disable it. http://bugzilla.kernel.org/show_bug.cgi?id=18742 Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform/x86/intel_ips.c')
-rw-r--r--drivers/platform/x86/intel_ips.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
index bfa9c726054a..71d04ef47b8c 100644
--- a/drivers/platform/x86/intel_ips.c
+++ b/drivers/platform/x86/intel_ips.c
@@ -51,7 +51,6 @@
51 * TODO: 51 * TODO:
52 * - handle CPU hotplug 52 * - handle CPU hotplug
53 * - provide turbo enable/disable api 53 * - provide turbo enable/disable api
54 * - make sure we can write turbo enable/disable reg based on MISC_EN
55 * 54 *
56 * Related documents: 55 * Related documents:
57 * - CDI 403777, 403778 - Auburndale EDS vol 1 & 2 56 * - CDI 403777, 403778 - Auburndale EDS vol 1 & 2
@@ -325,6 +324,7 @@ struct ips_driver {
325 bool gpu_preferred; 324 bool gpu_preferred;
326 bool poll_turbo_status; 325 bool poll_turbo_status;
327 bool second_cpu; 326 bool second_cpu;
327 bool turbo_toggle_allowed;
328 struct ips_mcp_limits *limits; 328 struct ips_mcp_limits *limits;
329 329
330 /* Optional MCH interfaces for if i915 is in use */ 330 /* Optional MCH interfaces for if i915 is in use */
@@ -461,7 +461,8 @@ static void ips_enable_cpu_turbo(struct ips_driver *ips)
461 if (ips->__cpu_turbo_on) 461 if (ips->__cpu_turbo_on)
462 return; 462 return;
463 463
464 on_each_cpu(do_enable_cpu_turbo, ips, 1); 464 if (ips->turbo_toggle_allowed)
465 on_each_cpu(do_enable_cpu_turbo, ips, 1);
465 466
466 ips->__cpu_turbo_on = true; 467 ips->__cpu_turbo_on = true;
467} 468}
@@ -498,7 +499,8 @@ static void ips_disable_cpu_turbo(struct ips_driver *ips)
498 if (!ips->__cpu_turbo_on) 499 if (!ips->__cpu_turbo_on)
499 return; 500 return;
500 501
501 on_each_cpu(do_disable_cpu_turbo, ips, 1); 502 if (ips->turbo_toggle_allowed)
503 on_each_cpu(do_disable_cpu_turbo, ips, 1);
502 504
503 ips->__cpu_turbo_on = false; 505 ips->__cpu_turbo_on = false;
504} 506}
@@ -1332,8 +1334,10 @@ static struct ips_mcp_limits *ips_detect_cpu(struct ips_driver *ips)
1332 * turbo manually or we'll get an illegal MSR access, even though 1334 * turbo manually or we'll get an illegal MSR access, even though
1333 * turbo will still be available. 1335 * turbo will still be available.
1334 */ 1336 */
1335 if (!(misc_en & IA32_MISC_TURBO_EN)) 1337 if (misc_en & IA32_MISC_TURBO_EN)
1336 ; /* add turbo MSR write allowed flag if necessary */ 1338 ips->turbo_toggle_allowed = true;
1339 else
1340 ips->turbo_toggle_allowed = false;
1337 1341
1338 if (strstr(boot_cpu_data.x86_model_id, "CPU M")) 1342 if (strstr(boot_cpu_data.x86_model_id, "CPU M"))
1339 limits = &ips_sv_limits; 1343 limits = &ips_sv_limits;