Skip to content

Commit

Permalink
Merge branch 'pm-cpufreq'
Browse files Browse the repository at this point in the history
* pm-cpufreq: (40 commits)
  thermal: exynos: boost: Automatic enable/disable of BOOST feature (at Exynos4412)
  cpufreq: exynos4x12: Change L0 driver data to CPUFREQ_BOOST_FREQ
  Documentation: cpufreq / boost: Update BOOST documentation
  cpufreq: exynos: Extend Exynos cpufreq driver to support boost
  cpufreq / boost: Kconfig: Support for software-managed BOOST
  acpi-cpufreq: Adjust the code to use the common boost attribute
  cpufreq: Add boost frequency support in core
  intel_pstate: Add trace point to report internal state.
  cpufreq: introduce cpufreq_generic_get() routine
  ARM: SA1100: Create dummy clk_get_rate() to avoid build failures
  cpufreq: stats: create sysfs entries when cpufreq_stats is a module
  cpufreq: stats: free table and remove sysfs entry in a single routine
  cpufreq: stats: remove hotplug notifiers
  cpufreq: stats: handle cpufreq_unregister_driver() and suspend/resume properly
  cpufreq: speedstep: remove unused speedstep_get_state
  powernow-k6: reorder frequencies
  powernow-k6: correctly initialize default parameters
  powernow-k6: disable cache when changing frequency
  Documentation: add ABI entry for intel_pstate
  cpufreq: exynos: Convert exynos-cpufreq to platform driver
  ...
  • Loading branch information
rafaeljw committed Jan 17, 2014
2 parents df34ca7 + 4f11b85 commit 7744064
Show file tree
Hide file tree
Showing 51 changed files with 1,019 additions and 609 deletions.
24 changes: 24 additions & 0 deletions Documentation/ABI/testing/sysfs-devices-system-cpu
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,27 @@ Description: address and size of the percpu note.
note of cpu#.

crash_notes_size: size of the note of cpu#.


What: /sys/devices/system/cpu/intel_pstate/max_perf_pct
/sys/devices/system/cpu/intel_pstate/min_perf_pct
/sys/devices/system/cpu/intel_pstate/no_turbo
Date: February 2013
Contact: linux-pm@vger.kernel.org
Description: Parameters for the Intel P-state driver

Logic for selecting the current P-state in Intel
Sandybridge+ processors. The three knobs control
limits for the P-state that will be requested by the
driver.

max_perf_pct: limits the maximum P state that will be requested by
the driver stated as a percentage of the available performance.

min_perf_pct: limits the minimum P state that will be requested by
the driver stated as a percentage of the available performance.

no_turbo: limits the driver to selecting P states below the turbo
frequency range.

More details can be found in Documentation/cpu-freq/intel-pstate.txt
26 changes: 13 additions & 13 deletions Documentation/cpu-freq/boost.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Introduction
Some CPUs support a functionality to raise the operating frequency of
some cores in a multi-core package if certain conditions apply, mostly
if the whole chip is not fully utilized and below it's intended thermal
budget. This is done without operating system control by a combination
of hardware and firmware.
budget. The decision about boost disable/enable is made either at hardware
(e.g. x86) or software (e.g ARM).
On Intel CPUs this is called "Turbo Boost", AMD calls it "Turbo-Core",
in technical documentation "Core performance boost". In Linux we use
the term "boost" for convenience.
Expand Down Expand Up @@ -48,24 +48,24 @@ be desirable:
User controlled switch
----------------------

To allow the user to toggle the boosting functionality, the acpi-cpufreq
driver exports a sysfs knob to disable it. There is a file:
To allow the user to toggle the boosting functionality, the cpufreq core
driver exports a sysfs knob to enable or disable it. There is a file:
/sys/devices/system/cpu/cpufreq/boost
which can either read "0" (boosting disabled) or "1" (boosting enabled).
Reading the file is always supported, even if the processor does not
support boosting. In this case the file will be read-only and always
reads as "0". Explicitly changing the permissions and writing to that
file anyway will return EINVAL.
The file is exported only when cpufreq driver supports boosting.
Explicitly changing the permissions and writing to that file anyway will
return EINVAL.

On supported CPUs one can write either a "0" or a "1" into this file.
This will either disable the boost functionality on all cores in the
whole system (0) or will allow the hardware to boost at will (1).
whole system (0) or will allow the software or hardware to boost at will
(1).

Writing a "1" does not explicitly boost the system, but just allows the
CPU (and the firmware) to boost at their discretion. Some implementations
take external factors like the chip's temperature into account, so
boosting once does not necessarily mean that it will occur every time
even using the exact same software setup.
CPU to boost at their discretion. Some implementations take external
factors like the chip's temperature into account, so boosting once does
not necessarily mean that it will occur every time even using the exact
same software setup.


AMD legacy cpb switch
Expand Down
40 changes: 40 additions & 0 deletions Documentation/cpu-freq/intel-pstate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Intel P-state driver
--------------------

This driver implements a scaling driver with an internal governor for
Intel Core processors. The driver follows the same model as the
Transmeta scaling driver (longrun.c) and implements the setpolicy()
instead of target(). Scaling drivers that implement setpolicy() are
assumed to implement internal governors by the cpufreq core. All the
logic for selecting the current P state is contained within the
driver; no external governor is used by the cpufreq core.

Intel SandyBridge+ processors are supported.

New sysfs files for controlling P state selection have been added to
/sys/devices/system/cpu/intel_pstate/

