diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-10-05 14:50:59 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2010-10-05 14:59:28 -0400 |
commit | 96f3823f537088c13735cfdfbf284436c802352a (patch) | |
tree | c9e205e864bc717676a5aa424f2cdb2a2e6f9c86 /drivers/platform/x86 | |
parent | 4fd07ac00d87b942cc8d8f30a27192fea2fc4ab2 (diff) |
[PATCH 2/2] IPS driver: disable CPU turbo
The undocumented interface we're using for reading CPU power seems to be
overreporting power. Until we figure out how to correct it, disable CPU
turbo and power reporting to be safe. This will keep the CPU within default
limits and still allow us to increase GPU frequency as needed.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r-- | drivers/platform/x86/intel_ips.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c index 50ab1c93e369..4b3ecdefd6e9 100644 --- a/drivers/platform/x86/intel_ips.c +++ b/drivers/platform/x86/intel_ips.c | |||
@@ -715,8 +715,15 @@ static void update_turbo_limits(struct ips_driver *ips) | |||
715 | u32 hts = thm_readl(THM_HTS); | 715 | u32 hts = thm_readl(THM_HTS); |
716 | 716 | ||
717 | ips->cpu_turbo_enabled = !(hts & HTS_PCTD_DIS); | 717 | ips->cpu_turbo_enabled = !(hts & HTS_PCTD_DIS); |
718 | /* | ||
719 | * Disable turbo for now, until we can figure out why the power figures | ||
720 | * are wrong | ||
721 | */ | ||
722 | ips->cpu_turbo_enabled = false; | ||
723 | |||
718 | if (ips->gpu_busy) | 724 | if (ips->gpu_busy) |
719 | ips->gpu_turbo_enabled = !(hts & HTS_GTD_DIS); | 725 | ips->gpu_turbo_enabled = !(hts & HTS_GTD_DIS); |
726 | |||
720 | ips->core_power_limit = thm_readw(THM_MPCPC); | 727 | ips->core_power_limit = thm_readw(THM_MPCPC); |
721 | ips->mch_power_limit = thm_readw(THM_MMGPC); | 728 | ips->mch_power_limit = thm_readw(THM_MMGPC); |
722 | ips->mcp_temp_limit = thm_readw(THM_PTL); | 729 | ips->mcp_temp_limit = thm_readw(THM_PTL); |
@@ -895,7 +902,7 @@ static u32 get_cpu_power(struct ips_driver *ips, u32 *last, int period) | |||
895 | ret = (ret * 1000) / 65535; | 902 | ret = (ret * 1000) / 65535; |
896 | *last = val; | 903 | *last = val; |
897 | 904 | ||
898 | return ret; | 905 | return 0; |
899 | } | 906 | } |
900 | 907 | ||
901 | static const u16 temp_decay_factor = 2; | 908 | static const u16 temp_decay_factor = 2; |
@@ -1186,6 +1193,11 @@ static irqreturn_t ips_irq_handler(int irq, void *arg) | |||
1186 | STS_GPL_SHIFT; | 1193 | STS_GPL_SHIFT; |
1187 | /* ignore EC CPU vs GPU pref */ | 1194 | /* ignore EC CPU vs GPU pref */ |
1188 | ips->cpu_turbo_enabled = !(sts & STS_PCTD_DIS); | 1195 | ips->cpu_turbo_enabled = !(sts & STS_PCTD_DIS); |
1196 | /* | ||
1197 | * Disable turbo for now, until we can figure | ||
1198 | * out why the power figures are wrong | ||
1199 | */ | ||
1200 | ips->cpu_turbo_enabled = false; | ||
1189 | if (ips->gpu_busy) | 1201 | if (ips->gpu_busy) |
1190 | ips->gpu_turbo_enabled = !(sts & STS_GTD_DIS); | 1202 | ips->gpu_turbo_enabled = !(sts & STS_GTD_DIS); |
1191 | ips->mcp_temp_limit = (sts & STS_PTL_MASK) >> | 1203 | ips->mcp_temp_limit = (sts & STS_PTL_MASK) >> |
@@ -1573,8 +1585,8 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
1573 | /* Save turbo limits & ratios */ | 1585 | /* Save turbo limits & ratios */ |
1574 | rdmsrl(TURBO_POWER_CURRENT_LIMIT, ips->orig_turbo_limit); | 1586 | rdmsrl(TURBO_POWER_CURRENT_LIMIT, ips->orig_turbo_limit); |
1575 | 1587 | ||
1576 | ips_enable_cpu_turbo(ips); | 1588 | ips_disable_cpu_turbo(ips); |
1577 | ips->cpu_turbo_enabled = true; | 1589 | ips->cpu_turbo_enabled = false; |
1578 | 1590 | ||
1579 | /* Create thermal adjust thread */ | 1591 | /* Create thermal adjust thread */ |
1580 | ips->adjust = kthread_create(ips_adjust, ips, "ips-adjust"); | 1592 | ips->adjust = kthread_create(ips_adjust, ips, "ips-adjust"); |