summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2008-05-30 22:01:09 +0000
committerjhb <jhb@FreeBSD.org>2008-05-30 22:01:09 +0000
commit9d81809b1f112c451cf4aa9cfc1a9e264cb19889 (patch)
tree88fb68d52e955fe02443d59eddd8c46e00f83a1d /sys/i386
parentca1405c1e3ae2111d10a8a171093a0b8b5a1a777 (diff)
downloadFreeBSD-src-9d81809b1f112c451cf4aa9cfc1a9e264cb19889.zip
FreeBSD-src-9d81809b1f112c451cf4aa9cfc1a9e264cb19889.tar.gz
After probing the available frequency settings, restore the CPU to run at
whatever frequency it started at instead of always picking the highest frequency. The first version of this driver attempted to do this, but it set the speed to the first frequency in the list rather than the value it had saved. MFC after: 1 week Discussed with: rpaulo, phk
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/cpufreq/est.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/sys/i386/cpufreq/est.c b/sys/i386/cpufreq/est.c
index bfc8178..ac99e04 100644
--- a/sys/i386/cpufreq/est.c
+++ b/sys/i386/cpufreq/est.c
@@ -1078,7 +1078,8 @@ 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, maxi, maxfreq;
+ int count, error, i, j;
+ uint16_t saved_id16;
perf_dev = device_find_child(device_get_parent(dev), "acpi_perf", -1);
if (perf_dev == NULL || !device_is_attached(perf_dev))
@@ -1101,7 +1102,7 @@ est_acpi_info(device_t dev, freq_info **freqs)
error = ENOMEM;
goto out;
}
- maxi = maxfreq = 0;
+ est_get_id16(&saved_id16);
for (i = 0, j = 0; i < count; i++) {
/*
* Confirm id16 value is correct.
@@ -1118,24 +1119,11 @@ 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);
- }
+ /* restore saved setting */
+ est_set_id16(dev, saved_id16, 0);
/* Mark end of table with a terminator. */
bzero(&table[j], sizeof(freq_info));
OpenPOWER on IntegriCloud