|
Lines 131-142
Link Here
|
| 131 |
DRIVER_MODULE(cpufreq, cpu, cpufreq_driver, cpufreq_dc, 0, 0); |
131 |
DRIVER_MODULE(cpufreq, cpu, cpufreq_driver, cpufreq_dc, 0, 0); |
| 132 |
|
132 |
|
| 133 |
static int cf_lowest_freq; |
133 |
static int cf_lowest_freq; |
|
|
134 |
static int cf_highest_freq; |
| 134 |
static int cf_verbose; |
135 |
static int cf_verbose; |
| 135 |
TUNABLE_INT("debug.cpufreq.lowest", &cf_lowest_freq); |
136 |
TUNABLE_INT("debug.cpufreq.lowest", &cf_lowest_freq); |
|
|
137 |
TUNABLE_INT("debug.cpufreq.highest", &cf_highest_freq); |
| 136 |
TUNABLE_INT("debug.cpufreq.verbose", &cf_verbose); |
138 |
TUNABLE_INT("debug.cpufreq.verbose", &cf_verbose); |
| 137 |
SYSCTL_NODE(_debug, OID_AUTO, cpufreq, CTLFLAG_RD, NULL, "cpufreq debugging"); |
139 |
SYSCTL_NODE(_debug, OID_AUTO, cpufreq, CTLFLAG_RD, NULL, "cpufreq debugging"); |
| 138 |
SYSCTL_INT(_debug_cpufreq, OID_AUTO, lowest, CTLFLAG_RW, &cf_lowest_freq, 1, |
140 |
SYSCTL_INT(_debug_cpufreq, OID_AUTO, lowest, CTLFLAG_RW, &cf_lowest_freq, 1, |
| 139 |
"Don't provide levels below this frequency."); |
141 |
"Don't provide levels below this frequency."); |
|
|
142 |
SYSCTL_INT(_debug_cpufreq, OID_AUTO, highest, CTLFLAG_RW, &cf_highest_freq, 1, |
| 143 |
"Don't provide levels above this frequency."); |
| 140 |
SYSCTL_INT(_debug_cpufreq, OID_AUTO, verbose, CTLFLAG_RW, &cf_verbose, 1, |
144 |
SYSCTL_INT(_debug_cpufreq, OID_AUTO, verbose, CTLFLAG_RW, &cf_verbose, 1, |
| 141 |
"Print verbose debugging messages"); |
145 |
"Print verbose debugging messages"); |
| 142 |
|
146 |
|
|
Lines 306-311
Link Here
|
| 306 |
goto out; |
310 |
goto out; |
| 307 |
} |
311 |
} |
| 308 |
|
312 |
|
|
|
313 |
/* Reject levels that are above our specified threshold. */ |
| 314 |
if (cf_highest_freq > 0 && level->total_set.freq > cf_highest_freq) { |
| 315 |
CF_DEBUG("rejecting freq %d, greater than %d limit\n", |
| 316 |
level->total_set.freq, cf_highest_freq); |
| 317 |
error = EINVAL; |
| 318 |
goto out; |
| 319 |
} |
| 320 |
|
| 309 |
/* If already at this level, just return. */ |
321 |
/* If already at this level, just return. */ |
| 310 |
if (CPUFREQ_CMP(sc->curr_level.total_set.freq, level->total_set.freq)) { |
322 |
if (CPUFREQ_CMP(sc->curr_level.total_set.freq, level->total_set.freq)) { |
| 311 |
CF_DEBUG("skipping freq %d, same as current level %d\n", |
323 |
CF_DEBUG("skipping freq %d, same as current level %d\n", |
|
Lines 633-640
Link Here
|
| 633 |
continue; |
645 |
continue; |
| 634 |
} |
646 |
} |
| 635 |
|
647 |
|
| 636 |
/* Skip levels that have a frequency that is too low. */ |
648 |
/* |
| 637 |
if (lev->total_set.freq < cf_lowest_freq) { |
649 |
* Skip levels that have a frequency that is too low or too |
|
|
650 |
* high. |
| 651 |
*/ |
| 652 |
if (lev->total_set.freq < cf_lowest_freq || |
| 653 |
(cf_highest_freq > 0 && |
| 654 |
lev->total_set.freq > cf_highest_freq)) { |
| 638 |
sc->all_count--; |
655 |
sc->all_count--; |
| 639 |
continue; |
656 |
continue; |
| 640 |
} |
657 |
} |