diff options
author | 2017-08-29 03:14:37 +0200 | |
---|---|---|
committer | 2017-08-30 03:06:33 +0200 | |
commit | 1b39e3f813b4685c7a30ae964d5529a1b0e3a286 (patch) | |
tree | c99c7dfdb062f77af7076c398358dadfcdffa9ca /drivers/acpi | |
parent | cpuidle: Move polling state initialization code to separate file (diff) | |
download | linux-1b39e3f813b4685c7a30ae964d5529a1b0e3a286.tar.gz linux-1b39e3f813b4685c7a30ae964d5529a1b0e3a286.tar.bz2 linux-1b39e3f813b4685c7a30ae964d5529a1b0e3a286.zip |
cpuidle: Make drivers initialize polling state
Make the drivers that want to include the polling state into their
states table initialize it explicitly and drop the initialization of
it (which in fact is conditional, but that is not obvious from the
code) from the core.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/processor_idle.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 39a01ea7a46d..df38e81cc672 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -842,7 +842,7 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr, static int acpi_processor_setup_cstates(struct acpi_processor *pr) { - int i, count = ACPI_IDLE_STATE_START; + int i, count; struct acpi_processor_cx *cx; struct cpuidle_state *state; struct cpuidle_driver *drv = &acpi_idle_driver; @@ -850,6 +850,13 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr) if (max_cstate == 0) max_cstate = 1; + if (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX)) { + cpuidle_poll_state_init(drv); + count = 1; + } else { + count = 0; + } + for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { cx = &pr->power.states[i]; |