aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPA4WDH2024-10-09 12:09:06 +0200
committerPA4WDH2024-10-09 12:09:06 +0200
commite1392631022c1703d9c90768aff38d120d53ed5b (patch)
treeb789fcd8dc035244fd47596054f81cec09bdb4d4
parentSmall fixes in shell scripts (diff)
downloadcputemp2maxfreq-e1392631022c1703d9c90768aff38d120d53ed5b.tar.gz
cputemp2maxfreq-e1392631022c1703d9c90768aff38d120d53ed5b.tar.bz2
cputemp2maxfreq-e1392631022c1703d9c90768aff38d120d53ed5b.zip
Read scaling_max_freq every poll interval
-rw-r--r--cputemp2maxfreq.c19
1 files changed, 7 insertions, 12 deletions
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_max<VALID_FREQ_MIN) || (cpudata.scale_max>VALID_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_max<VALID_FREQ_MIN) || (cpudata.scale_max>VALID_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_max<VALID_FREQ_MIN) || (cpudata.scale_max>VALID_FREQ_MAX))
- {
- config.logger("Invalid scale_max_freq reported, exiting");
- failsafe(1);
- }
}
sleep(config.interval);