cpuidle: Move dev->last_residency update to driver enter routine; remove dev->last_state
authorDeepthi Dharwar <deepthi@linux.vnet.ibm.com>
Fri, 28 Oct 2011 10:50:09 +0000 (16:20 +0530)
committerLen Brown <len.brown@intel.com>
Mon, 7 Nov 2011 02:13:30 +0000 (21:13 -0500)
commite978aa7d7d57d04eb5f88a7507c4fb98577def77
treed6d6dfe1dba4d4749c7eafe348351aa499c3c5eb
parentc3b92c8787367a8bb53d57d9789b558f1295cc96
cpuidle: Move dev->last_residency update to driver enter routine; remove dev->last_state

Cpuidle governor only suggests the state to enter using the
governor->select() interface, but allows the low level driver to
override the recommended state. The actual entered state
may be different because of software or hardware demotion. Software
demotion is done by the back-end cpuidle driver and can be accounted
correctly. Current cpuidle code uses last_state field to capture the
actual state entered and based on that updates the statistics for the
state entered.

Ideally the driver enter routine should update the counters,
and it should return the state actually entered rather than the time
spent there. The generic cpuidle code should simply handle where
the counters live in the sysfs namespace, not updating the counters.

Reference:
https://lkml.org/lkml/2011/3/25/52

Signed-off-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
Signed-off-by: Trinabh Gupta <g.trinabh@gmail.com>
Tested-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Len Brown <len.brown@intel.com>
12 files changed:
arch/arm/mach-at91/cpuidle.c
arch/arm/mach-davinci/cpuidle.c
arch/arm/mach-exynos4/cpuidle.c
arch/arm/mach-kirkwood/cpuidle.c
arch/arm/mach-omap2/cpuidle34xx.c
arch/sh/kernel/cpu/shmobile/cpuidle.c
drivers/acpi/processor_idle.c
drivers/cpuidle/cpuidle.c
drivers/cpuidle/governors/ladder.c
drivers/cpuidle/governors/menu.c
drivers/idle/intel_idle.c
include/linux/cpuidle.h