[Skiboot] [PATCH 04/13] Don't run pollers in time_wait() when a lock is held

Benjamin Herrenschmidt benh at kernel.crashing.org
Wed Feb 18 14:57:20 AEDT 2015


Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 core/timebase.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/core/timebase.c b/core/timebase.c
index 9321373..878f66b 100644
--- a/core/timebase.c
+++ b/core/timebase.c
@@ -1,3 +1,4 @@
+
 /* Copyright 2013-2014 IBM Corp.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -40,7 +41,14 @@ static void time_wait_poll(unsigned long duration)
 
 void time_wait(unsigned long duration)
 {
-	if (this_cpu() != boot_cpu)
+	struct cpu_thread *c = this_cpu();
+
+	if (this_cpu()->lock_depth) {
+		time_wait_nopoll(duration);
+		return;
+	}
+
+	if (c != boot_cpu)
 		time_wait_nopoll(duration);
 	else
 		time_wait_poll(duration);
-- 
2.1.0



More information about the Skiboot mailing list