From patchwork Tue Dec 20 06:03:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 707320 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 ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tjS7w0QXLz9t0w for ; Tue, 20 Dec 2016 17:10:36 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LOktzr1+"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tjS7v6DFhzDwTH for ; Tue, 20 Dec 2016 17:10:35 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LOktzr1+"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3tjS0K47KVzDwhM for ; Tue, 20 Dec 2016 17:04:01 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LOktzr1+"; dkim-atps=neutral Received: by mail-pg0-x241.google.com with SMTP id b1so10661551pgc.1 for ; Mon, 19 Dec 2016 22:04:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HzTnDzfVF4jNlbGURRTFjRQ/WCD0aYhBgMHM04gHY/U=; b=LOktzr1+hjcWl5mQWgGXk95qAj1wUdw/LhGijavGRYZaw0A1qR/0wdRUxGMAWc81SF +zKjtrS5xT15HjbbViujKFdD309V/lxEZXa4CR60FhjB4t3Nh6CO1Km1T/B1toIZNjE9 T4e7jn302dNi1bRVMSwYxM/RXy+UDEn4R0QaAQ/BO4GcfGa/he1Aw19rORhEGvfAuUEw lhOXsnhtS4G7yX5wECRP+mdFCLTcRHe3tk5TuHSKXV15+llz8IZeolz+rYPjsWeP4fZE fZDzQyDnKc97NAlVoRZJxkaJOKWMKjqHtS/3k0/wLbkcUiIQhZuxR9Dhu+mn1ukQZ/AN oAqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HzTnDzfVF4jNlbGURRTFjRQ/WCD0aYhBgMHM04gHY/U=; b=rslsexGaKJW1vlV08CRCubpmRidau4vCtdXMKOYdN8RlPSYUMHr846edfN9l6dtOTu jkFUseq0oDwtKqqOIwe31RimTZaSlnE9ZfE8vcnwie04p3lNs57zkrocpOv6dE+UU4Y7 5zeU6a5KXlpd69l+QdPRYZzlAoM6E8278Tk+J9RD5NHomABlm5TMyrg1MnzXWvTGHj8b qXEKwBtrCnuGnai0NM9T6k15QujnavZBOzTt9lVQz13uh8VmhhjjEWTHIpqffAhYRc1Y La8dWzMfEdLiBsVEgcmbDM4RnXF5Wn2G6Hdbf+CQzkLpIgbwzeKsSkAgJN7rgCtsD/0J 4Gvw== X-Gm-Message-State: AKaTC01qzT5lTGPOOywo74+nUeLNHdX3/0vsRi5up0pDEhU5IPIToxgGPQC1zDuNVUOYDA== X-Received: by 10.84.213.23 with SMTP id f23mr40090658pli.59.1482213839831; Mon, 19 Dec 2016 22:03:59 -0800 (PST) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id u64sm28213696pgc.39.2016.12.19.22.03.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Dec 2016 22:03:59 -0800 (PST) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Tue, 20 Dec 2016 17:03:32 +1100 Message-Id: <1482213825-30448-2-git-send-email-oohall@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482213825-30448-1-git-send-email-oohall@gmail.com> References: <1482213825-30448-1-git-send-email-oohall@gmail.com> Subject: [Skiboot] [PATCH v2 01/14] console: don't use __flush_to_console() outside console.c 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" There is only one use of this function outside of console.c and that usage is broken. As the name suggests this is an internal function that is only safe when the console lock held is held. flush_console() will aquire the lock for the caller so that should be used instead. Signed-off-by: Oliver O'Halloran Reviewed-by: Andrew Donnellan --- core/console.c | 2 +- hw/fsp/fsp-console.c | 2 +- include/console.h | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/console.c b/core/console.c index f76ed402c48f..0e96bf4593eb 100644 --- a/core/console.c +++ b/core/console.c @@ -114,7 +114,7 @@ void clear_console(void) * Optionally can skip flushing to drivers, leaving messages * just in memory console. */ -bool __flush_console(bool flush_to_drivers) +static bool __flush_console(bool flush_to_drivers) { struct cpu_thread *cpu = this_cpu(); size_t req, len = 0; diff --git a/hw/fsp/fsp-console.c b/hw/fsp/fsp-console.c index 0080d7326f50..46ac28bbd822 100644 --- a/hw/fsp/fsp-console.c +++ b/hw/fsp/fsp-console.c @@ -751,7 +751,7 @@ void fsp_console_poll(void *data __unused) continue; } if (fs->log_port) { - __flush_console(true); + flush_console(); opal_update_pending_evt(fs->irq, 0); } else { #ifdef OPAL_DEBUG_CONSOLE_POLL diff --git a/include/console.h b/include/console.h index 5cb1227e21bd..f88547c7791e 100644 --- a/include/console.h +++ b/include/console.h @@ -59,7 +59,6 @@ extern struct lock con_lock; extern bool dummy_console_enabled(void); extern void force_dummy_console(void); extern bool flush_console(void); -extern bool __flush_console(bool flush_to_drivers); extern void set_console(struct con_ops *driver); extern void console_complete_flush(void);