linux/drivers/cpuidle
Colin Cross 736899ab70 cpuidle: coupled: fix race condition between pokes and safe state
commit 9e19b73c30 upstream.

The coupled cpuidle waiting loop clears pending pokes before
entering the safe state.  If a poke arrives just before the
pokes are cleared, but after the while loop condition checks,
the poke will be lost and the cpu will stay in the safe state
until another interrupt arrives.  This may cause the cpu that
sent the poke to spin in the ready loop with interrupts off
until another cpu receives an interrupt, and if no other cpus
have interrupts routed to them it can spin forever.

Change the return value of cpuidle_coupled_clear_pokes to
return if a poke was cleared, and move the need_resched()
checks into the callers.  In the waiting loop, if
a poke was cleared restart the loop to repeat the while
condition checks.

Reported-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26 17:18:02 -07:00
..
governors Revert "cpuidle: Quickly notice prediction failure for repeat mode" 2013-08-11 18:35:24 -07:00
coupled.c cpuidle: coupled: fix race condition between pokes and safe state 2013-09-26 17:18:02 -07:00
cpuidle-calxeda.c cpuidle: add maintainer entry 2013-04-26 22:30:25 +02:00
cpuidle-kirkwood.c cpuidle: add maintainer entry 2013-04-26 22:30:25 +02:00
cpuidle.c cpuidle: fix comment format 2013-04-24 00:54:51 +02:00
cpuidle.h cpuidle: support multiple drivers 2012-11-15 00:34:23 +01:00
driver.c cpuidle: initialize the broadcast timer framework 2013-04-01 01:10:28 +02:00
governor.c cpuidle: create bootparam "cpuidle.off=1" 2011-08-03 19:06:36 -04:00
Kconfig cpuidle / kirkwood: remove redundant Kconfig option 2013-04-01 01:10:27 +02:00
Makefile cpuidle / kirkwood: remove redundant Kconfig option 2013-04-01 01:10:27 +02:00
sysfs.c cpuidle: fix number of initialized/destroyed states 2013-01-11 23:20:09 +01:00