diff options
author | njl <njl@FreeBSD.org> | 2005-09-02 16:32:43 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2005-09-02 16:32:43 +0000 |
commit | b0c4bd3081aff87eafdfc9348387938b1f9acc1b (patch) | |
tree | 0d1bdee8172f13de61b0392ffa8beb4a76bc4a1b /sys/kern | |
parent | 6dfa271942b9c3d88bd20f34c0a4313e4dd59ac6 (diff) | |
download | FreeBSD-src-b0c4bd3081aff87eafdfc9348387938b1f9acc1b.zip FreeBSD-src-b0c4bd3081aff87eafdfc9348387938b1f9acc1b.tar.gz |
Break out the checks for duplicates and absolute settings being too high
instead of trying to do them all at once. This should fix the level sorting
problems from the previous revision.
Testing help: ume
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_cpu.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/sys/kern/kern_cpu.c b/sys/kern/kern_cpu.c index f69a943..450af2c 100644 --- a/sys/kern/kern_cpu.c +++ b/sys/kern/kern_cpu.c @@ -760,14 +760,23 @@ cpufreq_dup_set(struct cpufreq_softc *sc, struct cf_level *dup, KASSERT(!TAILQ_EMPTY(list), ("all levels list empty in dup set")); TAILQ_FOREACH_REVERSE(itr, list, cf_level_lst, link) { itr_set = &itr->total_set; - if (fill_set->freq < itr_set->freq && - !CPUFREQ_CMP(fill_set->freq, itr_set->freq) && - fill->abs_set.freq <= itr->abs_set.freq) { - CF_DEBUG( - "dup done, inserting new level %d after %d\n", - fill_set->freq, itr_set->freq); - TAILQ_INSERT_AFTER(list, itr, fill, link); - sc->all_count++; + if (CPUFREQ_CMP(fill_set->freq, itr_set->freq)) { + CF_DEBUG("dup set rejecting %d (dupe)\n", + fill_set->freq); + itr = NULL; + break; + } else if (fill_set->freq < itr_set->freq) { + if (fill->abs_set.freq <= itr->abs_set.freq) { + CF_DEBUG( + "dup done, inserting new level %d after %d\n", + fill_set->freq, itr_set->freq); + TAILQ_INSERT_AFTER(list, itr, fill, link); + sc->all_count++; + } else { + CF_DEBUG("dup set rejecting %d (abs too big)\n", + fill_set->freq); + itr = NULL; + } break; } } |