From patchwork Fri Nov 18 05:01:39 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: 696408 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 3tKm894qp5z9syB for ; Fri, 18 Nov 2016 16:02:33 +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="wBJRP6O1"; 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 3tKm893lKSzDvwq for ; Fri, 18 Nov 2016 16:02:33 +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="wBJRP6O1"; 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 3tKm7m1bYkzDvvt for ; Fri, 18 Nov 2016 16:02:12 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="wBJRP6O1"; dkim-atps=neutral Received: by mail-pg0-x241.google.com with SMTP id e9so19145125pgc.1 for ; Thu, 17 Nov 2016 21:02:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DuSsAYq1YzoLYgHH2v70oEAga0PLPnFzwdFvS3guxPs=; b=wBJRP6O1PKDfFijRSOY/6rQFN88Cn94MpU5NzhvAxFW7mQGaXsZ+3DN1MbVcXvcOv8 rliH7mxhAbn64IWSFbrRZhGs9s75cOAKJ0eoVjnKKuwhnrih6TZc6jXXx2hLnLcv07+3 k5zM0UcwrzZ/zHjtkwZyWk70m8az9bhku/GmoclZnquM+5NFojUPAg7b2uAVyFXT5vkz 5pz8EuNY/bWAl/hIy+fYg8pLsRd3bJODGlq8/Q7kMsIRQAEnEJBpxJMOQwc4DMNoiZbm ma9L/B1xUbY36U5kLjbF5qAH2gUq2y66xGdUkfPTJ8hF5HwWAJWkyM1oPzMMZmlNpLIG tzBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DuSsAYq1YzoLYgHH2v70oEAga0PLPnFzwdFvS3guxPs=; b=l054lgdRlH/LR8iphb/9ML6Cd5p6Xd0rW/0b8PnGzWEI1f/RZYhXZEPym28Hd7fH2A uucSJhvcbkKjEYEDfIieRU98tN9jcr8UlQXLgLkn+0UEZkENcblSCWQ4/1tv1enphDmw H4PGJc4gHb6qvsMM0Dx1zhriYiogOhtmvnAl/gcVDegEAUcN6sHm6ehpSqaXMzjJaiJQ rpnB2B+oIt6t7w99rD0IOa0917pokARXOEdBKonpgXsxKwu1s0ON1Se/UvqOHnYENL0J X0Fi+xkuajO9u0OII1jLE15mbTb1/RXdte9fsDtzfJIvWmvL7GoiZrD4oVJiWHICjf+U VJWw== X-Gm-Message-State: ABUngve9X/KRSFxeCvKCQHbtPOAQT7x8PiO1ESVvtRaCZSQ201xwbTIDVm6Iy74LBQ1a1Q== X-Received: by 10.99.168.10 with SMTP id o10mr14965976pgf.105.1479445330403; Thu, 17 Nov 2016 21:02:10 -0800 (PST) Received: from canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id x90sm12613462pfk.73.2016.11.17.21.02.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Nov 2016 21:02:09 -0800 (PST) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Fri, 18 Nov 2016 16:01:39 +1100 Message-Id: <1479445312-12382-2-git-send-email-oohall@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1479445312-12382-1-git-send-email-oohall@gmail.com> References: <1479445312-12382-1-git-send-email-oohall@gmail.com> Subject: [Skiboot] [PATCH 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 --- 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);