From b509e54a2a58d450012fc3d4838bdec7c7e8fbdb Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sat, 28 Jul 2018 16:09:58 +0200 Subject: [PATCH] CPUFreq shenanigans on Kobo (#4114) * Switch to ondemand CPUFreq governor on Kobo My H2O boots with the userspace (!!) governor... Note that the hardware appears to blissfully ignore any of this, because the stats still show the CPU changing state on its own... --- base | 2 +- platform/kobo/koreader.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/base b/base index 7ab1e3b7c..675ec212d 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 7ab1e3b7c8aa6187432b2b54d738a78b034781b1 +Subproject commit 675ec212d059c19ac5187dbcc59c6ec6cec98a02 diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 7f211a6eb..b0aa6a434 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -7,6 +7,10 @@ KOREADER_DIR="${0%/*}" # we're always starting from our working directory cd "${KOREADER_DIR}" || exit +# Switch to a sensible CPUFreq governor, even if the HW appears not to give an actual fuck about this... +ORIG_CPUFREQ_GOV="$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)" +echo "ondemand" >"/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor" + # update to new version from OTA directory ko_update_check() { NEWUPDATE="${KOREADER_DIR}/ota/koreader.updated.tar" @@ -132,6 +136,9 @@ while [ $RETURN_VALUE -eq 85 ]; do RETURN_VALUE=$? done +# Restore original CPUFreq governor... +echo "${ORIG_CPUFREQ_GOV}" >"/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor" + if [ "${FROM_NICKEL}" = "true" ]; then if [ "${FROM_KFMON}" != "true" ]; then # start kobo software because it was running before koreader