提交 8d4e10e9 编写于 作者: V Vaidyanathan Srinivasan 提交者: Michael Ellerman

powerpc/powernv/idle: Round up latency and residency values

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: NAnton Blanchard <anton@samba.org>
Signed-off-by: NVaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Reviewed-by: NGautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 acdfe931
......@@ -383,9 +383,9 @@ static int powernv_add_idle_states(void)
* Firmware passes residency and latency values in ns.
* cpuidle expects it in us.
*/
exit_latency = latency_ns[i] / 1000;
exit_latency = DIV_ROUND_UP(latency_ns[i], 1000);
if (!rc)
target_residency = residency_ns[i] / 1000;
target_residency = DIV_ROUND_UP(residency_ns[i], 1000);
else
target_residency = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册