Commit 7113fe74 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branch 'pm-assorted'

* pm-assorted:
  suspend: enable freeze timeout configuration through sys
  ACPI: enable ACPI SCI during suspend
  PM: Introduce suspend state PM_SUSPEND_FREEZE
  PM / Runtime: Add new helper function: pm_runtime_active()
  PM / tracing: remove deprecated power trace API
  PM: don't use [delayed_]work_pending()
  PM / Domains: don't use [delayed_]work_pending()
parents a68d3532 957d1282
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -223,3 +223,8 @@ since they ask the freezer to skip freezing this task, since it is anyway
only after the entire suspend/hibernation sequence is complete.
So, to summarize, use [un]lock_system_sleep() instead of directly using
mutex_[un]lock(&pm_mutex). That would prevent freezing failures.

V. Miscellaneous
/sys/power/pm_freeze_timeout controls how long it will cost at most to freeze
all user space processes or all freezable kernel threads, in unit of millisecond.
The default value is 20000, with range of unsigned integer.
+4 −0
Original line number Diff line number Diff line
@@ -426,6 +426,10 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
      'power.runtime_error' is set or 'power.disable_depth' is greater than
      zero)

  bool pm_runtime_active(struct device *dev);
    - return true if the device's runtime PM status is 'active' or its
      'power.disable_depth' field is not equal to zero, or false otherwise

  bool pm_runtime_suspended(struct device *dev);
    - return true if the device's runtime PM status is 'suspended' and its
      'power.disable_depth' field is equal to zero, or false otherwise
+1 −26
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ Cf. include/trace/events/power.h for the events definitions.
1. Power state switch events
============================

1.1 New trace API
1.1 Trace API
-----------------

A 'cpu' event class gathers the CPU-related events: cpuidle and
@@ -41,31 +41,6 @@ The event which has 'state=4294967295' in the trace is very important to the use
space tools which are using it to detect the end of the current state, and so to
correctly draw the states diagrams and to calculate accurate statistics etc.

1.2 DEPRECATED trace API
------------------------

A new Kconfig option CONFIG_EVENT_POWER_TRACING_DEPRECATED with the default value of
'y' has been created. This allows the legacy trace power API to be used conjointly
with the new trace API.
The Kconfig option, the old trace API (in include/trace/events/power.h) and the
old trace points will disappear in a future release (namely 2.6.41).

power_start		"type=%lu state=%lu cpu_id=%lu"
power_frequency		"type=%lu state=%lu cpu_id=%lu"
power_end		"cpu_id=%lu"

The 'type' parameter takes one of those macros:
 . POWER_NONE	= 0,
 . POWER_CSTATE	= 1,	/* C-State */
 . POWER_PSTATE	= 2,	/* Frequency change or DVFS */

The 'state' parameter is set depending on the type:
 . Target C-state for type=POWER_CSTATE,
 . Target frequency for type=POWER_PSTATE,

power_end is used to indicate the exit of a state, corresponding to the latest
power_start event.

2. Clocks events
================
The clock events are used for clock enable/disable and for
+0 −2
Original line number Diff line number Diff line
@@ -351,12 +351,10 @@ static void omap3_pm_idle(void)
	if (omap_irq_pending())
		goto out;

	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
	trace_cpu_idle(1, smp_processor_id());

	omap_sram_idle();

	trace_power_end(smp_processor_id());
	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());

out:
+0 −6
Original line number Diff line number Diff line
@@ -375,7 +375,6 @@ void cpu_idle(void)
 */
void default_idle(void)
{
	trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id());
	trace_cpu_idle_rcuidle(1, smp_processor_id());
	current_thread_info()->status &= ~TS_POLLING;
	/*
@@ -389,7 +388,6 @@ void default_idle(void)
	else
		local_irq_enable();
	current_thread_info()->status |= TS_POLLING;
	trace_power_end_rcuidle(smp_processor_id());
	trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
}
#ifdef CONFIG_APM_MODULE
@@ -423,7 +421,6 @@ void stop_this_cpu(void *dummy)
static void mwait_idle(void)
{
	if (!need_resched()) {
		trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id());
		trace_cpu_idle_rcuidle(1, smp_processor_id());
		if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR))
			clflush((void *)&current_thread_info()->flags);
@@ -434,7 +431,6 @@ static void mwait_idle(void)
			__sti_mwait(0, 0);
		else
			local_irq_enable();
		trace_power_end_rcuidle(smp_processor_id());
		trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
	} else
		local_irq_enable();
@@ -447,12 +443,10 @@ static void mwait_idle(void)
 */
static void poll_idle(void)
{
	trace_power_start_rcuidle(POWER_CSTATE, 0, smp_processor_id());
	trace_cpu_idle_rcuidle(0, smp_processor_id());
	local_irq_enable();
	while (!need_resched())
		cpu_relax();
	trace_power_end_rcuidle(smp_processor_id());
	trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
}

Loading