From 00d5e2ddb1c56f36358be290c2104e9feec84465 Mon Sep 17 00:00:00 2001 From: Lianwei Wang Date: Fri, 26 Apr 2013 10:59:24 +0800 Subject: [PATCH] cpuidle: don't wakeup processor when set a longer latency We don't need wakeup the other CPUs immediately if a longer latency is set. Pass the prev_value to the notifier callback so the latency can be checked in cpuidle driver and only wakeup all the other CPUs when a shorter latency is set. Change-Id: If564fd0d9c53cf100bd85247bfd509dfeaf54c13 Signed-off-by: Lianwei Wang --- drivers/cpuidle/cpuidle.c | 6 +++++- kernel/power/qos.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index e1f6860..1e1758c 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -498,7 +498,11 @@ static void smp_callback(void *v) static int cpuidle_latency_notify(struct notifier_block *b, unsigned long l, void *v) { - smp_call_function(smp_callback, NULL, 1); + unsigned long prev_value = (unsigned long) v; + + /* Dont't waktup processor when set a longer latency */ + if (l < prev_value) + smp_call_function(smp_callback, NULL, 1); return NOTIFY_OK; } diff --git a/kernel/power/qos.c b/kernel/power/qos.c index 9322ff7..533b8bc 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -205,7 +205,7 @@ int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, if (prev_value != curr_value) { blocking_notifier_call_chain(c->notifiers, (unsigned long)curr_value, - NULL); + (void *)prev_value); return 1; } else { return 0; -- 1.7.4.1