summaryrefslogtreecommitdiffstats
path: root/core/opal.c
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2015-03-12 13:51:42 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-03-19 03:27:14 +1100
commitc3137a50fb71a253e16b56bb92f62591f288552d (patch)
tree590b46aa6c347b969e1d28f918ddd9d005670718 /core/opal.c
parentd2e2c797f95900513eeb4ab5b5f7e0b42753c41e (diff)
downloadblackbird-skiboot-c3137a50fb71a253e16b56bb92f62591f288552d.tar.gz
blackbird-skiboot-c3137a50fb71a253e16b56bb92f62591f288552d.zip
OPAL: Detect recursive poller entry from same CPU
Detect recursive opal poller call from same CPU. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/opal.c')
-rw-r--r--core/opal.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/opal.c b/core/opal.c
index 6fbbdde9..5e96e0a3 100644
--- a/core/opal.c
+++ b/core/opal.c
@@ -285,6 +285,14 @@ void opal_run_pollers(void)
struct opal_poll_entry *poll_ent;
static int pollers_with_lock_warnings = 0;
+ /* Don't re-enter on this CPU */
+ if (this_cpu()->in_poller) {
+ prlog(PR_ERR, "OPAL: Poller recursion detected.\n");
+ backtrace();
+ return;
+ }
+ this_cpu()->in_poller = true;
+
if (this_cpu()->lock_depth && pollers_with_lock_warnings < 64) {
prlog(PR_ERR, "Running pollers with lock held !\n");
backtrace();
@@ -301,6 +309,9 @@ void opal_run_pollers(void)
list_for_each(&opal_pollers, poll_ent, link)
poll_ent->poller(poll_ent->data);
+ /* Disable poller flag */
+ this_cpu()->in_poller = false;
+
/* On debug builds, print max stack usage */
check_stacks();
}
OpenPOWER on IntegriCloud