Commit 354aeeb1 authored by Jesse Barnes's avatar Jesse Barnes Committed by Matthew Garrett

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=18742Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent a7abda8d
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
* TODO: * TODO:
* - handle CPU hotplug * - handle CPU hotplug
* - provide turbo enable/disable api * - provide turbo enable/disable api
* - make sure we can write turbo enable/disable reg based on MISC_EN
* *
* Related documents: * Related documents:
* - CDI 403777, 403778 - Auburndale EDS vol 1 & 2 * - CDI 403777, 403778 - Auburndale EDS vol 1 & 2
...@@ -325,6 +324,7 @@ struct ips_driver { ...@@ -325,6 +324,7 @@ struct ips_driver {
bool gpu_preferred; bool gpu_preferred;
bool poll_turbo_status; bool poll_turbo_status;
bool second_cpu; bool second_cpu;
bool turbo_toggle_allowed;
struct ips_mcp_limits *limits; struct ips_mcp_limits *limits;
/* Optional MCH interfaces for if i915 is in use */ /* Optional MCH interfaces for if i915 is in use */
...@@ -461,6 +461,7 @@ static void ips_enable_cpu_turbo(struct ips_driver *ips) ...@@ -461,6 +461,7 @@ static void ips_enable_cpu_turbo(struct ips_driver *ips)
if (ips->__cpu_turbo_on) if (ips->__cpu_turbo_on)
return; return;
if (ips->turbo_toggle_allowed)
on_each_cpu(do_enable_cpu_turbo, ips, 1); on_each_cpu(do_enable_cpu_turbo, ips, 1);
ips->__cpu_turbo_on = true; ips->__cpu_turbo_on = true;
...@@ -498,6 +499,7 @@ static void ips_disable_cpu_turbo(struct ips_driver *ips) ...@@ -498,6 +499,7 @@ static void ips_disable_cpu_turbo(struct ips_driver *ips)
if (!ips->__cpu_turbo_on) if (!ips->__cpu_turbo_on)
return; return;
if (ips->turbo_toggle_allowed)
on_each_cpu(do_disable_cpu_turbo, ips, 1); on_each_cpu(do_disable_cpu_turbo, ips, 1);
ips->__cpu_turbo_on = false; ips->__cpu_turbo_on = false;
...@@ -1332,8 +1334,10 @@ static struct ips_mcp_limits *ips_detect_cpu(struct ips_driver *ips) ...@@ -1332,8 +1334,10 @@ static struct ips_mcp_limits *ips_detect_cpu(struct ips_driver *ips)
* turbo manually or we'll get an illegal MSR access, even though * turbo manually or we'll get an illegal MSR access, even though
* turbo will still be available. * turbo will still be available.
*/ */
if (!(misc_en & IA32_MISC_TURBO_EN)) if (misc_en & IA32_MISC_TURBO_EN)
; /* add turbo MSR write allowed flag if necessary */ ips->turbo_toggle_allowed = true;
else
ips->turbo_toggle_allowed = false;
if (strstr(boot_cpu_data.x86_model_id, "CPU M")) if (strstr(boot_cpu_data.x86_model_id, "CPU M"))
limits = &ips_sv_limits; limits = &ips_sv_limits;
......
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