From patchwork Wed Dec 21 04:52:31 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: 707645 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 3tk2PX4jwkz9t0q for ; Wed, 21 Dec 2016 15:54:24 +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="g2maAUt/"; 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 3tk2PX3jbXzDwcg for ; Wed, 21 Dec 2016 15:54:24 +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="g2maAUt/"; 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 3tk2Mz3zJhzDwW6 for ; Wed, 21 Dec 2016 15:53:03 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="g2maAUt/"; dkim-atps=neutral Received: by mail-pg0-x241.google.com with SMTP id g1so12991983pgn.0 for ; Tue, 20 Dec 2016 20:53:03 -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=NgDzBPDRq/1tnOkzZq+5MGfM9x1lXB3ZNrV7b7wzAy0=; b=g2maAUt/76tWkRZT/6HyKGLWLBjBp2ah/lyt9U/Ro76v5egsQmzkH8Dlo2shAYtqCP U3V/FyLc+Ss4NNfVKIqVPj0Kp/tXfQqtaxAGMzNC7TZOqPPqi3fiD8SwbutmD07LJqYV Ty9VW7Kz7fAHuSq4EEYn4skQf5Ge3RfAXHlrpCuqtpWEt3Ty3/LxF88T+1fnIpw/Jfk0 YDN5l7/op7N3QQ4g6Fl2dAf3BFKFrIFYJAqa3S5yRW1d+bRervwbXmfSRaoSgusuWAZV zvAGJEIXW5O0XI7IzLeczbcgngbKuGcmJnovfKp2qCpwM7diAA/iqN9s39vpeYUMkbUO YoeA== 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=NgDzBPDRq/1tnOkzZq+5MGfM9x1lXB3ZNrV7b7wzAy0=; b=NUO3z+m5YNbqLHzIAPmGnNTR/UhTaEwODHd5lslxPx49gNtgzIY6ojiU20fBR7WcXL /mt2U/Jgr3IKerwEPcM9jyGbhrm6GK5P3tMpjmdSAFusllV2k6NIhxWlKTfl0yFpo2AQ CFahw8H15hfhtgZdKmst7z9C/4nEMB8Sqoi88LFfe0JBJo8wL7olrpolfCVB4gh2xeft 0s6uAcGgPgzN4iCdVzp578e5Q5zfzHEqfVIOjajeG+RGmxohBZwBiUJPIv35fn2ojUeS XBxyAt1JCgPiSL2/fzsffk7sw0pNu9b64/KleDzHotniAsg8ESosuosD5ihkGUgGj3fW 3k4w== X-Gm-Message-State: AIkVDXJEAu7Wl/FIZZYUo6MhAjK1lUr9XKpYM63kFNvIAfdBcam9bXRpveLG05Tl47DsCg== X-Received: by 10.99.104.68 with SMTP id d65mr4625715pgc.52.1482295981941; Tue, 20 Dec 2016 20:53:01 -0800 (PST) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id 29sm1289001pfo.58.2016.12.20.20.53.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Dec 2016 20:53:01 -0800 (PST) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Wed, 21 Dec 2016 15:52:31 +1100 Message-Id: <1482295952-30060-10-git-send-email-oohall@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482295952-30060-1-git-send-email-oohall@gmail.com> References: <1482295952-30060-1-git-send-email-oohall@gmail.com> Subject: [Skiboot] [PATCH v3 09/10] console: remove con_ops->flush() 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" Flushing the OPAL console is now handled by a driver specific OPAL call handler so this can be removed. Signed-off-by: Oliver O'Halloran Reviewed-by: Andrew Donnellan --- core/console.c | 20 ++++++-------------- hw/lpc-uart.c | 3 --- include/console.h | 1 - 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/core/console.c b/core/console.c index f67524726486..34605c4ed0b7 100644 --- a/core/console.c +++ b/core/console.c @@ -283,28 +283,20 @@ ssize_t read(int fd __unused, void *buf, size_t req_count) return count; } -static int64_t opal_console_flush(int64_t term_number) -{ - if (term_number != 0) - return OPAL_PARAMETER; - - if (con_driver == NULL || con_driver->flush == NULL) - return OPAL_UNSUPPORTED; - - return con_driver->flush(); -} -opal_call(OPAL_CONSOLE_FLUSH, opal_console_flush, 1); - /* Helper function to perform a full synchronous flush */ void console_complete_flush(void) { - int64_t ret = opal_console_flush(0); + /* + * Using term 0 here is a dumb hack that works because the UART + * only has term 0 and the FSP doesn't have an explicit flush method. + */ + int64_t ret = opal_con_driver->flush(0); if (ret == OPAL_UNSUPPORTED || ret == OPAL_PARAMETER) return; while (ret != OPAL_SUCCESS) { - ret = opal_console_flush(0); + ret = opal_con_driver->flush(0); } } diff --git a/hw/lpc-uart.c b/hw/lpc-uart.c index 0b78a7641fdd..17abe0881da5 100644 --- a/hw/lpc-uart.c +++ b/hw/lpc-uart.c @@ -170,11 +170,8 @@ static size_t uart_con_write(const char *buf, size_t len) return written; } -static int64_t uart_con_flush(void); - static struct con_ops uart_con_driver = { .write = uart_con_write, - .flush = uart_con_flush }; /* diff --git a/include/console.h b/include/console.h index 425f35eb06cb..f7cf999db748 100644 --- a/include/console.h +++ b/include/console.h @@ -51,7 +51,6 @@ struct con_ops { size_t (*write)(const char *buf, size_t len); size_t (*read)(char *buf, size_t len); bool (*poll_read)(void); - int64_t (*flush)(void); }; struct opal_con_ops {