From patchwork Wed Mar 15 09:58:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 739084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vjnH94hcxz9s2s for ; Wed, 15 Mar 2017 21:03:17 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vjnH92wvxzDqYt for ; Wed, 15 Mar 2017 21:03:17 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vjnGn5TDtzDqYL for ; Wed, 15 Mar 2017 21:02:57 +1100 (AEDT) Received: from pasglop.au.ibm.com (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id v2F9x7Mc010085; Wed, 15 Mar 2017 04:59:17 -0500 From: Benjamin Herrenschmidt To: skiboot@lists.ozlabs.org Date: Wed, 15 Mar 2017 20:58:52 +1100 Message-Id: <20170315095900.13962-3-benh@kernel.crashing.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170315095900.13962-1-benh@kernel.crashing.org> References: <20170315095900.13962-1-benh@kernel.crashing.org> Subject: [Skiboot] [PATCH 03/11] xive: Fix recursive locking bug in opal_xive_reset() X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 --- hw/xive.c | 5 +++-- 1 file 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)