Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1963614ima; Thu, 25 Oct 2018 07:39:06 -0700 (PDT) X-Google-Smtp-Source: AJdET5f9Pxgri7+1ydafWnjkDnM0uGJ8NJkCiXUnfxxGyiu82coA0xxHdijaLtOXO68Z/7sJYsXU X-Received: by 2002:a17:902:7142:: with SMTP id u2-v6mr1806120plm.154.1540478346720; Thu, 25 Oct 2018 07:39:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540478346; cv=none; d=google.com; s=arc-20160816; b=EoWZfiMz64c+AO/LJXvcx5TMi38nXNooq6zzBBPJ4KTo76KINeZOD/R/NP5Yj17xj8 CkVP4qXDAmQDo2Se0/0+dujEpctxmLuCPiUR8jGR4CCo1ABBdxo1Wqlz84Mnu3NEj4VK LJVllj8Q/CeouejHAxh7tEc5TDVbE9rlEuq9D/TbA5nySr87NoHnFdR36J1TXU/Fztp6 WRV8Dl9EEJ9tsQKeJb4QHccRyxGRih6acpZvcZATMOP/ZyMmuMrdvQYUGZtHJfsKbDrE fT/qLQgz2iaRtDLJQ06Pprd6rt8AU+09QsLFpkg2waYRIvW+LcBPOiQgcof9sf878oS7 tf2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=7AvcNcLt5cCgr5lsl6KX2Qh3+uMZ+QtPY6lQ3YNPk3c=; b=DutzpO1W5/BU9bHyE7mJ4J83BrwV0cwXFEBD7Ja7WkFTMWQeDfsDX5TbCJ/1aOzw7R ZTs6s0IyzDtayTH1ilMq9NoOpSOfYoFrf5sXN48uZvqVbS4YDR5BAH3snoi5J4KNrpFC 0abI+xG5fE0+XVq6lhmRMtiKoJcAcqRPrLJWpAkFQODPAtjbTm791gv8+VMoyNUR7xuk GOzEHWCvBLgXadsmbyPrddq7wb+mJS+JA3D4e2wc9T/WmBIFBRXuzvTXnvrmKSGZ/Pbv L9LyByKCyvV7sGMoQsYRmqL5sSBAyXg8tR8EBe6K61CM9AI124aLN2ghF29k9f68YX+8 dBvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kGzvCEfz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12-v6si8608939pfd.66.2018.10.25.07.38.11; Thu, 25 Oct 2018 07:39:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kGzvCEfz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727739AbeJYWtf (ORCPT + 99 others); Thu, 25 Oct 2018 18:49:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:58758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728100AbeJYWte (ORCPT ); Thu, 25 Oct 2018 18:49:34 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D9C7920848; Thu, 25 Oct 2018 14:16:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476997; bh=XqxJCNXcKrGaarBOqqNsdvh3F84QXa13zEhkqTfJZG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kGzvCEfzzZ66WEj59H8af3vHjq0oj38/gbNIDUmq/RYrSrDDtjtj1sJVs9ty9zUCn qe7yMPrZejtEi3ppHJy8kSljrebqPJcDE4i1mwATI3GqkKdtHFTcVF5hB6RSss18BQ bUR9VvOs3lQA737Ssnl+eTPm0PVIouQ+v4vy7poA= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sudeep Holla , Russell King , Greg Kroah-Hartman , Jiri Slaby , Peter Hurley , Aleksey Makarov , Sasha Levin Subject: [PATCH AUTOSEL 4.9 91/98] tty: serial: pl011: add ttyAMA for matching pl011 console Date: Thu, 25 Oct 2018 10:14:16 -0400 Message-Id: <20181025141423.213774-91-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141423.213774-1-sashal@kernel.org> References: <20181025141423.213774-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sudeep Holla [ Upstream commit aea9a80ba98a0c9b4de88850260e9fbdcc98360b ] 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 Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/amba-pl011.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 41b0dd67fcce..11fb5464c43a 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2361,7 +2361,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)) -- 2.17.1