aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2017-03-15 20:58:52 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-03-16 17:18:01 +1100
commit1d16851e342ffa0d341609a64f7cc991690d092e (patch)
treed07b3cfe3dae1d57ab4d6bedee6cbf1e5abcd226
parent7980f5e49b4e43152b02cb60ba4742b10839c3f4 (diff)
downloadskiboot-1d16851e342ffa0d341609a64f7cc991690d092e.zip
skiboot-1d16851e342ffa0d341609a64f7cc991690d092e.tar.gz
skiboot-1d16851e342ffa0d341609a64f7cc991690d092e.tar.bz2
xive: Fix recursive locking bug in opal_xive_reset()
The re-initialization of the per-CPU data structures must be done without holding the xive lock as it will be taken when needed by the functions being called. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--hw/xive.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/xive.c b/hw/xive.c
index 6553e9b..bb20cb7 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -3838,6 +3838,9 @@ static void xive_reset_one(struct xive *x)
buddy_reset(x->vp_buddy);
#endif
+ /* The rest must not be called with the lock held */
+ unlock(&x->lock);
+
/* Re-configure the CPUs */
for_each_present_cpu(c) {
struct xive_cpu_state *xs = c->xstate;
@@ -3856,8 +3859,6 @@ static void xive_reset_one(struct xive *x)
xive_ipi_init(x, c);
}
}
-
- unlock(&x->lock);
}
static int64_t opal_xive_reset(uint64_t version)