diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-06-28 07:01:40 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-06-28 07:01:40 -0400 |
commit | e52cff8bdd4a30c40a7f65c7ea8f1f425f8a15eb (patch) | |
tree | 1729332ebab51bb560ca64effe46cdab38ab537f /kernel/power | |
parent | 405a1086bdd091d2d55db0ac905cd6332b35cec1 (diff) | |
parent | f5ce1572109049b90484e2bb44927cb6034c5eb1 (diff) |
Merge branch 'pm-assorted'
* pm-assorted:
PM / QoS: Add pm_qos and dev_pm_qos to events-power.txt
PM / QoS: Add dev_pm_qos_request tracepoints
PM / QoS: Add pm_qos_request tracepoints
PM / QoS: Add pm_qos_update_target/flags tracepoints
PM / QoS: Update Documentation/power/pm_qos_interface.txt
PM / Sleep: Print last wakeup source on failed wakeup_count write
PM / QoS: correct the valid range of pm_qos_class
PM / wakeup: Adjust messaging for wake events during suspend
PM / Runtime: Update .runtime_idle() callback documentation
PM / Runtime: Rework the "runtime idle" helper routine
PM / Hibernate: print physical addresses consistently with other parts of kernel
Diffstat (limited to 'kernel/power')
-rw-r--r-- | kernel/power/main.c | 2 | ||||
-rw-r--r-- | kernel/power/qos.c | 14 | ||||
-rw-r--r-- | kernel/power/snapshot.c | 5 | ||||
-rw-r--r-- | kernel/power/suspend.c | 2 |
4 files changed, 17 insertions, 6 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c index d77663bfedeb..0828070d38b4 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -424,6 +424,8 @@ static ssize_t wakeup_count_store(struct kobject *kobj, | |||
424 | if (sscanf(buf, "%u", &val) == 1) { | 424 | if (sscanf(buf, "%u", &val) == 1) { |
425 | if (pm_save_wakeup_count(val)) | 425 | if (pm_save_wakeup_count(val)) |
426 | error = n; | 426 | error = n; |
427 | else | ||
428 | pm_print_active_wakeup_sources(); | ||
427 | } | 429 | } |
428 | 430 | ||
429 | out: | 431 | out: |
diff --git a/kernel/power/qos.c b/kernel/power/qos.c index 587dddeebf15..06fe28589e9c 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c | |||
@@ -44,6 +44,7 @@ | |||
44 | 44 | ||
45 | #include <linux/uaccess.h> | 45 | #include <linux/uaccess.h> |
46 | #include <linux/export.h> | 46 | #include <linux/export.h> |
47 | #include <trace/events/power.h> | ||
47 | 48 | ||
48 | /* | 49 | /* |
49 | * locking rule: all changes to constraints or notifiers lists | 50 | * locking rule: all changes to constraints or notifiers lists |
@@ -202,6 +203,7 @@ int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, | |||
202 | 203 | ||
203 | spin_unlock_irqrestore(&pm_qos_lock, flags); | 204 | spin_unlock_irqrestore(&pm_qos_lock, flags); |
204 | 205 | ||
206 | trace_pm_qos_update_target(action, prev_value, curr_value); | ||
205 | if (prev_value != curr_value) { | 207 | if (prev_value != curr_value) { |
206 | blocking_notifier_call_chain(c->notifiers, | 208 | blocking_notifier_call_chain(c->notifiers, |
207 | (unsigned long)curr_value, | 209 | (unsigned long)curr_value, |
@@ -272,6 +274,7 @@ bool pm_qos_update_flags(struct pm_qos_flags *pqf, | |||
272 | 274 | ||
273 | spin_unlock_irqrestore(&pm_qos_lock, irqflags); | 275 | spin_unlock_irqrestore(&pm_qos_lock, irqflags); |
274 | 276 | ||
277 | trace_pm_qos_update_flags(action, prev_value, curr_value); | ||
275 | return prev_value != curr_value; | 278 | return prev_value != curr_value; |
276 | } | 279 | } |
277 | 280 | ||
@@ -333,6 +336,7 @@ void pm_qos_add_request(struct pm_qos_request *req, | |||
333 | } | 336 | } |
334 | req->pm_qos_class = pm_qos_class; | 337 | req->pm_qos_class = pm_qos_class; |
335 | INIT_DELAYED_WORK(&req->work, pm_qos_work_fn); | 338 | INIT_DELAYED_WORK(&req->work, pm_qos_work_fn); |
339 | trace_pm_qos_add_request(pm_qos_class, value); | ||
336 | pm_qos_update_target(pm_qos_array[pm_qos_class]->constraints, | 340 | pm_qos_update_target(pm_qos_array[pm_qos_class]->constraints, |
337 | &req->node, PM_QOS_ADD_REQ, value); | 341 | &req->node, PM_QOS_ADD_REQ, value); |
338 | } | 342 | } |
@@ -361,6 +365,7 @@ void pm_qos_update_request(struct pm_qos_request *req, | |||
361 | 365 | ||
362 | cancel_delayed_work_sync(&req->work); | 366 | cancel_delayed_work_sync(&req->work); |
363 | 367 | ||
368 | trace_pm_qos_update_request(req->pm_qos_class, new_value); | ||
364 | if (new_value != req->node.prio) | 369 | if (new_value != req->node.prio) |
365 | pm_qos_update_target( | 370 | pm_qos_update_target( |
366 | pm_qos_array[req->pm_qos_class]->constraints, | 371 | pm_qos_array[req->pm_qos_class]->constraints, |
@@ -387,6 +392,8 @@ void pm_qos_update_request_timeout(struct pm_qos_request *req, s32 new_value, | |||
387 | 392 | ||
388 | cancel_delayed_work_sync(&req->work); | 393 | cancel_delayed_work_sync(&req->work); |
389 | 394 | ||
395 | trace_pm_qos_update_request_timeout(req->pm_qos_class, | ||
396 | new_value, timeout_us); | ||
390 | if (new_value != req->node.prio) | 397 | if (new_value != req->node.prio) |
391 | pm_qos_update_target( | 398 | pm_qos_update_target( |
392 | pm_qos_array[req->pm_qos_class]->constraints, | 399 | pm_qos_array[req->pm_qos_class]->constraints, |
@@ -416,6 +423,7 @@ void pm_qos_remove_request(struct pm_qos_request *req) | |||
416 | 423 | ||
417 | cancel_delayed_work_sync(&req->work); | 424 | cancel_delayed_work_sync(&req->work); |
418 | 425 | ||
426 | trace_pm_qos_remove_request(req->pm_qos_class, PM_QOS_DEFAULT_VALUE); | ||
419 | pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints, | 427 | pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints, |
420 | &req->node, PM_QOS_REMOVE_REQ, | 428 | &req->node, PM_QOS_REMOVE_REQ, |
421 | PM_QOS_DEFAULT_VALUE); | 429 | PM_QOS_DEFAULT_VALUE); |
@@ -477,7 +485,7 @@ static int find_pm_qos_object_by_minor(int minor) | |||
477 | { | 485 | { |
478 | int pm_qos_class; | 486 | int pm_qos_class; |
479 | 487 | ||
480 | for (pm_qos_class = 0; | 488 | for (pm_qos_class = PM_QOS_CPU_DMA_LATENCY; |
481 | pm_qos_class < PM_QOS_NUM_CLASSES; pm_qos_class++) { | 489 | pm_qos_class < PM_QOS_NUM_CLASSES; pm_qos_class++) { |
482 | if (minor == | 490 | if (minor == |
483 | pm_qos_array[pm_qos_class]->pm_qos_power_miscdev.minor) | 491 | pm_qos_array[pm_qos_class]->pm_qos_power_miscdev.minor) |
@@ -491,7 +499,7 @@ static int pm_qos_power_open(struct inode *inode, struct file *filp) | |||
491 | long pm_qos_class; | 499 | long pm_qos_class; |
492 | 500 | ||
493 | pm_qos_class = find_pm_qos_object_by_minor(iminor(inode)); | 501 | pm_qos_class = find_pm_qos_object_by_minor(iminor(inode)); |
494 | if (pm_qos_class >= 0) { | 502 | if (pm_qos_class >= PM_QOS_CPU_DMA_LATENCY) { |
495 | struct pm_qos_request *req = kzalloc(sizeof(*req), GFP_KERNEL); | 503 | struct pm_qos_request *req = kzalloc(sizeof(*req), GFP_KERNEL); |
496 | if (!req) | 504 | if (!req) |
497 | return -ENOMEM; | 505 | return -ENOMEM; |
@@ -584,7 +592,7 @@ static int __init pm_qos_power_init(void) | |||
584 | 592 | ||
585 | BUILD_BUG_ON(ARRAY_SIZE(pm_qos_array) != PM_QOS_NUM_CLASSES); | 593 | BUILD_BUG_ON(ARRAY_SIZE(pm_qos_array) != PM_QOS_NUM_CLASSES); |
586 | 594 | ||
587 | for (i = 1; i < PM_QOS_NUM_CLASSES; i++) { | 595 | for (i = PM_QOS_CPU_DMA_LATENCY; i < PM_QOS_NUM_CLASSES; i++) { |
588 | ret = register_pm_qos_misc(pm_qos_array[i]); | 596 | ret = register_pm_qos_misc(pm_qos_array[i]); |
589 | if (ret < 0) { | 597 | if (ret < 0) { |
590 | printk(KERN_ERR "pm_qos_param: %s setup failed\n", | 598 | printk(KERN_ERR "pm_qos_param: %s setup failed\n", |
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 0de28576807d..7872a35eafe7 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c | |||
@@ -642,8 +642,9 @@ __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn, | |||
642 | region->end_pfn = end_pfn; | 642 | region->end_pfn = end_pfn; |
643 | list_add_tail(®ion->list, &nosave_regions); | 643 | list_add_tail(®ion->list, &nosave_regions); |
644 | Report: | 644 | Report: |
645 | printk(KERN_INFO "PM: Registered nosave memory: %016lx - %016lx\n", | 645 | printk(KERN_INFO "PM: Registered nosave memory: [mem %#010llx-%#010llx]\n", |
646 | start_pfn << PAGE_SHIFT, end_pfn << PAGE_SHIFT); | 646 | (unsigned long long) start_pfn << PAGE_SHIFT, |
647 | ((unsigned long long) end_pfn << PAGE_SHIFT) - 1); | ||
647 | } | 648 | } |
648 | 649 | ||
649 | /* | 650 | /* |
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index bef86d121eb2..ece04223bb1e 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c | |||
@@ -269,7 +269,7 @@ int suspend_devices_and_enter(suspend_state_t state) | |||
269 | suspend_test_start(); | 269 | suspend_test_start(); |
270 | error = dpm_suspend_start(PMSG_SUSPEND); | 270 | error = dpm_suspend_start(PMSG_SUSPEND); |
271 | if (error) { | 271 | if (error) { |
272 | printk(KERN_ERR "PM: Some devices failed to suspend\n"); | 272 | pr_err("PM: Some devices failed to suspend, or early wake event detected\n"); |
273 | goto Recover_platform; | 273 | goto Recover_platform; |
274 | } | 274 | } |
275 | suspend_test_finish("suspend devices"); | 275 | suspend_test_finish("suspend devices"); |