From patchwork Sat Sep 17 06:14:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 76438 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp31139qgf; Fri, 16 Sep 2016 23:15:02 -0700 (PDT) X-Received: by 10.98.193.193 with SMTP id i184mr22222146pfg.69.1474092902383; Fri, 16 Sep 2016 23:15:02 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m187si9284051pfb.130.2016.09.16.23.15.02; Fri, 16 Sep 2016 23:15:02 -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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752001AbcIQGPA (ORCPT + 2 others); Sat, 17 Sep 2016 02:15:00 -0400 Received: from mail.kernel.org ([198.145.29.136]:59062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751702AbcIQGPA (ORCPT ); Sat, 17 Sep 2016 02:15:00 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8EFB9206AD; Sat, 17 Sep 2016 06:14:58 +0000 (UTC) Received: from localhost.localdomain (unknown [85.203.21.88]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 33D67206B1; Sat, 17 Sep 2016 06:14:55 +0000 (UTC) From: Shawn Guo To: Greg Kroah-Hartman Cc: Sudeep Holla , Russell King - ARM Linux , Timur Tabi , Peter Hurley , Andre Przywara , Jun Nie , Jason Liu , xie.baoyou@zte.com.cn, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Shawn Guo Subject: [PATCH] tty: amba-pl011: uart_amba_port is not available with earlycon function Date: Sat, 17 Sep 2016 14:14:38 +0800 Message-Id: <1474092878-30034-1-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.9.1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=ham 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 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit 0e125a5facf8 ("tty: amba-pl011: define flag register bits for ZTE device") changes earlycon function pl011_putc() to use a pointer to uart_amba_port. This causes a regression when earlycon is enabled, because uart_amba_port is not available yet at earlycon time. Let's revert the change on pl011_putc() to fix the regression. The earlycon support for ZTE device can probably be added later by declaring a new earlycon setup function with a vendor specific compatible. Reported-by: Sudeep Holla Fixes: 0e125a5facf8 ("tty: amba-pl011: define flag register bits for ZTE device") Signed-off-by: Shawn Guo --- drivers/tty/serial/amba-pl011.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Tested-by: Sudeep Holla diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 0b78b04e895e..2d9ffab16ffe 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2330,16 +2330,13 @@ 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 (readl(port->membase + UART01x_FR) & UART01x_FR_TXFF) cpu_relax(); if (port->iotype == UPIO_MEM32) writel(c, port->membase + UART01x_DR); else writeb(c, port->membase + UART01x_DR); - while (readl(port->membase + UART01x_FR) & uap->vendor->fr_busy) + while (readl(port->membase + UART01x_FR) & UART01x_FR_BUSY) cpu_relax(); }