]> git.baikalelectronics.ru Git - kernel.git/commit
cpuidle-powernv: Allow Deep stop states that don't stop time
authorGautham R. Shenoy <ego@linux.vnet.ibm.com>
Tue, 16 May 2017 08:49:48 +0000 (14:19 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 30 May 2017 04:59:51 +0000 (14:59 +1000)
commitf558586d383c22a378326edb2bb3f1860426e9c3
tree2b96b25a8067bc3f3f2b2fe01b528d87a025e920
parent02f68b84a92cb8c362fe38cac282cd64f6b348dd
cpuidle-powernv: Allow Deep stop states that don't stop time

The current code in the cpuidle-powernv intialization only allows deep
stop states (indicated by OPAL_PM_STOP_INST_DEEP) which lose timebase
(indicated by OPAL_PM_TIMEBASE_STOP). This assumption goes back to
POWER8 time where deep states used to lose the timebase. However, on
POWER9, we do have stop states that are deep (they lose hypervisor
state) but retain the timebase.

Fix the initialization code in the cpuidle-powernv driver to allow
such deep states.

Further, there is a bug in cpuidle-powernv driver with
CONFIG_TICK_ONESHOT=n where we end up incrementing the nr_idle_states
even if a platform idle state which loses time base was not added to
the cpuidle table.

Fix this by ensuring that the nr_idle_states variable gets incremented
only when the platform idle state was added to the cpuidle table.

Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/cpuidle/cpuidle-powernv.c