powerpc/powernv/idle: Round up latency and residency values
authorVaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Wed, 23 Aug 2017 18:58:41 +0000 (00:28 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Dec 2017 14:08:00 +0000 (15:08 +0100)
commit854b27edf7b0672e5181e75274dc734863c89f2e
tree80ae2d4a6317186aa0cb8d7ba0f08a64e2468e14
parentb0c08c89ea1c0f47423d1da0bcdcd182611823c6
powerpc/powernv/idle: Round up latency and residency values

[ Upstream commit 8d4e10e9ed9450e18fbbf6a8872be0eac9fd4999 ]

On PowerNV platforms, firmware provides exit latency and
target residency for each of the idle states in nano
seconds.  Cpuidle framework expects the values in micro
seconds.  Round up to nearest micro seconds to avoid errors
in cases where the values are defined as fractional micro
seconds.

Default idle state of 'snooze' has exit latency of zero.  If
other states have fractional micro second exit latency, they
would get rounded down to zero micro second and make cpuidle
framework choose deeper idle state when snooze loop is the
right choice.

Reported-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cpuidle/cpuidle-powernv.c