]> git.baikalelectronics.ru Git - kernel.git/commit
cpuidle: psci: Align psci_power_state count with idle state count
authorSudeep Holla <sudeep.holla@arm.com>
Thu, 24 Oct 2019 15:18:34 +0000 (16:18 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Thu, 2 Jan 2020 15:42:13 +0000 (16:42 +0100)
commit2cdab975ae9e1c92e87d104df6e454055cff055c
tree0c05c4a39e6905e25a4666f01242a033b2e042bd
parente7a57b071ab8244fee3e9bbbba987019ae618612
cpuidle: psci: Align psci_power_state count with idle state count

Instead of allocating 'n-1' states in psci_power_state to manage 'n'
idle states which include "ARM WFI" state, it would be simpler to have
1:1 mapping between psci_power_state and cpuidle driver states.

ARM WFI state(i.e. idx == 0) is handled specially in the generic macro
CPU_PM_CPU_IDLE_ENTER_PARAM and hence state[-1] is not possible. However
for sake of code readability, it is better to have 1:1 mapping and not
use [idx - 1] to access psci_power_state corresponding to driver cpuidle
state for idx.

psci_power_state[0] is default initialised to 0 and is never accessed
while entering WFI state.

Reported-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
drivers/cpuidle/cpuidle-psci.c