Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.kernel > #59316
| From | Leon Meier <Leon.Meier@yandex.ru> |
|---|---|
| Newsgroups | linux.debian.bugs.dist, linux.debian.kernel |
| Subject | Bug#880203: After suspend&resume, cpufreq/scaling_max_freq is ignored - alternative shell script |
| Date | 2017-11-01 14:40 +0100 |
| Message-ID | <uH1pn-XL-5@gated-at.bofh.it> (permalink) |
| References | <uH1pn-XL-7@gated-at.bofh.it> <uH1pn-XL-9@gated-at.bofh.it> <uGjHJ-6Nr-33@gated-at.bofh.it> <uH1pn-XL-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Cross-posted to 2 groups.
One can also sidestep writing to /tmp in the script in
/lib/systemd/system-sleep/:
#!/bin/bash
### Ensure that the frequency is restored upon resuming from suspend
# The array to store frequencies:
declare -a frequencies
# Number of processors minus 1:
N=$((`nproc --all`-1))
case "${1}" in
post)
# Read the old values:
for i in `seq 0 $N`; do frequencies[$i]=`cat
/sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq`; done
# Write a junk value first:
for i in `seq 0 $N`; do echo 1${frequencies[$i]} >
/sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq; done
# Let the file kernel digest the previous requests a bit:
sleep 1
# Write the old values:
for i in `seq 0 $N`; do echo ${frequencies[$i]} >
/sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq; done
;;
esac
Though this script now avoids writing into /tmp, it's a terribly wild
hack again invoking bash and other utilities. I'm feeling that it is too
much an overkill as opposed to doing the right thing in the kernel.
Back to linux.debian.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Bug#880203: After suspend&resume, cpufreq/scaling_max_freq is ignored Leon Meier <Leon.Meier@yandex.ru> - 2017-10-30 16:00 +0100
Processed: Re: Bug#880203: After suspend&resume, cpufreq/scaling_max_freq is ignored owner@bugs.debian.org (Debian Bug Tracking System) - 2017-10-31 01:30 +0100
Bug#880203: After suspend&resume, cpufreq/scaling_max_freq is ignored Ben Hutchings <ben@decadent.org.uk> - 2017-10-31 01:30 +0100
Bug#880203: After suspend&resume, cpufreq/scaling_max_freq is ignored Leon Meier <Leon.Meier@yandex.ru> - 2017-10-31 11:20 +0100
Bug#880203: marked as done (After suspend&resume, cpufreq/scaling_max_freq is ignored) owner@bugs.debian.org (Debian Bug Tracking System) - 2017-10-31 11:40 +0100
Bug#880203: closed by Ben Hutchings <ben@decadent.org.uk> (Re: Fwd: Re: Bug#880203: After suspend&resume, cpufreq/scaling_max_freq is ignored) Leon Meier <Leon.Meier@yandex.ru> - 2017-10-31 13:40 +0100
Bug#880203: After suspend&resume, cpufreq/scaling_max_freq is ignored - (wild hack) shell script Leon Meier <Leon.Meier@yandex.ru> - 2017-11-01 13:20 +0100
Bug#880203: After suspend&resume, cpufreq/scaling_max_freq is ignored - (wild hack) shell script Ben Hutchings <ben@decadent.org.uk> - 2017-11-01 13:50 +0100
Bug#880203: closed by Ben Hutchings <ben@decadent.org.uk> (Re: Fwd: Re: Bug#880203: After suspend&resume, cpufreq/scaling_max_freq is ignored) Ben Hutchings <ben@decadent.org.uk> - 2017-11-01 13:50 +0100
Bug#880203: closed by Ben Hutchings <ben@decadent.org.uk> (Re: Fwd: Re: Bug#880203: After suspend&resume, cpufreq/scaling_max_freq is ignored) Leon Meier <Leon.Meier@yandex.ru> - 2017-11-01 14:00 +0100
Bug#880203: After suspend&resume, cpufreq/scaling_max_freq is ignored - alternative shell script Leon Meier <Leon.Meier@yandex.ru> - 2017-11-01 14:40 +0100
csiph-web