Saturday, January 5, 2013

Fixing Low CPU Frequency

My Laptop (Dell Latitude E6520) sometimes gets stuck on the lowest CPU frequency setting. This happens when it is connected to power, suspended, disconnected from power, and resumes. This can be fixed by setting the governor to performance and then back to ondemand.
 
sudo bash -c '
for gov in $(ls /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor); do
  echo performance > $gov;
done'

sudo bash -c '
for gov in $(ls /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor); do
  echo ondemand > $gov;
done'
 
For some reason this does not work any more. When switching back to ondemand the frequency gets stuck again. As a workaround one can switch to conservative and leave it there.

sudo bash -c '
for gov in $(ls /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor); do
  echo conservative > $gov;
done'