aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2021-03-28 03:29:59 +0200
committerBaptiste Jonglez <git@bitsofnetworks.org>2021-05-26 23:36:40 +0200
commit0b0bec56ea1ac97098a7a546df2ebd62f7011129 (patch)
tree5c594c44324e92bc75bd46646930b711be18820e
parentc4926a425520748212298be8535c1a3852cc4bc2 (diff)
downloadupstream-0b0bec56ea1ac97098a7a546df2ebd62f7011129.tar.gz
upstream-0b0bec56ea1ac97098a7a546df2ebd62f7011129.tar.bz2
upstream-0b0bec56ea1ac97098a7a546df2ebd62f7011129.zip
ipq806x: improve system latency
Various report and data show that the freq 384000 is too low and cause some extra latency to the entire system. OEM qsdk code also set the min frequency for this target to 800 mhz. Also some user notice some instability with this idle frequency, solved by setting the min frequency to 600mhz. Fix all these kind of problem by introducing a boot init.d script that set the min frequency to 600mhz and set the ondemand governor to be more aggressive. The script set these value only if the ondemand governor is detected. 384 mhz freq is still available and user can decide to restore the old behavior by disabling this script. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> (cherry picked from commit 861b82d36ae43efec8d16e61b82482e38996af92)
-rwxr-xr-xtarget/linux/ipq806x/base-files/etc/init.d/cpufreq17
1 files changed, 17 insertions, 0 deletions
diff --git a/target/linux/ipq806x/base-files/etc/init.d/cpufreq b/target/linux/ipq806x/base-files/etc/init.d/cpufreq
new file mode 100755
index 0000000000..19278902ed
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/init.d/cpufreq
@@ -0,0 +1,17 @@
+#!/bin/sh /etc/rc.common
+
+START=15
+
+boot() {
+ local governor
+
+ governor=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor)
+
+ if [ "$governor" = "ondemand" ]; then
+ # Effective only with ondemand
+ echo 600000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
+ echo 600000 > /sys/devices/system/cpu/cpufreq/policy1/scaling_min_freq
+ echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
+ echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
+ fi
+}