From patchwork Tue Sep 15 05:48:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 11775595 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B03B26CA for ; Tue, 15 Sep 2020 05:50:25 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7F51E206C9 for ; Tue, 15 Sep 2020 05:50:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="yjFJveM3"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="d5fpZWid" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F51E206C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=3DI9YKg2aLU+0K3BcMGPn/kHGItYenXiiG724eMt4Eg=; b=yjFJveM36pqgHs2tJZm5AjroPy MIvesEOoRu7FuvW+MLa6On50oVv6d/yvA19ddn4wf11weut0Xd5YFsuYYHtdhvxKReLuqDjEn/1AF yhIjNVopM55/zqVlXi+C2lo3fHmonZaZEwNBrkADlneKkcxmYYBspKP3tD8KfaGCdNJiw0u9vAf83 BRSqjeiQBuUz5vLvq2W/lMRFizSkK7fjV4Ia4D7TJrmAwTb0vJEmMon+CtWYf3aOsCKwHuz+fPwDx sAzW9mVc8b8cqz6TX+cFy+XhXfoA2ncfQczpKun8Wd5mCD0HVXO+QETEy/89e3zAIYh0Y1GdBp4b1 oqpnApJg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kI3pe-0003De-2n; Tue, 15 Sep 2020 05:48:46 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kI3pb-0003Ct-DM for linux-arm-kernel@lists.infradead.org; Tue, 15 Sep 2020 05:48:44 +0000 Received: by mail-pl1-x636.google.com with SMTP id bg9so755506plb.2 for ; Mon, 14 Sep 2020 22:48:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i6P44y5mpNfyLXR4RrG6FSEEHMj+iy7zvhbL9GfNdpo=; b=d5fpZWid3HK1S3xeIBo+ue3RwJcRvMaqXA2dL6Lr92GKstsooZcdMke7Fq8vsiRI41 Ey17Xc6tNlQNXNx0S2hxaCGnhuY2Y2OnpPjTzRXLub5w0N7X/JxbD8I82KLgzYJxivrl 68MOS1P2Q86+kcaiKUH9xAmW8eP9Z7oTe1e0M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i6P44y5mpNfyLXR4RrG6FSEEHMj+iy7zvhbL9GfNdpo=; b=bfK6mhdkVeE5wdK64aGo0FSUHhkWuTxfptj3Qm5cqaFhLLX6QkkTge4hwoel9ISmx/ wc8G/QBce/MvE7e0ZTOdtUT4SSsF5Zdqn/M5kf4T7oJPXhHA7wH10c/nZn8bXjDz1mHA WkI+GwzIje98HeePQV1QBk5fqvaML/EGFbhZxoQbZdS2jao83OMyR4l1ci3rV8uc2kpb v+dTEyGiupP5mZ02JIY1FAC2fuV7SDiDXhj0oTw3XqQtlaz7bgcIklozjLDCRNyct9o3 hDqUr2rLniXPC7QzteAenCJd2dZV5tZOTsLbaqKsZKWx8DeTiD4dSLZ4pWRdKVaTEIwa tEUA== X-Gm-Message-State: AOAM5337Nx22pcnVaw6DoTVWsCNk2PhXtlYobWOudiYq3ub8d+/uj7g/ lvQjO7aQvwxF1I6b+DjR1HaC7Q== X-Google-Smtp-Source: ABdhPJyBoTpUYRjmNE7S4RH/HZ+Wd5QDHCdP+aOrKbrqlSzxhloY/EzG1bmXclaKkAnFOoA370xwVw== X-Received: by 2002:a17:902:b186:b029:d1:cc21:9a7d with SMTP id s6-20020a170902b186b02900d1cc219a7dmr6444831plr.8.1600148920854; Mon, 14 Sep 2020 22:48:40 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:1a60:24ff:fe89:3e93]) by smtp.gmail.com with ESMTPSA id gn24sm11034935pjb.8.2020.09.14.22.48.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 22:48:40 -0700 (PDT) From: Hsin-Yi Wang To: linux-serial@vger.kernel.org Subject: [PATCH v2 1/2] tty: serial: print earlycon info after match->setup Date: Tue, 15 Sep 2020 13:48:25 +0800 Message-Id: <20200915054825.3289105-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.28.0.618.gf4bc123cb7-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200915_014843_513032_27BD98BA X-CRM114-Status: GOOD ( 14.52 ) X-Spam-Score: -3.2 (---) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-3.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:636 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -3.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eddie Huang , Changqi Hu , Frank Wunderlich , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Serge Semin , Enric Balletbo i Serra , linux-mediatek@lists.infradead.org, Hsin-Yi Wang , Matthias Brugger , Andy Shevchenko , Jiri Slaby , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 8250 devices may modify iotype in their own earlycon setup. For example: 8250_mtk and 8250_uniphier force iotype to be MMIO32. Print earlycon info after match->setup to reflect actual earlycon info. Signed-off-by: Hsin-Yi Wang --- Change: v1->v2: rename function --- drivers/tty/serial/earlycon.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index 2ae9190b64bb9..b70877932d47d 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -56,7 +56,6 @@ static void __init earlycon_init(struct earlycon_device *device, const char *name) { struct console *earlycon = device->con; - struct uart_port *port = &device->port; const char *s; size_t len; @@ -70,6 +69,12 @@ static void __init earlycon_init(struct earlycon_device *device, len = s - name; strlcpy(earlycon->name, name, min(len + 1, sizeof(earlycon->name))); earlycon->data = &early_console_dev; +} + +static void __init earlycon_print_info(struct earlycon_device *device) +{ + struct console *earlycon = device->con; + struct uart_port *port = &device->port; if (port->iotype == UPIO_MEM || port->iotype == UPIO_MEM16 || port->iotype == UPIO_MEM32 || port->iotype == UPIO_MEM32BE) @@ -140,6 +145,7 @@ static int __init register_earlycon(char *buf, const struct earlycon_id *match) earlycon_init(&early_console_dev, match->name); err = match->setup(&early_console_dev, buf); + earlycon_print_info(&early_console_dev); if (err < 0) return err; if (!early_console_dev.con->write) @@ -302,6 +308,7 @@ int __init of_setup_earlycon(const struct earlycon_id *match, } earlycon_init(&early_console_dev, match->name); err = match->setup(&early_console_dev, options); + earlycon_print_info(&early_console_dev); if (err < 0) return err; if (!early_console_dev.con->write)