From patchwork Wed Feb 1 15:46:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 93073 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2476567qgi; Wed, 1 Feb 2017 07:46:44 -0800 (PST) X-Received: by 10.84.196.164 with SMTP id l33mr5445590pld.158.1485964004799; Wed, 01 Feb 2017 07:46:44 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n129si14736336pga.28.2017.02.01.07.46.44; Wed, 01 Feb 2017 07:46:44 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751111AbdBAPqo (ORCPT + 2 others); Wed, 1 Feb 2017 10:46:44 -0500 Received: from foss.arm.com ([217.140.101.70]:36552 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750985AbdBAPqn (ORCPT ); Wed, 1 Feb 2017 10:46:43 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C2C79C14; Wed, 1 Feb 2017 07:46:42 -0800 (PST) Received: from e107155-lin.cambridge.arm.com (unknown [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7E4163F242; Wed, 1 Feb 2017 07:46:41 -0800 (PST) From: Sudeep Holla To: linux-serial@vger.kernel.org Cc: Sudeep Holla , linux-kernel@vger.kernel.org, Russell King , Greg Kroah-Hartman , Jiri Slaby , Peter Hurley , Aleksey Makarov Subject: [PATCH] tty: serial: pl011: add ttyAMA for matching pl011 console Date: Wed, 1 Feb 2017 15:46:38 +0000 Message-Id: <1485963998-921-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit c7cef0a84912 ("console: Add extensible console matching") added match() method to struct console which allows the console to perform console command line matching instead of (or in addition to) default console matching (ie., by fixed name and index). Commit ad1696f6f09d ("ACPI: parse SPCR and enable matching console") introduced support for SPCR as matching console. Commit 10879ae5f12e ("serial: pl011: add console matching function") added the match method for pl011 console which checks for the console string to be "pl011" Now on a platform which has both SPCR in the ACPI tables and ttyAMA in the command line, the ttyAMA is chosen as "selected console" but it doesn't pass the matching console method which results in CON_CONSDEV not being set on the "selected console". As a result of that, the bootconsole(SPCR in the above case) is not unregistered and all the beginning boot messages are seen twice. This patch adds "ttyAMA" so that it's considered to match pl011 console. Fixes: 10879ae5f12e ("serial: pl011: add console matching function") Cc: Russell King Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Peter Hurley Cc: Aleksey Makarov Signed-off-by: Sudeep Holla --- drivers/tty/serial/amba-pl011.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 -- 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 diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 963c2e5feedd..533b18d4a587 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2340,7 +2340,7 @@ static int __init pl011_console_match(struct console *co, char *name, int idx, resource_size_t addr; int i; - if (strcmp(name, "pl011") != 0) + if (strcmp(name, "pl011") != 0 || strcmp(name, "ttyAMA") != 0) return -ENODEV; if (uart_parse_earlycon(options, &iotype, &addr, &options))