diff --git a/cpuplugd/config.c b/cpuplugd/config.c index a3c8c6b7..c5eb13b4 100644 --- a/cpuplugd/config.c +++ b/cpuplugd/config.c @@ -314,8 +314,7 @@ void check_config() cpuplugd_debug("Daemon started with vertical polarization.\n"); cpuplugd_debug("Cpu adjustments won't be made until system "); cpuplugd_debug("is in horizontal polarization\n"); - } else if (saved_polarization == PLR_HORIZONTAL && - cpu == 1) { + } else if (cpu == 1) { apply_cpu_config(); } if (memory == 1) { diff --git a/cpuplugd/cpu.c b/cpuplugd/cpu.c index 97092c16..68fa5340 100644 --- a/cpuplugd/cpu.c +++ b/cpuplugd/cpu.c @@ -87,6 +87,8 @@ int get_polarization(void) char *path; path = util_path_sysfs("devices/system/cpu/dispatching"); + if (!util_path_exists(path)) + return PLR_NONE; if (util_file_read_i(&polarization, NUM_BASE, path) < 0) { polarization = -1; cpuplugd_debug("failed to read system polarization\n"); diff --git a/cpuplugd/cpuplugd.h b/cpuplugd/cpuplugd.h index dff3fc34..fb8cfcf4 100644 --- a/cpuplugd/cpuplugd.h +++ b/cpuplugd/cpuplugd.h @@ -40,6 +40,7 @@ #define CPUSTATS 10 #define PLR_HORIZONTAL 0 #define PLR_VERTICAL 1 +#define PLR_NONE 2 /* * Precedence of C operators