diff options
Diffstat (limited to 'kernel/power/qos.c')
-rw-r--r-- | kernel/power/qos.c | 14 |
1 files changed, 11 insertions, 3 deletions
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", |