max_perf_pct: limits the maximum P state that will be requested by
the driver stated as a percentage of the available performance.

min_perf_pct: limits the minimum P state that will be requested by
the driver stated as a percentage of the available performance.

no_turbo: limits the driver to selecting P states below the turbo
frequency range.

For contemporary Intel processors, the frequency is controlled by the
processor itself and the P-states exposed to software are related to
performance levels. The idea that frequency can be set to a single
frequency is fiction for Intel Core processors. Even if the scaling
driver selects a single P state the actual frequency the processor
will run at is selected by the processor itself.

New debugfs files have also been added to /sys/kernel/debug/pstate_snb/

deadband
d_gain_pct
i_gain_pct
p_gain_pct
sample_rate_ms
setpoint
5 changes: 5 additions & 0 deletions arch/arm/mach-exynos/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ void __init exynos_cpuidle_init(void)
platform_device_register(&exynos_cpuidle);
}

void __init exynos_cpufreq_init(void)
{
platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
}

void __init exynos_init_late(void)
{
if (of_machine_is_compatible("samsung,exynos5440"))
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-exynos/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ void exynos_init_io(void);
void exynos4_restart(enum reboot_mode mode, const char *cmd);
void exynos5_restart(enum reboot_mode mode, const char *cmd);
void exynos_cpuidle_init(void);
void exynos_cpufreq_init(void);
void exynos_init_late(void);

void exynos_firmware_init(void);
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-exynos/mach-exynos4-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
static void __init exynos4_dt_machine_init(void)
{
exynos_cpuidle_init();
exynos_cpufreq_init();

of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-exynos/mach-exynos5-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ static void __init exynos5_dt_machine_init(void)
}

exynos_cpuidle_init();
exynos_cpufreq_init();

of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/mach-sa1100/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ struct clk clk_##_name = { \

static DEFINE_SPINLOCK(clocks_lock);

/* Dummy clk routine to build generic kernel parts that may be using them */
unsigned long clk_get_rate(struct clk *clk)
{
return 0;
}
EXPORT_SYMBOL(clk_get_rate);

static void clk_gpio27_enable(struct clk *clk)
{
/*
Expand Down
7 changes: 6 additions & 1 deletion drivers/cpufreq/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ if CPU_FREQ
config CPU_FREQ_GOV_COMMON
bool

config CPU_FREQ_BOOST_SW
bool
depends on THERMAL

config CPU_FREQ_STAT
tristate "CPU frequency translation statistics"
default y
Expand Down Expand Up @@ -181,7 +185,8 @@ config CPU_FREQ_GOV_CONSERVATIVE

config GENERIC_CPUFREQ_CPU0
tristate "Generic CPU0 cpufreq driver"
depends on HAVE_CLK && REGULATOR && PM_OPP && OF
depends on HAVE_CLK && REGULATOR && OF
select PM_OPP
help
This adds a generic cpufreq driver for CPU0 frequency management.
It supports both uniprocessor (UP) and symmetric multiprocessor (SMP)
Expand Down
27 changes: 22 additions & 5 deletions drivers/cpufreq/Kconfig.arm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

config ARM_BIG_LITTLE_CPUFREQ
tristate "Generic ARM big LITTLE CPUfreq driver"
depends on ARM_CPU_TOPOLOGY && PM_OPP && HAVE_CLK
depends on ARM && BIG_LITTLE && ARM_CPU_TOPOLOGY && HAVE_CLK
select PM_OPP
help
This enables the Generic CPUfreq driver for ARM big.LITTLE platforms.

Expand Down Expand Up @@ -54,7 +55,8 @@ config ARM_EXYNOS5250_CPUFREQ
config ARM_EXYNOS5440_CPUFREQ
bool "SAMSUNG EXYNOS5440"
depends on SOC_EXYNOS5440
depends on HAVE_CLK && PM_OPP && OF
depends on HAVE_CLK && OF
select PM_OPP
default y
help
This adds the CPUFreq driver for Samsung EXYNOS5440
Expand All @@ -64,6 +66,21 @@ config ARM_EXYNOS5440_CPUFREQ

If in doubt, say N.

config ARM_EXYNOS_CPU_FREQ_BOOST_SW
bool "EXYNOS Frequency Overclocking - Software"
depends on ARM_EXYNOS_CPUFREQ
select CPU_FREQ_BOOST_SW
select EXYNOS_THERMAL
help
This driver supports software managed overclocking (BOOST).
It allows usage of special frequencies for Samsung Exynos
processors if thermal conditions are appropriate.

It reguires, for safe operation, thermal framework with properly
defined trip points.

If in doubt, say N.

config ARM_HIGHBANK_CPUFREQ
tristate "Calxeda Highbank-based"
depends on ARCH_HIGHBANK
Expand All @@ -79,11 +96,11 @@ config ARM_HIGHBANK_CPUFREQ
If in doubt, say N.

config ARM_IMX6Q_CPUFREQ
tristate "Freescale i.MX6Q cpufreq support"
depends on SOC_IMX6Q
tristate "Freescale i.MX6 cpufreq support"
depends on ARCH_MXC
depends on REGULATOR_ANATOP
help
This adds cpufreq driver support for Freescale i.MX6Q SOC.
This adds cpufreq driver support for Freescale i.MX6 series SoCs.

If in doubt, say N.

Expand Down
Loading

0 comments on commit 7744064

Please sign in to comment.