From patchwork Tue Aug 11 00:31:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hurley X-Patchwork-Id: 6987101 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 DD2DEC05AC for ; Tue, 11 Aug 2015 00:35:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E6325205FA for ; Tue, 11 Aug 2015 00:35:42 +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 AFD40205FC for ; Tue, 11 Aug 2015 00:35:41 +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 1ZOxTX-00056J-0z; Tue, 11 Aug 2015 00:31:31 +0000 Received: from mail-qg0-f43.google.com ([209.85.192.43]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZOxTT-000552-FL for linux-arm-kernel@lists.infradead.org; Tue, 11 Aug 2015 00:31:28 +0000 Received: by qgj62 with SMTP id 62so104562499qgj.2 for ; Mon, 10 Aug 2015 17:31:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=WCOCFhlSEQIpSklqk7pAaQ5X1ZjidMazchnw6zsN3bc=; b=YAy4r1538IPmqpUMMqjbvGejN5t0BojvzkIk76Wy6qis16kvDuwQuJr1XWLfysSe2T MaIWmAlGmkiIPaVAhwbT6ZrACmZV77DGOyL3pxhy9CWiPemO5T6I/VnHzba/7o+dTvpp pyIpvCPji0jpGr+b4dYkh2OJuN3H9BZz+8YGcKL/FtSXl1YQWUkFoYp9o7EyMAVrXVEY kpoaUc4z2GZpdCRPapZV/ta2gs6QuhR7Q/VQoCAGYmauz4cR79rmU7Mt7G8eLQwWHPXU /j88Ny7DcCc6dfgTQnjRcQi6IOGx1Vy7Whsbrp2oeqEkI5eZJAeDa4J4fYqwhg1Tuvmc WmQQ== X-Gm-Message-State: ALoCoQlBR0Ujx/yC+cF2hEpJMs8TDj45kTpDZjGPG4/zp6QcXXZCYW0XQl/9WmfwEbHh9RZczSI3 X-Received: by 10.140.164.136 with SMTP id k130mr45592194qhk.40.1439253065176; Mon, 10 Aug 2015 17:31:05 -0700 (PDT) Received: from [192.168.1.139] (h69-21-74-195.cntcnh.broadband.dynamic.tds.net. [69.21.74.195]) by smtp.gmail.com with ESMTPSA id f106sm142589qgd.30.2015.08.10.17.31.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 17:31:04 -0700 (PDT) Message-ID: <55C94247.8020701@hurleysoftware.com> Date: Mon, 10 Aug 2015 20:31:03 -0400 From: Peter Hurley User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Leif Lindholm , jun.nie@linaro.org Subject: Re: earlycon issues in -next with amba-pl011 updates References: <20150810232312.GB10728@bivouac.eciton.net> In-Reply-To: <20150810232312.GB10728@bivouac.eciton.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150810_173127_594464_BE81A0FE X-CRM114-Status: GOOD ( 22.04 ) 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: tyler.baker@linaro.org, linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.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 Leif, On 08/10/2015 07:23 PM, Leif Lindholm wrote: > 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. Thanks for the bug report and bisect, and apologies for the breakage; I should have caught that on review. Would you please test the patch below and see if that resolves the problem for you? Regards, Peter Hurley PS - _NOT_ even compile-tested, sorry. --- >% --- Subject: [PATCH] serial: pl011: Fix earlycon register LUT breakage Commit 7b753f318d14 ("uart: pl011: Introduce register accessor") mistakenly used the register LUT i/o accessors for the pl011 earlycon. Since the port has not been probed at earlycon time, the struct uart_amba_port (and register LUTs) are uninitialized. Use direct register addressing for pl011 earlycon; other h/w supported by the amba-pl011 driver should declare an alternate earlycon. Cc: Jun Nie Signed-off-by: Peter Hurley --- drivers/tty/serial/amba-pl011.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 2af09ab..fd54991 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2348,13 +2348,10 @@ 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); - - while (pl011_readw(uap, REG_FR) & UART01x_FR_TXFF) + while (readl(port->membase + UART01x_FR) & UART01x_FR_TXFF) ; - pl011_writeb(uap, c, REG_DR); - while (pl011_readw(uap, REG_FR) & uap->fr_busy) + writeb(c, port->membase + UART01x_DR); + while (readl(port->membase + UART01x_FR) & UART01x_FR_BUSY) ; }