From patchwork Wed Nov 18 14:41:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 7649821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5F1C99F392 for ; Wed, 18 Nov 2015 14:44:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 91BD8205FA for ; Wed, 18 Nov 2015 14:44:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA78B205F4 for ; Wed, 18 Nov 2015 14:44:42 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zz3wf-0000oz-BD; Wed, 18 Nov 2015 14:42:49 +0000 Received: from ducie-dc1.codethink.co.uk ([185.25.241.215]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zz3wC-0000L8-F1 for linux-arm-kernel@lists.infradead.org; Wed, 18 Nov 2015 14:42:22 +0000 Received: from localhost (localhost [127.0.0.1]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTP id 4D763462681; Wed, 18 Nov 2015 14:41:31 +0000 (GMT) X-Virus-Scanned: Debian amavisd-new at ducie-dc1.codethink.co.uk Received: from ducie-dc1.codethink.co.uk ([127.0.0.1]) by localhost (ducie-dc1.codethink.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uOkDsaV9GRbf; Wed, 18 Nov 2015 14:41:27 +0000 (GMT) Received: from rainbowdash.ducie.codethink.co.uk (rainbowdash.dyn.ducie.codethink.co.uk [10.24.1.119]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPS id D06F346210F; Wed, 18 Nov 2015 14:41:21 +0000 (GMT) Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.86) (envelope-from ) id 1Zz3vF-0007s1-NO; Wed, 18 Nov 2015 14:41:21 +0000 From: Ben Dooks To: edward.cragg@codethink.co.uk Subject: [PATCH 4/9] ARM: meson: serial: ensure console port uart enabled Date: Wed, 18 Nov 2015 14:41:14 +0000 Message-Id: <1447857679-30158-5-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1447857679-30158-1-git-send-email-ben.dooks@codethink.co.uk> References: <1447857679-30158-1-git-send-email-ben.dooks@codethink.co.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151118_064220_818196_E64B8571 X-CRM114-Status: GOOD ( 10.48 ) X-Spam-Score: -2.5 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , linux-meson@googlegroups.com, linux-kernel@codethink.co.uk, Ben Dooks , linux-serial@vger.kernel.org, Jiri Slaby , carlo@caione.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ensure the UART's transmitter is enabled when meson_console_putchar is called. If not, then the console output is corrupt (the hardware seems to try and send /something/ even if the TX is disabled). This fixes corrupt console output on events such as trying to reboot the system since the console tx may be called after drivers shutdown method has been called. Signed-off-by: Ben Dooks Reported-by: Edward Cragg --- --- drivers/tty/serial/meson_uart.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c index 54d1b95..c7bad2b 100644 --- a/drivers/tty/serial/meson_uart.c +++ b/drivers/tty/serial/meson_uart.c @@ -472,6 +472,7 @@ static void meson_serial_console_write(struct console *co, const char *s, struct uart_port *port; unsigned long flags; int locked; + u32 val; port = meson_ports[co->index]; if (!port) @@ -487,6 +488,9 @@ static void meson_serial_console_write(struct console *co, const char *s, locked = 1; } + val = readl(port->membase + AML_UART_CONTROL); + writel(val | AML_UART_TX_EN, port->membase + AML_UART_CONTROL); + uart_console_write(port, s, count, meson_console_putchar); if (locked)