aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@amacapital.net>2014-06-04 13:31:14 -0400
committerIngo Molnar <mingo@kernel.org>2014-06-05 06:09:49 -0400
commit84c407084137d4e491b07ea5ff8665d19106a5ac (patch)
tree39546e5d10871d68abef16efa1026958f9ce5132
parent0b07939cbfdd05bed0c5ec01b8b25493e6ecd34c (diff)
cpuidle: Set polling in poll_idle
poll_idle is the archetypal polling idle loop; tell the core idle code about it. This avoids pointless IPIs when all of the other cpuidle states are disabled. Signed-off-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: nicolas.pitre@linaro.org Cc: umgwanakikbuti@gmail.com Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Cc: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org Link: http://lkml.kernel.org/r/c65ce49615d338bae8fb79df5daffab19353c900.1401902905.git.luto@amacapital.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--drivers/cpuidle/driver.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
index 136d6a283e0a..9634f20e3926 100644
--- a/drivers/cpuidle/driver.c
+++ b/drivers/cpuidle/driver.c
@@ -187,8 +187,11 @@ static int poll_idle(struct cpuidle_device *dev,
187 187
188 t1 = ktime_get(); 188 t1 = ktime_get();
189 local_irq_enable(); 189 local_irq_enable();
190 while (!need_resched()) 190 if (!current_set_polling_and_test()) {
191 cpu_relax(); 191 while (!need_resched())
192 cpu_relax();
193 }
194 current_clr_polling();
192 195
193 t2 = ktime_get(); 196 t2 = ktime_get();
194 diff = ktime_to_us(ktime_sub(t2, t1)); 197 diff = ktime_to_us(ktime_sub(t2, t1));