Skip to content

Commit 7113fe7

Browse files
committed
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()
2 parents a68d353 + 957d128 commit 7113fe7

21 files changed

Lines changed: 125 additions & 174 deletions

File tree

‎Documentation/power/freezing-of-tasks.txt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,8 @@ since they ask the freezer to skip freezing this task, since it is anyway
223223
only after the entire suspend/hibernation sequence is complete.
224224
So, to summarize, use [un]lock_system_sleep() instead of directly using
225225
mutex_[un]lock(&pm_mutex). That would prevent freezing failures.
226+
227+
V. Miscellaneous
228+
/sys/power/pm_freeze_timeout controls how long it will cost at most to freeze
229+
all user space processes or all freezable kernel threads, in unit of millisecond.
230+
The default value is 20000, with range of unsigned integer.

‎Documentation/power/runtime_pm.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,10 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
426426
'power.runtime_error' is set or 'power.disable_depth' is greater than
427427
zero)
428428

429+
bool pm_runtime_active(struct device *dev);
430+
- return true if the device's runtime PM status is 'active' or its
431+
'power.disable_depth' field is not equal to zero, or false otherwise
432+
429433
bool pm_runtime_suspended(struct device *dev);
430434
- return true if the device's runtime PM status is 'suspended' and its
431435
'power.disable_depth' field is equal to zero, or false otherwise

‎Documentation/trace/events-power.txt‎

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Cf. include/trace/events/power.h for the events definitions.
1717
1. Power state switch events
1818
============================
1919

20-
1.1 New trace API
20+
1.1 Trace API
2121
-----------------
2222

2323
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
4141
space tools which are using it to detect the end of the current state, and so to
4242
correctly draw the states diagrams and to calculate accurate statistics etc.
4343

44-
1.2 DEPRECATED trace API
45-
------------------------
46-
47-
A new Kconfig option CONFIG_EVENT_POWER_TRACING_DEPRECATED with the default value of
48-
'y' has been created. This allows the legacy trace power API to be used conjointly
49-
with the new trace API.
50-
The Kconfig option, the old trace API (in include/trace/events/power.h) and the
51-
old trace points will disappear in a future release (namely 2.6.41).
52-
53-
power_start "type=%lu state=%lu cpu_id=%lu"
54-
power_frequency "type=%lu state=%lu cpu_id=%lu"
55-
power_end "cpu_id=%lu"
56-
57-
The 'type' parameter takes one of those macros:
58-
. POWER_NONE = 0,
59-
. POWER_CSTATE = 1, /* C-State */
60-
. POWER_PSTATE = 2, /* Frequency change or DVFS */
61-
62-
The 'state' parameter is set depending on the type:
63-
. Target C-state for type=POWER_CSTATE,
64-
. Target frequency for type=POWER_PSTATE,
65-
66-
power_end is used to indicate the exit of a state, corresponding to the latest
67-
power_start event.
68-
6944
2. Clocks events
7045
================
7146
The clock events are used for clock enable/disable and for

‎arch/arm/mach-omap2/pm34xx.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,10 @@ static void omap3_pm_idle(void)
351351
if (omap_irq_pending())
352352
goto out;
353353

354-
trace_power_start(POWER_CSTATE, 1, smp_processor_id());
355354
trace_cpu_idle(1, smp_processor_id());
356355

357356
omap_sram_idle();
358357

359-
trace_power_end(smp_processor_id());
360358
trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
361359

362360
out:

