From patchwork Mon Aug 10 23:23:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 6986981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 18C6EC05AC for ; Mon, 10 Aug 2015 23:25:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3BDAD20602 for ; Mon, 10 Aug 2015 23:25:35 +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 4C67520603 for ; Mon, 10 Aug 2015 23:25:34 +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 1ZOwPu-0005U1-Ej; Mon, 10 Aug 2015 23:23:42 +0000 Received: from mail-wi0-f178.google.com ([209.85.212.178]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZOwPr-0005Qf-4S for linux-arm-kernel@lists.infradead.org; Mon, 10 Aug 2015 23:23:39 +0000 Received: by wicja10 with SMTP id ja10so54888777wic.1 for ; Mon, 10 Aug 2015 16:23:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=we9Vhg8DY08EWcGSYfNcFgi4Go+F1G+ES55HFYVC9XI=; b=Z4n0DfEy8kozD3xfRF7fmR/ieoHWroDzRnKjkqLP1GkBNQJlI+JmEJbNf/HILnM7j0 Bq8k4fnG8h9E9tMVI7X7gB3SfOQF+WXE2ZdZNhxr4zCxA8VetSn38G1tOvRdbtCzLKVh 6eEjS9y7U5sIl+aWyS3muBGO0who1wcg/p1UMmuUNWbd7xftontdtfcek03pUOAUFCy2 qluhCz71Qo/aVo9A5zzEgAoG0ddbn11v8FQo/+IUBvvB0PJbm7ZM6Y+ImUuh6W5V9W8Y AgXfWE3MkzGxyMPIuveVxU2wVTWp+XRq7wFuUsHtjuDlnUJAKneRtN9NLwu4MOWX6dQe Mq0Q== X-Gm-Message-State: ALoCoQk6MflFUUj2auDTVmyweIz6pW2jPW4DCWT1W/BEfjK2B67zqic8rpwcKY23OG38DlIBqbBN X-Received: by 10.194.84.211 with SMTP id b19mr52447455wjz.120.1439248995625; Mon, 10 Aug 2015 16:23:15 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id nb10sm489716wic.11.2015.08.10.16.23.14 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 10 Aug 2015 16:23:14 -0700 (PDT) Date: Tue, 11 Aug 2015 00:23:12 +0100 From: Leif Lindholm To: linux-serial@vger.kernel.org Subject: earlycon issues in -next with amba-pl011 updates Message-ID: <20150810232312.GB10728@bivouac.eciton.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150810_162339_329209_7FF6C9CF X-CRM114-Status: GOOD ( 13.32 ) X-Spam-Score: -2.6 (--) 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: jun.nie@linaro.org, tyler.baker@linaro.org, linux-arm-kernel@lists.infradead.org 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.2 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 Hi all, The kernelci.org bot picked up a complete boot failure (no output past UEFI stub) with next-20150806 and Tyler bisected it down to somewhere in 8cd90e5 uart: pl011: Add support to ZTE ZX296702 uart 09dcc7d uart: pl011: Improve LCRH register access decision 2c096a9 uart: pl011: Introduce register look up table 7b753f3 uart: pl011: Introduce register accessor The issue only appears with earlycon on command line, for pl011 consoles. Some investigation shows that the cause lies with commit 7b753f318d14 ("uart: pl011: Introduce register accessor") and commit 2c096a9eedc6 ("uart: pl011: Introduce register look up table") Specifically, the changes to pl011_putc() are incorrect: The new pl011_ accessors take a (struct uart_amba_port *) input, but pl011_putc() directly uses the incoming (struct uart_port *) for this. Apart from ending up with an unintended/incorrect UART base address, the introduction of the lookup table for register offsets also means the accessors try to dereference (struct uart_amba_port *)->reg_lut. The below is a hack that shows/resolves the issue, but some refactoring of the original patches might be in order. / Leif diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 2af09ab..452dbba 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2348,13 +2348,14 @@ static struct console amba_console = { static void pl011_putc(struct uart_port *port, int c) { - struct uart_amba_port *uap = - container_of(port, struct uart_amba_port, port); + struct uart_amba_port uap; + uap.port = *port; + uap.reg_lut = arm_reg; - while (pl011_readw(uap, REG_FR) & UART01x_FR_TXFF) + while (pl011_readw(&uap, REG_FR) & UART01x_FR_TXFF) ; - pl011_writeb(uap, c, REG_DR); - while (pl011_readw(uap, REG_FR) & uap->fr_busy) + pl011_writeb(&uap, c, REG_DR); + while (pl011_readw(&uap, REG_FR) & UART01x_FR_BUSY) ; }