From e1392631022c1703d9c90768aff38d120d53ed5b Mon Sep 17 00:00:00 2001 From: PA4WDH Date: Wed, 9 Oct 2024 12:09:06 +0200 Subject: Read scaling_max_freq every poll interval --- cputemp2maxfreq.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'cputemp2maxfreq.c') diff --git a/cputemp2maxfreq.c b/cputemp2maxfreq.c index 7098ccc..81fcdef 100644 --- a/cputemp2maxfreq.c +++ b/cputemp2maxfreq.c @@ -290,6 +290,13 @@ int main(int argc,char **argv) failsafe(1); } + cpudata.scale_max=cpufreq_get_long_int("scaling_max_freq"); + if ((cpudata.scale_maxVALID_FREQ_MAX)) + { + config.logger("Invalid scale_max_freq reported, exiting"); + failsafe(1); + } + DEBUG1_MAIN("Data: %ld %ld %ld %ld %ld\n",cpudata.cur_temp,config.max_temp,cpudata.max_freq,cpudata.scale_max,cpudata.cur_freq); if (config.log_data>0) { @@ -313,12 +320,6 @@ int main(int argc,char **argv) config.logger("Failed to set scaling_max_freq, exiting"); failsafe(1); } - cpudata.scale_max=cpufreq_get_long_int("scaling_max_freq"); - if ((cpudata.scale_maxVALID_FREQ_MAX)) - { - config.logger("Invalid scale_max_freq reported, exiting"); - failsafe(1); - } } // Check if we should decrease @@ -335,12 +336,6 @@ int main(int argc,char **argv) config.logger("Failed to set scaling_max_freq, exiting"); failsafe(1); } - cpudata.scale_max=cpufreq_get_long_int("scaling_max_freq"); - if ((cpudata.scale_maxVALID_FREQ_MAX)) - { - config.logger("Invalid scale_max_freq reported, exiting"); - failsafe(1); - } } sleep(config.interval); -- cgit v1.2.3