Discussion:
[PM-QA PATCH 1/2] functions: fix loop increment in save_frequencies()
Thierry Escande
2018-05-16 13:28:37 UTC
Permalink
The 'index' variable was not incremented ending with only the last cpu
frequency saved in $frequencies_backup0.

Signed-off-by: Thierry Escande <***@linaro.org>
---
include/functions.sh | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/functions.sh b/include/functions.sh
index 0105776..e9f66d1 100644
--- a/include/functions.sh
+++ b/include/functions.sh
@@ -403,6 +403,7 @@ save_frequencies() {
freq_value=$(cat $CPU_PATH/$cpu/cpufreq/scaling_cur_freq)
eval $freq_array$index=$freq_value
eval export $freq_array$index
+ index=$((index + 1))
done
}
--
2.14.1
Thierry Escande
2018-05-16 13:28:38 UTC
Permalink
The governor needs to be set to 'userspace' before setting the original
frequency back.

This fixes cpufreq_06.sh that otherwise logs 'sh: echo: I/O error'
messages in its log file.

Signed-off-by: Thierry Escande <***@linaro.org>
---
include/functions.sh | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/functions.sh b/include/functions.sh
index e9f66d1..77a8a27 100644
--- a/include/functions.sh
+++ b/include/functions.sh
@@ -412,6 +412,7 @@ restore_frequencies() {
index=0

for cpu in $cpus; do
+ set_governor $cpu userspace
oldfreq=$(eval echo \$$freq_array$index)
echo $oldfreq > $CPU_PATH/$cpu/cpufreq/scaling_setspeed
index=$((index + 1))
--
2.14.1
Lisa Nguyen
2018-05-17 18:26:56 UTC
Permalink
On Wed, May 16, 2018 at 11:41 PM, Thierry Escande
Hi Lisa,
Hi Thierry,
On Wed, May 16, 2018 at 6:28 AM, Thierry Escande
Post by Thierry Escande
The governor needs to be set to 'userspace' before setting the original
frequency back.
This fixes cpufreq_06.sh that otherwise logs 'sh: echo: I/O error'
messages in its log file.
---
include/functions.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/functions.sh b/include/functions.sh
index e9f66d1..77a8a27 100644
--- a/include/functions.sh
+++ b/include/functions.sh
@@ -412,6 +412,7 @@ restore_frequencies() {
index=0
for cpu in $cpus; do
+ set_governor $cpu userspace
oldfreq=$(eval echo \$$freq_array$index)
echo $oldfreq > $CPU_PATH/$cpu/cpufreq/scaling_setspeed
index=$((index + 1))
I had trouble applying this patch because the lines weren't matching
up. This is what I see in the master and android-arm64 branches; there
https://git.linaro.org/power/pm-qa.git/tree/include/functions.sh#n409
Since it's a one line change, I can manually fix this, but did you
have a patch that removed whitespace prior to this one, possibly?
Nope. I have this blank line locally too. It doesn't show up in the patch
because it's out of context.
That's weird. They both apply cleanly on a freshly cloned repo in master and
android-arm64 branches...
Both patches applied. Please check to be sure.

Cheers,
Lisa

Loading...