From patchwork Wed Aug 15 05:10:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 957791 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41qyHv1CzHz9s8k for ; Wed, 15 Aug 2018 15:11:55 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41qyHt5KlmzF1dD for ; Wed, 15 Aug 2018 15:11:54 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=permerror (mailfrom) smtp.mailfrom=kernel.crashing.org (client-ip=63.228.1.57; helo=gate.crashing.org; envelope-from=benh@kernel.crashing.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.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 41qyH13Wv6zF1RN for ; Wed, 15 Aug 2018 15:11:09 +1000 (AEST) Received: from pasglop.ozlabs.ibm.com (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w7F5Aj4r008476; Wed, 15 Aug 2018 00:10:48 -0500 From: Benjamin Herrenschmidt To: skiboot@lists.ozlabs.org Date: Wed, 15 Aug 2018 15:10:36 +1000 Message-Id: <20180815051039.7019-2-benh@kernel.crashing.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180815051039.7019-1-benh@kernel.crashing.org> References: <20180815051039.7019-1-benh@kernel.crashing.org> Subject: [Skiboot] [PATCH 2/5] lock: Increase con_suspend before __try_lock X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.27 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" Otherwise, we might have the lock and hit prlog's inside __try_lock() in the list check (among others) in debug builds. Signed-off-by: Benjamin Herrenschmidt --- core/lock.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/lock.c b/core/lock.c index 4ae3a213..c320f2c3 100644 --- a/core/lock.c +++ b/core/lock.c @@ -193,13 +193,15 @@ bool try_lock_caller(struct lock *l, const char *owner) if (bust_locks) return true; + if (l->in_con_path) + cpu->con_suspend++; if (__try_lock(cpu, l)) { l->owner = owner; - if (l->in_con_path) - cpu->con_suspend++; list_add(&cpu->locks_held, &l->list); return true; } + if (l->in_con_path) + cpu->con_suspend--; return false; }