summaryrefslogtreecommitdiffstats
path: root/sys/i386/cpufreq
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2008-03-17 09:01:43 +0000
committerphk <phk@FreeBSD.org>2008-03-17 09:01:43 +0000
commit234bd357a63b5a0c78acaa2ebc2001db3cd4e71c (patch)
treeae390b68aa6600f7483f1b8a1b4236d7b6f8ea40 /sys/i386/cpufreq
parent7f4e520791d79bb7e3407eb30999612c735de96f (diff)
downloadFreeBSD-src-234bd357a63b5a0c78acaa2ebc2001db3cd4e71c.zip
FreeBSD-src-234bd357a63b5a0c78acaa2ebc2001db3cd4e71c.tar.gz
Increase time we wait for things to settle to 1 millisecond,
10 microseconds is too short. Always set the cpu to the highest frequency so that we get through boot and don't handicap cpus where powerd(8) is not used.
Diffstat (limited to 'sys/i386/cpufreq')
-rw-r--r--sys/i386/cpufreq/est.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/i386/cpufreq/est.c b/sys/i386/cpufreq/est.c
index 44aa57b..78f0641 100644
--- a/sys/i386/cpufreq/est.c
+++ b/sys/i386/cpufreq/est.c
@@ -101,7 +101,7 @@ const char centaur_id[] = "CentaurHauls";
CTASSERT(EST_MAX_SETTINGS <= MAX_SETTINGS);
/* Estimate in microseconds of latency for performing a transition. */
-#define EST_TRANS_LAT 10
+#define EST_TRANS_LAT 1000
/*
* Frequency (MHz) and voltage (mV) settings. Data from the
@@ -1078,7 +1078,7 @@ est_acpi_info(device_t dev, freq_info **freqs)
struct cf_setting *sets;
freq_info *table;
device_t perf_dev;
- int count, error, i, j;
+ int count, error, i, j, maxi, maxfreq;
uint16_t saved_id16;
perf_dev = device_find_child(device_get_parent(dev), "acpi_perf", -1);
@@ -1102,6 +1102,7 @@ est_acpi_info(device_t dev, freq_info **freqs)
error = ENOMEM;
goto out;
}
+ maxi = maxfreq = 0;
for (i = 0, j = 0; i < count; i++) {
/*
* Confirm id16 value is correct.
@@ -1119,11 +1120,24 @@ est_acpi_info(device_t dev, freq_info **freqs)
table[j].id16 = sets[i].spec[0];
table[j].power = sets[i].power;
++j;
+ if (sets[i].freq > maxfreq) {
+ maxi = i;
+ maxfreq = sets[i].freq;
+ }
+
}
/* restore saved setting */
est_set_id16(dev, sets[i].spec[0], 0);
}
}
+ /*
+ * Set the frequency to max, so we get through boot fast, and don't
+ * handicap systems not running powerd.
+ */
+ if (maxfreq != 0) {
+ device_printf(dev, "Setting %d MHz\n", sets[maxi].freq);
+ est_set_id16(dev, sets[maxi].spec[0], 0);
+ }
/* Mark end of table with a terminator. */
bzero(&table[j], sizeof(freq_info));
OpenPOWER on IntegriCloud