diff options
author | njl <njl@FreeBSD.org> | 2008-01-16 01:05:21 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2008-01-16 01:05:21 +0000 |
commit | 27739d97dc4eacfb70bddbd4c47d74b187f58d8c (patch) | |
tree | 9037654e738012583483dd8ffe72edd80853a600 /sys | |
parent | c2f095f565461c2ee44073395c0ce9fdeafd7877 (diff) | |
download | FreeBSD-src-27739d97dc4eacfb70bddbd4c47d74b187f58d8c.zip FreeBSD-src-27739d97dc4eacfb70bddbd4c47d74b187f58d8c.tar.gz |
Remove duplicate cpufreq levels, i.e. ones that are within 25 Mhz of each
other. The first one survives, the rest are removed. So far, it appears
only some acpi_perf(4) BIOS tables have these invalid states, but address
this in the core to be sure to handle other potential driver data.
PR: kern/114722
Tested by: stefan.lambrev / moneybookers.com
MFC after: 3 days
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_cpu.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/kern/kern_cpu.c b/sys/kern/kern_cpu.c index 8320ee4..f8f8c36 100644 --- a/sys/kern/kern_cpu.c +++ b/sys/kern/kern_cpu.c @@ -606,6 +606,17 @@ cf_levels_method(device_t dev, struct cf_level *levels, int *count) /* Finally, output the list of levels. */ i = 0; TAILQ_FOREACH(lev, &sc->all_levels, link) { + /* + * Skip levels that are too close in frequency to the + * previous levels. Some systems report bogus duplicate + * settings (i.e., for acpi_perf). + */ + if (i > 0 && CPUFREQ_CMP(lev->total_set.freq, + levels[i - 1].total_set.freq)) { + sc->all_count--; + continue; + } + /* Skip levels that have a frequency that is too low. */ if (lev->total_set.freq < cf_lowest_freq) { sc->all_count--; |