remarkable-linux/drivers/cpuidle
Colin Cross 20ff51a36b cpuidle: coupled: add parallel barrier function
Adds cpuidle_coupled_parallel_barrier, which can be used by coupled
cpuidle state enter functions to handle resynchronization after
determining if any cpu needs to abort.  The normal use case will
be:

static bool abort_flag;
static atomic_t abort_barrier;

int arch_cpuidle_enter(struct cpuidle_device *dev, ...)
{
	if (arch_turn_off_irq_controller()) {
	   	/* returns an error if an irq is pending and would be lost
		   if idle continued and turned off power */
		abort_flag = true;
	}

	cpuidle_coupled_parallel_barrier(dev, &abort_barrier);

	if (abort_flag) {
	   	/* One of the cpus didn't turn off it's irq controller */
	   	arch_turn_on_irq_controller();
		return -EINTR;
	}

	/* continue with idle */
	...
}

This will cause all cpus to abort idle together if one of them needs
to abort.

Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-06-02 00:49:36 -04:00
..
governors cpuidle: power_usage should be declared signed integer 2012-03-30 03:23:30 -04:00
coupled.c cpuidle: coupled: add parallel barrier function 2012-06-02 00:49:36 -04:00
cpuidle.c cpuidle: add support for states that affect multiple cpus 2012-06-02 00:49:09 -04:00
cpuidle.h cpuidle: add support for states that affect multiple cpus 2012-06-02 00:49:09 -04:00
driver.c cpuidle: use the driver's state_count as default 2012-03-30 01:55:04 -04:00
governor.c cpuidle: create bootparam "cpuidle.off=1" 2011-08-03 19:06:36 -04:00
Kconfig cpuidle: add support for states that affect multiple cpus 2012-06-02 00:49:09 -04:00
Makefile cpuidle: add support for states that affect multiple cpus 2012-06-02 00:49:09 -04:00
sysfs.c cpuidle: add a sysfs entry to disable specific C state for debug purpose. 2012-03-30 01:52:58 -04:00