From patchwork Fri Mar 31 22:05:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timur Tabi X-Patchwork-Id: 9657321 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E400E602BD for ; Fri, 31 Mar 2017 22:07:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D41DA24DA2 for ; Fri, 31 Mar 2017 22:07:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C642327D5E; Fri, 31 Mar 2017 22:07:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5774724DA2 for ; Fri, 31 Mar 2017 22:07:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=h2YfoarwpP0pQmKM4N84m8xuQjTE/QY124z8SdzrU3A=; b=rK3KB/rhiO9S6p gvLUQ3BHYNJj3RL319s6wUYvXx4gnV35QWKenFxkZ5ey3ZFPw1hTWxVL5q00BgKDIFnrXq2vcJOHX UNRd6ZBxrL7Sc0x/fwmuqx6wP1/SPgN3/2oCPfixl4+100366JMQJgTobaCWqKGITT4FWJHvJg50+ C+ZyBvwAeEpUj/Xubiy8TAVr5nz0Foee9pdy3CY3AYgf9ZljyyCNvbUts1MVmi134i9TZs3x1Zv+G aqOFaPqob37cnimAz6WB4+0AP11ynQyfOmKB+vKSCsz4JDNDN5Wvsl5LkFnSkkGX4mrbh6Ck7ZOo2 pEhsSN7OcxQYVXmuryow==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cu4hG-0005L5-71; Fri, 31 Mar 2017 22:07:06 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cu4h8-0005FK-HO for linux-arm-kernel@lists.infradead.org; Fri, 31 Mar 2017 22:07:03 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2ADC26110F; Fri, 31 Mar 2017 22:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1490997998; bh=V793Z3dH/PkS0qL881usyyqD13kB0uvLa8RkV45GIdA=; h=From:To:Subject:Date:From; b=D49mwxhXQ2X6w7M1PDYjjtW/HDkjygNA1s+VDOwEW0PpjZFSBJ6jL8wKWtCZOSKKd NicLxQ6xUfycv4iUvVHyg02BX3SI/h1phsLnHRKb2qoxygWqOnN6VNfZbh/ViU2752 SuG1mTA7YPQeuxtFi6Y4/FZzmGkBTmninzeUPeXU= Received: from timur-ubuntu.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: timur@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id EFAA060FF5; Fri, 31 Mar 2017 22:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1490997996; bh=V793Z3dH/PkS0qL881usyyqD13kB0uvLa8RkV45GIdA=; h=From:To:Subject:Date:From; b=mdi/UDjhFF6CmakHnf8/eAXgenPeDTNPCaXtzTjlFfjfg1GmYowAFj6COFgNNwxzi cyMRacMaQrANzucbbHe0gYPw78NWLb28rs0n9SUdj7Y4X0NyXLwmn8u5Zqi0dybohD jiotBDZodkLkn7XM9f5nJDFh1fm+b151j89o1Qg0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org EFAA060FF5 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=timur@codeaurora.org From: Timur Tabi To: Shanker Donthineni , Christopher Covington , Russell King , Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, yousaf.kaukab@suse.com, agraf@suse.de, mbrugger@suse.com Subject: [PATCH] tty: pl011: fix earlycon work-around for QDF2400 erratum 44 Date: Fri, 31 Mar 2017 17:05:02 -0500 Message-Id: <1490997902-4894-1-git-send-email-timur@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170331_150658_751794_9C80FAC1 X-CRM114-Status: GOOD ( 13.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The work-around for the Qualcomm Datacenter Technologies QDF2400 erratum 44 sets the "qdf2400_e44_present" global variable if the work-around is needed. However, this check does not happen until after earlycon is initialized, which means the work-around is not used, and the console hangs as soon as it displays one character. Fixes: d8a4995bcea1 ("tty: pl011: Work around QDF2400 E44 stuck BUSY bit") Signed-off-by: Timur Tabi --- drivers/tty/serial/amba-pl011.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 56f92d7..b0a3777 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2452,18 +2452,37 @@ static void pl011_early_write(struct console *con, const char *s, unsigned n) uart_console_write(&dev->port, s, n, pl011_putc); } +/* + * On non-ACPI systems, earlycon is enabled by specifying + * "earlycon=pl011,
" on the kernel command line. + * + * On ACPI ARM64 systems, an "early" console is enabled via the SPCR table, + * by specifying only "earlycon" on the command line. Because it requires + * SPCR, the console starts after ACPI is parsed, which is later than a + * traditional early console. + * + * To get the traditional early console that starts before ACPI is parsed, + * specify the full "earlycon=pl011,
" option. + */ static int __init pl011_early_console_setup(struct earlycon_device *device, const char *opt) { if (!device->port.membase) return -ENODEV; - device->con->write = qdf2400_e44_present ? - qdf2400_e44_early_write : pl011_early_write; + /* On QDF2400 SOCs affected by Erratum 44, the "qdf2400_e44" must + * also be specified, e.g. "earlycon=pl011,
,qdf2400_e44". + */ + if (!strcmp(device->options, "qdf2400_e44")) + device->con->write = qdf2400_e44_early_write; + else + device->con->write = pl011_early_write; + return 0; } OF_EARLYCON_DECLARE(pl011, "arm,pl011", pl011_early_console_setup); OF_EARLYCON_DECLARE(pl011, "arm,sbsa-uart", pl011_early_console_setup); +EARLYCON_DECLARE(qdf2400_e44, pl011_early_console_setup); #else #define AMBA_CONSOLE NULL