aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2005-02-07 11:35:24 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2005-02-07 11:35:24 +0000
commitaab8b1b55f35c81e3417c8a7d6c53d0fc0bbbbab (patch)
tree7abd32876d1836a76a2a17aaa5f48c180ec8e1a5 /sys
parent46ca4347374ab1d846340cda3f2725c9196366b5 (diff)
downloadsrc-aab8b1b55f35c81e3417c8a7d6c53d0fc0bbbbab.tar.gz
src-aab8b1b55f35c81e3417c8a7d6c53d0fc0bbbbab.zip
Fix the problem with incorrect throttling level reported immediately after
reboot. Safter the reboot the TCC is usually in the Automatic mode, in which reading current performance level is likely to produce bogus results make sure to switch it to the On-Demand mode and set to some known performance level. Unfortunately there is no reliable way to check that TCC is in the Automatic mode. Reading bit 4 of ACPI Thermal Monitor Control Register produces 0 regardless of the current mode. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=141455
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/cpufreq/p4tcc.c11
-rw-r--r--sys/i386/i386/p4tcc.c11
2 files changed, 22 insertions, 0 deletions
diff --git a/sys/i386/cpufreq/p4tcc.c b/sys/i386/cpufreq/p4tcc.c
index f65e5d1eb677..e3e0a030fe88 100644
--- a/sys/i386/cpufreq/p4tcc.c
+++ b/sys/i386/cpufreq/p4tcc.c
@@ -223,6 +223,17 @@ setup_p4tcc(void *dummy __unused)
p4tcc_economy = tcc[TCC_LEVELS - 1].rlevel;
p4tcc_performance = tcc[0].rlevel;
+ /*
+ * Since after the reboot the TCC is usually in the Automatic
+ * mode, in which reading current performance level is likely to
+ * produce bogus results make sure to switch it to the On-Demand
+ * mode and set to some known performance level. Unfortunately
+ * there is no reliable way to check that TCC is in the Automatic
+ * mode, reading bit 4 of ACPI Thermal Monitor Control Register
+ * produces 0 regardless of the current mode.
+ */
+ p4tcc_setperf(p4tcc_performance);
+
p4tcc_percentage = p4tcc_getperf();
printf("Pentium 4 TCC support enabled, %d steps from 100%% to %d%%, "
"current performance %u%%\n", nsteps, p4tcc_economy,
diff --git a/sys/i386/i386/p4tcc.c b/sys/i386/i386/p4tcc.c
index f65e5d1eb677..e3e0a030fe88 100644
--- a/sys/i386/i386/p4tcc.c
+++ b/sys/i386/i386/p4tcc.c
@@ -223,6 +223,17 @@ setup_p4tcc(void *dummy __unused)
p4tcc_economy = tcc[TCC_LEVELS - 1].rlevel;
p4tcc_performance = tcc[0].rlevel;
+ /*
+ * Since after the reboot the TCC is usually in the Automatic
+ * mode, in which reading current performance level is likely to
+ * produce bogus results make sure to switch it to the On-Demand
+ * mode and set to some known performance level. Unfortunately
+ * there is no reliable way to check that TCC is in the Automatic
+ * mode, reading bit 4 of ACPI Thermal Monitor Control Register
+ * produces 0 regardless of the current mode.
+ */
+ p4tcc_setperf(p4tcc_performance);
+
p4tcc_percentage = p4tcc_getperf();
printf("Pentium 4 TCC support enabled, %d steps from 100%% to %d%%, "
"current performance %u%%\n", nsteps, p4tcc_economy,