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: 52270 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id 2C98322919 for ; Mon, 10 Aug 2015 23:23:23 +0000 (UTC) Received: by labth1 with SMTP id th1sf66494776lab.2 for ; Mon, 10 Aug 2015 16:23:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :mime-version:content-type:content-disposition:user-agent:sender :precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=WoU2lNUYwkh2PcTgtUx4H/MEg1IG3Uv41w3qbeR7smM=; b=DY3rRXA9tWx1tFLzgmMfiKanAPv4R3/oB/zloMuOwOO4nH7vEW0yx47giF1xLVsCUp tBMBPQ9PUZUWfFmCzHv9r3t3lJwa6SofNsoUPvMUDT5ZwGZ6LGZQUgQNs7uF4WuDAjBK I8hcsiRGHjZ6SjFQawTAW3HoOuup+59SdSfJhW1f58ywuXAGpMwVOvNXEjdxs4j5pU5F tInWntLhOwJ4Ihc1Ao3y90d98PCpEcZsvqAlCFIiJN1BYzMHoTijY+B5xnD9hlBNHT61 HHceOruduBZid0S4Xkcli2GoIzIhmYfDZgDvpyYi4f8fRnmVVWHTEik37hPxRcnGbHEd LkMg== X-Gm-Message-State: ALoCoQnJ1ogiWgaT0x0RFqahuxMFaFIrs4LJLCboHNLyVN0iok5JGlTvGbn0gOFFaCsNtuHLlzi7 X-Received: by 10.112.13.200 with SMTP id j8mr7147755lbc.14.1439249001823; Mon, 10 Aug 2015 16:23:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.228 with SMTP id bb4ls709046lab.88.gmail; Mon, 10 Aug 2015 16:23:21 -0700 (PDT) X-Received: by 10.152.27.134 with SMTP id t6mr23294419lag.100.1439249001609; Mon, 10 Aug 2015 16:23:21 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id v12si74165lal.86.2015.08.10.16.23.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 16:23:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lbbsx3 with SMTP id sx3so20052356lbb.0 for ; Mon, 10 Aug 2015 16:23:20 -0700 (PDT) X-Received: by 10.152.88.78 with SMTP id be14mr23010019lab.29.1439249000720; Mon, 10 Aug 2015 16:23:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp2187675lba; Mon, 10 Aug 2015 16:23:19 -0700 (PDT) X-Received: by 10.68.233.228 with SMTP id tz4mr49271560pbc.152.1439248998864; Mon, 10 Aug 2015 16:23:18 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si195518pde.63.2015.08.10.16.23.18; Mon, 10 Aug 2015 16:23:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933339AbbHJXXR (ORCPT + 1 other); Mon, 10 Aug 2015 19:23:17 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:33751 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933302AbbHJXXR (ORCPT ); Mon, 10 Aug 2015 19:23:17 -0400 Received: by wijp15 with SMTP id p15so154380737wij.0 for ; Mon, 10 Aug 2015 16:23:15 -0700 (PDT) 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 Cc: jun.nie@linaro.org, tyler.baker@linaro.org, linux-arm-kernel@lists.infradead.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) Sender: linux-serial-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-serial@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leif.lindholm@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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) ; }