‎arch/x86/kernel/process.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ void cpu_idle(void)
375375
*/
376376
void default_idle(void)
377377
{
378-
trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id());
379378
trace_cpu_idle_rcuidle(1, smp_processor_id());
380379
current_thread_info()->status &= ~TS_POLLING;
381380
/*
@@ -389,7 +388,6 @@ void default_idle(void)
389388
else
390389
local_irq_enable();
391390
current_thread_info()->status |= TS_POLLING;
392-
trace_power_end_rcuidle(smp_processor_id());
393391
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
394392
}
395393
#ifdef CONFIG_APM_MODULE
@@ -423,7 +421,6 @@ void stop_this_cpu(void *dummy)
423421
static void mwait_idle(void)
424422
{
425423
if (!need_resched()) {
426-
trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id());
427424
trace_cpu_idle_rcuidle(1, smp_processor_id());
428425
if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR))
429426
clflush((void *)&current_thread_info()->flags);
@@ -434,7 +431,6 @@ static void mwait_idle(void)
434431
__sti_mwait(0, 0);
435432
else
436433
local_irq_enable();
437-
trace_power_end_rcuidle(smp_processor_id());
438434
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
439435
} else
440436
local_irq_enable();
@@ -447,12 +443,10 @@ static void mwait_idle(void)
447443
*/
448444
static void poll_idle(void)
449445
{
450-
trace_power_start_rcuidle(POWER_CSTATE, 0, smp_processor_id());
451446
trace_cpu_idle_rcuidle(0, smp_processor_id());
452447
local_irq_enable();
453448
while (!need_resched())
454449
cpu_relax();
455-
trace_power_end_rcuidle(smp_processor_id());
456450
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
457451
}
458452

‎drivers/acpi/osl.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler,
787787

788788
acpi_irq_handler = handler;
789789
acpi_irq_context = context;
790-
if (request_irq(irq, acpi_irq, IRQF_SHARED, "acpi", acpi_irq)) {
790+
if (request_irq(irq, acpi_irq, IRQF_SHARED | IRQF_NO_SUSPEND, "acpi", acpi_irq)) {
791791
printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq);
792792
acpi_irq_handler = NULL;
793793
return AE_NOT_ACQUIRED;

‎drivers/base/power/domain.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,7 @@ static bool genpd_abort_poweroff(struct generic_pm_domain *genpd)
433433
*/
434434
void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
435435
{
436-
if (!work_pending(&genpd->power_off_work))
437-
queue_work(pm_wq, &genpd->power_off_work);
436+
queue_work(pm_wq, &genpd->power_off_work);
438437
}
439438

440439
/**

‎drivers/base/power/wakeup.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,12 @@ static void wakeup_source_activate(struct wakeup_source *ws)
382382
{
383383
unsigned int cec;
384384

385+
/*
386+
* active wakeup source should bring the system
387+
* out of PM_SUSPEND_FREEZE state
388+
*/
389+
freeze_wake();
390+
385391
ws->active = true;
386392
ws->active_count++;
387393
ws->last_time = ktime_get();

‎drivers/cpufreq/cpufreq.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
294294
adjust_jiffies(CPUFREQ_POSTCHANGE, freqs);
295295
pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new,
296296
(unsigned long)freqs->cpu);
297-
trace_power_frequency(POWER_PSTATE, freqs->new, freqs->cpu);
298297
trace_cpu_frequency(freqs->new, freqs->cpu);
299298
srcu_notifier_call_chain(&cpufreq_transition_notifier_list,
300299
CPUFREQ_POSTCHANGE, freqs);

‎drivers/cpuidle/cpuidle.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ int cpuidle_idle_call(void)
144144
return 0;
145145
}
146146

147-
trace_power_start_rcuidle(POWER_CSTATE, next_state, dev->cpu);
148147
trace_cpu_idle_rcuidle(next_state, dev->cpu);
149148

150149
if (cpuidle_state_is_coupled(dev, drv, next_state))
@@ -153,7 +152,6 @@ int cpuidle_idle_call(void)
153152
else
154153
entered_state = cpuidle_enter_state(dev, drv, next_state);
155154

156-
trace_power_end_rcuidle(dev->cpu);
157155
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu);
158156

159157
/* give the governor an opportunity to reflect on the outcome */

0 commit comments

Comments
 (0)