Re: [PATCH] cpufrequency change on AC-Adapter Event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On Tue, Feb 21, 2006 at 10:37:42PM +0100, Thomas Ogrisegg wrote:
> Problem Description:
> Whenever the status of the AC-Adapter on my laptop changes, the CPU
> frequency automatically changes as well. For example, if the AC adapter
> is online my CPU has the highest frequency (3,06 GHz). When the adapter
> is unplugged, the frequency automatically decreases to 1,6 GHz. However,
> currently the Kernel simply doesn't notice. It looks like the system is
> still running at 3,06 GHz (/proc/cpuinfo and
> /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq both show that),
> but it doesn't like a simple test program showed.
> My patch solves this problem: Whenever the status of the AC Adapter
> changes, it calls 'cpufreq_reinit' which in turn reinits the CPUfreq
> driver.
> This, of course, only works if the ACPI AC driver is compiled in.

Uh, no, this just wraps band-aid around the problem. First of all, not all
cpufreq drivers like to be left and re-initialized. Secondly, the timing
code might still not adapt to the new CPU frequency. And thirdly, we can
solve these issues if we call

> Signed-off-by: Thomas Ogrisegg <[email protected]>

> diff -uNr -X linux-2.6.15/Documentation/dontdiff linux-2.6.15/drivers/acpi/ac.c linux-
> --- linux-2.6.15/drivers/acpi/ac.c	2006-01-03 04:21:10.000000000 +0100
> +++ linux-	2006-02-19 17:50:20.000000000 +0100
> @@ -29,6 +29,7 @@
>  #include <linux/types.h>
>  #include <linux/proc_fs.h>
>  #include <linux/seq_file.h>
> +#include <linux/cpufreq.h>
>  #include <acpi/acpi_bus.h>
>  #include <acpi/acpi_drivers.h>
> @@ -213,6 +214,8 @@
>  		break;
>  	}
> +	cpufreq_reinit();


here instead. (untested, but should work)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at
Please read the FAQ at

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux