From patchwork Sat Sep 5 14:38:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 53153 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by patches.linaro.org (Postfix) with ESMTPS id 38E1020A78 for ; Sat, 5 Sep 2015 14:38:42 +0000 (UTC) Received: by lbbti1 with SMTP id ti1sf14302621lbb.3 for ; Sat, 05 Sep 2015 07:38:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=rZH5IX+l0ReNHzb9JfjkXESF+gZs31Ah60jGWx5Gh40=; b=ghn7RSswVYAKTYgeCUPfPJ22/LKyLJQSnrUpw5OOIisrJKUlBrecim9NvIORfcKAbo xIwiSZHFFVaLHKscmVSzzMiLi9B1mSsjWaaS1Dp7Fu43jpdth2Pslbj+Kur2dPZpnqpm IeWqF3fBdTSVOIPFMhMQDjsnjD+FsK7rmp4Aq0oWmbIdTmL9xodSe9L4CvmVrO4Yf3dk ZjXeMStc2dY3YITumTF6hkDeTegUBjLc+08bi2qfsQG3VB2pu8qOpVsxlXyEgup3H9PV wRKH31dKwiNUbRLCorxF/Mq4H9nmCqhO6U4d8Mhh4MYvonZiY/U1rSCh09pXDVAfADsp edMA== X-Gm-Message-State: ALoCoQn6k/lPxUK+4ew6xBP7F/29NuzEdNfsF16peVM8NvYyrb+HvlVbCthVzAqfYrnkvXOhCdRy X-Received: by 10.112.140.195 with SMTP id ri3mr2546468lbb.22.1441463921078; Sat, 05 Sep 2015 07:38:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.234 with SMTP id jf10ls433154lac.60.gmail; Sat, 05 Sep 2015 07:38:40 -0700 (PDT) X-Received: by 10.112.53.231 with SMTP id e7mr7758952lbp.103.1441463920784; Sat, 05 Sep 2015 07:38:40 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id rd5si5418198lac.9.2015.09.05.07.38.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Sep 2015 07:38:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lamp12 with SMTP id p12so28110979lam.0 for ; Sat, 05 Sep 2015 07:38:40 -0700 (PDT) X-Received: by 10.152.170.230 with SMTP id ap6mr8809445lac.73.1441463920214; Sat, 05 Sep 2015 07:38:40 -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.164.42 with SMTP id yn10csp547191lbb; Sat, 5 Sep 2015 07:38:38 -0700 (PDT) X-Received: by 10.50.72.100 with SMTP id c4mr17139019igv.95.1441463918728; Sat, 05 Sep 2015 07:38:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si10370081pdh.123.2015.09.05.07.38.37; Sat, 05 Sep 2015 07:38:38 -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 S1751193AbbIEOic (ORCPT + 1 other); Sat, 5 Sep 2015 10:38:32 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34898 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751034AbbIEOib (ORCPT ); Sat, 5 Sep 2015 10:38:31 -0400 Received: by pacfv12 with SMTP id fv12so52597995pac.2 for ; Sat, 05 Sep 2015 07:38:31 -0700 (PDT) X-Received: by 10.66.144.165 with SMTP id sn5mr22150674pab.122.1441463911096; Sat, 05 Sep 2015 07:38:31 -0700 (PDT) Received: from localhost.localdomain ([67.198.135.2]) by smtp.gmail.com with ESMTPSA id v8sm6058647pbs.16.2015.09.05.07.38.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 05 Sep 2015 07:38:30 -0700 (PDT) From: Jun Nie To: marc.zyngier@arm.com, leif.lindholm@linaro.org, peter@hurleysoftware.com, linux@arm.linux.org.uk, andre.przywara@arm.com, Andrew.Jackson@arm.com, gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, shawn.guo@linaro.org Cc: jason.liu@linaro.org, wan.zhijun@zte.com.cn, Jun Nie Subject: [PATCH] serial: pl011: Fix earlycon register LUT breakage Date: Sat, 5 Sep 2015 22:38:08 +0800 Message-Id: <1441463888-24339-1-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 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: jun.nie@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.215.53 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: , 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. Signed-off-by: Peter Hurley Signed-off-by: Jun Nie --- drivers/tty/serial/amba-pl011.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 2af09ab..22893d0 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -326,12 +326,6 @@ static void pl011_writew(struct uart_amba_port *uap, int val, int index) writew_relaxed(val, uap->port.membase + uap->reg_lut[index]); } -static void pl011_writeb(struct uart_amba_port *uap, u8 val, int index) -{ - WARN_ON(index > REG_NR); - writeb_relaxed(val, uap->port.membase + uap->reg_lut[index]); -} - /* * Reads up to 256 characters from the FIFO or until it's empty and * inserts them into the TTY layer. Returns the number of characters @@ -2351,10 +2345,10 @@ 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 (readw_relaxed(port->membase + UART01x_FR) & UART01x_FR_TXFF) ; - pl011_writeb(uap, c, REG_DR); - while (pl011_readw(uap, REG_FR) & uap->fr_busy) + writeb_relaxed(c, port->membase + UART01x_DR); + while (readw_relaxed(port->membase + UART01x_FR) & uap->fr_busy) ; }