OpenCloudOS-Kernel/drivers/cpuidle
Colin Cross 9e19b73c30 cpuidle: coupled: fix race condition between pokes and safe state
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>
Cc: 3.6+ <stable@vger.kernel.org> # 3.6+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-08-29 22:15:34 +02:00
..
governors cpuidle: Change struct menu_device field types 2013-08-23 00:24:16 +02:00
Kconfig cpuidle: Add Kconfig.arm and move calxeda, kirkwood and zynq 2013-07-27 07:56:37 +02:00
Kconfig.arm ARM: ux500: cpuidle: Move ux500 cpuidle driver to drivers/cpuidle 2013-07-27 07:56:39 +02:00
Makefile ARM: ux500: cpuidle: Move ux500 cpuidle driver to drivers/cpuidle 2013-07-27 07:56:39 +02:00
coupled.c cpuidle: coupled: fix race condition between pokes and safe state 2013-08-29 22:15:34 +02:00
cpuidle-calxeda.c cpuidle: calxeda: Add missing __iomem annotation 2013-08-12 11:28:29 +02:00
cpuidle-kirkwood.c cpuidle-kirkwood.c: simplify use of devm_ioremap_resource() 2013-08-14 22:20:06 +02:00
cpuidle-ux500.c ARM: ux500: cpuidle: Move ux500 cpuidle driver to drivers/cpuidle 2013-07-27 07:56:39 +02:00
cpuidle-zynq.c ARM: zynq: Add cpuidle support 2013-06-05 14:04:26 +02:00
cpuidle.c cpuidle: Check if device is already registered 2013-07-15 02:09:48 +02:00
cpuidle.h cpuidle: support multiple drivers 2012-11-15 00:34:23 +01:00
driver.c cpuidle: Comment the driver's framework code 2013-06-11 14:18:33 +02:00
governor.c cpuidle: create bootparam "cpuidle.off=1" 2011-08-03 19:06:36 -04:00
sysfs.c cpuidle: Make cpuidle's sysfs directory dynamically allocated 2013-07-15 02:09:47 +02:00