summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-07-08 12:26:52 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-07-08 12:36:29 +1000
commit1ed95354a04b668e9e49c9542f194a5047bf3f26 (patch)
treefe1295d57c598b672f287261aa0f151a50561872 /core
parente6596b210b86c4d46395299ca27c380be9781693 (diff)
downloadtalos-skiboot-1ed95354a04b668e9e49c9542f194a5047bf3f26.tar.gz
talos-skiboot-1ed95354a04b668e9e49c9542f194a5047bf3f26.zip
opal: Add a debug helper to check for poller recursion
And check & warn inside opal_run_pollers() as well Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'core')
-rw-r--r--core/opal.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/core/opal.c b/core/opal.c
index 0d85c5f7..e582eebf 100644
--- a/core/opal.c
+++ b/core/opal.c
@@ -212,10 +212,30 @@ void opal_del_poller(void (*poller)(void *data))
unlock(&opal_poll_lock);
}
-void opal_run_pollers(void)
+bool __opal_check_poll_recursion(const char *caller)
+{
+ if (!lock_held_by_me(&opal_poll_lock))
+ return false;
+ prerror("OPAL: poller recursion caught in %s !\n", caller);
+ backtrace();
+
+ return true;
+}
+
+void __opal_run_pollers(const char *caller)
{
struct opal_poll_entry *poll_ent;
+ /* Debug path. Warn if we recursed */
+ if (__opal_check_poll_recursion(caller)) {
+ /* This shouldn't happen. However, if it does, we are goin
+ * to end up warning a *LOT* so let's introduce an arbitrary
+ * delay here.
+ */
+ time_wait_ms_nopoll(10);
+ return;
+ }
+
/*
* Only run the pollers if they aren't already running
* on another CPU and we aren't re-entering.
OpenPOWER on IntegriCloud