From patchwork Tue Dec 20 06:03:44 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: 707333 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 3tjSBN6qJcz9t0w for ; Tue, 20 Dec 2016 17:12:44 +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="G7PhtPER"; 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 3tjSBN5TLBzDwWr for ; Tue, 20 Dec 2016 17:12:44 +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="G7PhtPER"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (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 3tjS0m4bdnzDwTx for ; Tue, 20 Dec 2016 17:04:24 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="G7PhtPER"; dkim-atps=neutral Received: by mail-pg0-x244.google.com with SMTP id b1so10662842pgc.1 for ; Mon, 19 Dec 2016 22:04:24 -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=CEIcWrGi9TsHlaTyd+smlkoSnIggyoK0sUgVjmNkdE4=; b=G7PhtPER3tGOSv0Tsi7PjZBJnjpuPfvRo0f9FJxqwDy3bMbvu0eqqbRPR4/RMyLMck aX9vtRRV/cjoztAIrsSM/OuRrIcVaK5C1hRppKzV4vRn39Y2C930FrkUzR7HLBd/XqXc 5m66gb2QDkP0sRZ1UfO4vajIylA49C6KO32bpZOQiwA78W5JlhOMIiAljdWOXnjpXjCP H+b4hOrXlXFRPgsAgWVDkwF5qEx38GnMxs0PIGf7EXi0wceCb6CU5NXU7amEsPrCb8Ew 87AqzZaY+vteBgUiAWd+IExD6vPs4tQ7n+03rrnnuK507I6WuuKa4gBMwS0n+B3fYPXj PJYA== 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=CEIcWrGi9TsHlaTyd+smlkoSnIggyoK0sUgVjmNkdE4=; b=jOsPsvv8IgkrQiHbXPYXrZvMIoI0JqsUbXNwybv/9GXmSftnG3HSh70VerSFDpUEvK aMc5RwDcM/x0ga/HwGxFgdkH02zmZvyJB6E60uFQqY6Ks/wiseqGXmDQn5Cini1WFU8e BJdW8Ov4lo9UcuZPBHeW0YXeRuXnVUP+erSAHZg16PLv28TPq/OKZ7vLOB8m14G75d7A RTxIAHpxQPvE1Wgmd2/Q2GggI7g7sWk6wXjqh8JLroIvWLRIq6yzafybryBZQPmIzj1H t31vTNVfBzoYgOvbORy3Au/v68BGjhnAqYFQcMxkRiAfkI/kGWVKW44OXZOtJ74XCuI2 BuBw== X-Gm-Message-State: AIkVDXJ4h5QTysSv6CTUm6IIsl2ZDo4sXaWhYJaOHoNt32SZfqYXngYltHaFp6ywUb2CYg== X-Received: by 10.84.217.89 with SMTP id e25mr18360077plj.21.1482213863033; Mon, 19 Dec 2016 22:04:23 -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.04.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Dec 2016 22:04:22 -0800 (PST) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Tue, 20 Dec 2016 17:03:44 +1100 Message-Id: <1482213825-30448-14-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 13/14] 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 --- 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 0800a7d8371d..336de7543e43 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 c2e31ce4b665..53feccb00a95 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 {