diff options
author | Thomas Renninger <trenn@suse.de> | 2009-11-19 06:31:01 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2009-11-24 13:33:34 -0500 |
commit | e2f74f355e9e2914483db10c05d70e69e0b7ae04 (patch) | |
tree | e17cae217151627c2c95aeeb2a43baf96d49ac91 /include/acpi | |
parent | cf3289d0e701b2f59123bf653c12722a7e32aedb (diff) |
[ACPI/CPUFREQ] Introduce bios_limit per cpu cpufreq sysfs interface
This interface is mainly intended (and implemented) for ACPI _PPC BIOS
frequency limitations, but other cpufreq drivers can also use it for
similar use-cases.
Why is this needed:
Currently it's not obvious why cpufreq got limited.
People see cpufreq/scaling_max_freq reduced, but this could have
happened by:
- any userspace prog writing to scaling_max_freq
- thermal limitations
- hardware (_PPC in ACPI case) limitiations
Therefore export bios_limit (in kHz) to:
- Point the user that it's the BIOS (broken or intended) which limits
frequency
- Export it as a sysfs interface for userspace progs.
While this was a rarely used feature on laptops, there will appear
more and more server implemenations providing "Green IT" features like
allowing the service processor to limit the frequency. People want
to know about HW/BIOS frequency limitations.
All ACPI P-state driven cpufreq drivers are covered with this patch:
- powernow-k8
- powernow-k7
- acpi-cpufreq
Tested with a patched DSDT which limits the first two cores (_PPC returns 1)
via _PPC, exposed by bios_limit:
# echo 2200000 >cpu2/cpufreq/scaling_max_freq
# cat cpu*/cpufreq/scaling_max_freq
2600000
2600000
2200000
2200000
# #scaling_max_freq shows general user/thermal/BIOS limitations
# cat cpu*/cpufreq/bios_limit
2600000
2600000
2800000
2800000
# #bios_limit only shows the HW/BIOS limitation
CC: Pallipadi Venkatesh <venkatesh.pallipadi@intel.com>
CC: Len Brown <lenb@kernel.org>
CC: davej@codemonkey.org.uk
CC: linux@dominikbrodowski.net
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'include/acpi')
-rw-r--r-- | include/acpi/processor.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 740ac3ad8fd0..8b668ead6d6e 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -295,6 +295,7 @@ static inline void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx | |||
295 | void acpi_processor_ppc_init(void); | 295 | void acpi_processor_ppc_init(void); |
296 | void acpi_processor_ppc_exit(void); | 296 | void acpi_processor_ppc_exit(void); |
297 | int acpi_processor_ppc_has_changed(struct acpi_processor *pr); | 297 | int acpi_processor_ppc_has_changed(struct acpi_processor *pr); |
298 | extern int acpi_processor_get_bios_limit(int cpu, unsigned int *limit); | ||
298 | #else | 299 | #else |
299 | static inline void acpi_processor_ppc_init(void) | 300 | static inline void acpi_processor_ppc_init(void) |
300 | { | 301 | { |
@@ -316,6 +317,11 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) | |||
316 | } | 317 | } |
317 | return 0; | 318 | return 0; |
318 | } | 319 | } |
320 | static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit) | ||
321 | { | ||
322 | return -ENODEV; | ||
323 | } | ||
324 | |||
319 | #endif /* CONFIG_CPU_FREQ */ | 325 | #endif /* CONFIG_CPU_FREQ */ |
320 | 326 | ||
321 | /* in processor_throttling.c */ | 327 | /* in processor_throttling.c */ |