From patchwork Thu Oct 25 14:14:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 149534 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1397705ljp; Thu, 25 Oct 2018 07:16:42 -0700 (PDT) X-Google-Smtp-Source: AJdET5dTeQD0T3RY+9/eII8YEvEeHpGEd4KuUA61TraUxIdGKioF258DF2pH/jb7XmdF8sICMZLF X-Received: by 2002:a17:902:930b:: with SMTP id bc11-v6mr1722141plb.101.1540477002069; Thu, 25 Oct 2018 07:16:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540477002; cv=none; d=google.com; s=arc-20160816; b=V691JzK0OGrJ2Nh5+cUJD/L3lBLeBMXKZW1nvNV8dk1l5oKGbH1Phz/eplu577f2Zl 2vlhvKHYzd5Jy8fcvZ76DoZ70Q6Y3qLZbT9aTff6hBRUZtM2MioFpq8JXJlNfne8JbSR cpjuorHP4qbIIoERDO9hbyyXsy4mqmRUo7auJqoUTagabgb+ocU5GeQq4JtuAUCV6Oj+ 1IcSajOIfhWVQHcheU7j7PTIqJjmHdQmLmQUBeEevD1hZtigleWsJuWnfFuCYeKDO/Gv YmnT+6hcLrGi1eruTmSwquQNkBo2rZEUjYT7l57f6/psFwAyNukxD7k2EjwauLL+c9hK /8Bg== 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 r25-v6si8682509pfk.83.2018.10.25.07.16.41; Thu, 25 Oct 2018 07:16:42 -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 S1729454AbeJYWtf (ORCPT + 32 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(-) -- 2.17.1 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))