Commit 4e28ec3d authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge back earlier cpuidle material for v4.10.

parents a2c1bc64 6af33995
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3380,6 +3380,7 @@ M: Daniel Lezcano <daniel.lezcano@linaro.org>
L:	linux-pm@vger.kernel.org
S:	Maintained
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
B:	https://bugzilla.kernel.org
F:	drivers/cpuidle/*
F:	include/linux/cpuidle.h

@@ -6289,9 +6290,11 @@ S: Maintained
F:	drivers/platform/x86/intel-vbtn.c

INTEL IDLE DRIVER
M:	Jacob Pan <jacob.jun.pan@linux.intel.com>
M:	Len Brown <lenb@kernel.org>
L:	linux-pm@vger.kernel.org
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git
B:	https://bugzilla.kernel.org
S:	Supported
F:	drivers/idle/intel_idle.c

+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@

#define POWERNV_THRESHOLD_LATENCY_NS 200000

struct cpuidle_driver powernv_idle_driver = {
static struct cpuidle_driver powernv_idle_driver = {
	.name             = "powernv_idle",
	.owner            = THIS_MODULE,
};
+12 −1
Original line number Diff line number Diff line
@@ -97,7 +97,17 @@ static int find_deepest_state(struct cpuidle_driver *drv,
	return ret;
}

#ifdef CONFIG_SUSPEND
/* Set the current cpu to use the deepest idle state, override governors */
void cpuidle_use_deepest_state(bool enable)
{
	struct cpuidle_device *dev;

	preempt_disable();
	dev = cpuidle_get_device();
	dev->use_deepest_state = enable;
	preempt_enable();
}

/**
 * cpuidle_find_deepest_state - Find the deepest available idle state.
 * @drv: cpuidle driver for the given CPU.
@@ -109,6 +119,7 @@ int cpuidle_find_deepest_state(struct cpuidle_driver *drv,
	return find_deepest_state(drv, dev, UINT_MAX, 0, false);
}

#ifdef CONFIG_SUSPEND
static void enter_freeze_proper(struct cpuidle_driver *drv,
				struct cpuidle_device *dev, int index)
{
+6 −0
Original line number Diff line number Diff line
@@ -38,6 +38,12 @@ static int init_state_node(struct cpuidle_state *idle_state,
	 * state enter function.
	 */
	idle_state->enter = match_id->data;
	/*
	 * Since this is not a "coupled" state, it's safe to assume interrupts
	 * won't be enabled when it exits allowing the tick to be frozen
	 * safely. So enter() can be also enter_freeze() callback.
	 */
	idle_state->enter_freeze = match_id->data;

	err = of_property_read_u32(state_node, "wakeup-latency-us",
				   &idle_state->exit_latency);
+0 −4
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@
 */

#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/cpuidle.h>

#include "cpuidle.h"
@@ -53,14 +52,11 @@ int cpuidle_switch_governor(struct cpuidle_governor *gov)
	if (cpuidle_curr_governor) {
		list_for_each_entry(dev, &cpuidle_detected_devices, device_list)
			cpuidle_disable_device(dev);
		module_put(cpuidle_curr_governor->owner);
	}

	cpuidle_curr_governor = gov;

	if (gov) {
		if (!try_module_get(cpuidle_curr_governor->owner))
			return -EINVAL;
		list_for_each_entry(dev, &cpuidle_detected_devices, device_list)
			cpuidle_enable_device(dev);
		cpuidle_install_idle_handler();
Loading