Skip to content

Commit 371d5a2

Browse files
authored
Fixes konkor#179
Fixes invalid min and max freqs. passed to `cpufreqctl` resulting in max freq. set to minimum scaling freq. when `scaling_available_frequencies` is not present and `scaling_driver` is not `intel_pstate`.
1 parent 9d183ac commit 371d5a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

common/HelperCPUFreq.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ function load_stage (prf) {
325325
if (pstate_present) {
326326
GLib.spawn_command_line_sync (pkexec_path + " " + cpufreqctl_path + " --min-perf --set=0");
327327
GLib.spawn_command_line_sync (pkexec_path + " " + cpufreqctl_path + " --max-perf --set=100");
328-
} else {
328+
} else if (frequencies.length > 0) {
329329
GLib.spawn_command_line_sync (pkexec_path + " " + cpufreqctl_path + " --frequency-min --set=" + get_freq (0));
330330
GLib.spawn_command_line_sync (pkexec_path + " " + cpufreqctl_path + " --frequency-max --set=" + get_freq (100));
331331
}
@@ -339,7 +339,7 @@ function load_stage (prf) {
339339
} else if (stage == 4) {
340340
if (pstate_present) {
341341
GLib.spawn_command_line_sync (pkexec_path + " " + cpufreqctl_path + " --min-perf --set=" + prf.minf);
342-
} else {
342+
} else if (frequencies.length > 0) {
343343
for (let key = 0; key < cpucount; key++) {
344344
if (prf.core[key]) {
345345
set_coremin (key, prf.core[key].a);
@@ -349,7 +349,7 @@ function load_stage (prf) {
349349
} else if (stage == 5) {
350350
if (pstate_present) {
351351
GLib.spawn_command_line_sync (pkexec_path + " " + cpufreqctl_path + " --max-perf --set=" + prf.maxf);
352-
} else {
352+
} else if (frequencies.length > 0) {
353353
for (let key = 0; key < cpucount; key++) {
354354
if (prf.core[key]) {
355355
set_coremax (key, prf.core[key].b);

0 commit comments

Comments
 (0)