From patchwork Fri Jun 12 07:18:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 483401 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E5296140290 for ; Fri, 12 Jun 2015 17:19:27 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id C00EC1A099D for ; Fri, 12 Jun 2015 17:19:27 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e23smtp03.au.ibm.com (e23smtp03.au.ibm.com [202.81.31.145]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 8FC871A0456 for ; Fri, 12 Jun 2015 17:19:23 +1000 (AEST) Received: from /spool/local by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 12 Jun 2015 17:19:21 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp03.au.ibm.com (202.81.31.209) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 12 Jun 2015 17:19:20 +1000 Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 552B02BB0051 for ; Fri, 12 Jun 2015 17:19:20 +1000 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t5C7JBfq64290930 for ; Fri, 12 Jun 2015 17:19:19 +1000 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t5C7IlaP013405 for ; Fri, 12 Jun 2015 17:18:47 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t5C7Il0S012899; Fri, 12 Jun 2015 17:18:47 +1000 Received: from localhost (unknown [9.192.203.11]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 7DDC6A013E; Fri, 12 Jun 2015 17:18:22 +1000 (AEST) From: Alistair Popple To: skiboot@lists.ozlabs.org Date: Fri, 12 Jun 2015 17:18:20 +1000 Message-Id: <1434093500-11201-1-git-send-email-alistair@popple.id.au> X-Mailer: git-send-email 1.8.3.2 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15061207-0009-0000-0000-0000018C3227 Subject: [Skiboot] [PATCH] Disable bust_locks for general calls of abort() X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Popple MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Currently bust_locks is set to true whenever abort() is called. This was done for the lock debugging code which calls abort() as its last step. If there is a locking error there is a good chance parts of the console code will be deadlocked (for example if it has a lock on the scom bus). However busting locks can cause problems, especially now that flash data is being read in parallel as this uses the LPC bus. Instead of getting a nice error message showing where the code aborted it is likely the message will go missing, or it will be garbled by the flash data. So instead of always busting locks make it so they're only busted if they're suspected of being broken. Signed-off-by: Alistair Popple --- core/lock.c | 2 ++ core/utils.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/lock.c b/core/lock.c index fbf2d87..53cc337 100644 --- a/core/lock.c +++ b/core/lock.c @@ -31,6 +31,8 @@ bool bust_locks = true; static void lock_error(struct lock *l, const char *reason, uint16_t err) { + bust_locks = true; + fprintf(stderr, "LOCK ERROR: %s @%p (state: 0x%016lx)\n", reason, l, l->lock_val); op_display(OP_FATAL, OP_MOD_LOCK, err); diff --git a/core/utils.c b/core/utils.c index 9c94ecc..f340b4f 100644 --- a/core/utils.c +++ b/core/utils.c @@ -38,8 +38,6 @@ void __noreturn _abort(void) for (;;) ; in_abort = true; - bust_locks = true; - op_display(OP_FATAL, OP_MOD_CORE, 0x6666); prlog(PR_EMERG, "Aborting!\n");