public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] init: Don't proxy console= to earlycon
@ 2023-07-08  1:17 Raul E Rangel
  2023-07-09  0:48 ` Andrew Morton
  2023-07-09 23:46 ` Randy Dunlap
  0 siblings, 2 replies; 19+ messages in thread
From: Raul E Rangel @ 2023-07-08  1:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: mario.limonciello, kramasub, Raul E Rangel, Alexander Potapenko,
	Andrew Morton, Ard Biesheuvel, Jason A. Donenfeld, Li Zhe,
	Liam R. Howlett, Mark Rutland, Will Deacon, Wolfram Sang,
	Zhou jie

Right now we are proxying the `console=XXX` command line args to the
param_setup_earlycon. This is done because the following are
equivalent:

    console=uart[8250],mmio,<addr>[,options]
    earlycon=uart[8250],mmio,<addr>[,options]

In addition, when `earlycon=` or just `earlycon` is specified on the
command line, we look at the SPCR table or the DT to extract the device
options.

When `console=` is specified on the command line, it's intention is to
disable the console. Right now since we are proxying the `console=`
flag to the earlycon handler, we enable the earlycon_acpi_spcr_enable
variable when an SPCR table is present. This means that we
inadvertently enable the earlycon.

This change makes it so we only proxy the console= command if it's
value is not empty. This way we can correctly handle both cases.

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
---

 init/main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/init/main.c b/init/main.c
index aa21add5f7c54..f72bf644910c1 100644
--- a/init/main.c
+++ b/init/main.c
@@ -738,8 +738,7 @@ static int __init do_early_param(char *param, char *val,
 	for (p = __setup_start; p < __setup_end; p++) {
 		if ((p->early && parameq(param, p->str)) ||
 		    (strcmp(param, "console") == 0 &&
-		     strcmp(p->str, "earlycon") == 0)
-		) {
+		     strcmp(p->str, "earlycon") == 0 && val && val[0])) {
 			if (p->setup_func(val) != 0)
 				pr_warn("Malformed early option '%s'\n", param);
 		}
-- 
2.41.0.255.g8b1d071c50-goog


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2024-08-22  8:15 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-08  1:17 [PATCH] init: Don't proxy console= to earlycon Raul E Rangel
2023-07-09  0:48 ` Andrew Morton
2023-07-11 18:15   ` Raul Rangel
2023-07-09 23:46 ` Randy Dunlap
2023-07-10  1:15   ` Mario Limonciello
2023-07-10  2:43     ` Randy Dunlap
2023-07-10 15:30       ` Raul Rangel
2023-07-10 15:41         ` Randy Dunlap
2023-07-14 16:38         ` Petr Mladek
2023-07-14 17:21           ` Raul Rangel
2023-07-14 17:24             ` Raul Rangel
2023-07-14 18:35             ` Petr Mladek
2023-07-14 21:42               ` Raul Rangel
2023-07-18  9:50                 ` Petr Mladek
2023-07-28 17:57                   ` Raul Rangel
2024-08-08 17:30                     ` Raul Rangel
2024-08-21 14:38                       ` Petr Mladek
2024-08-21 15:30                         ` Raul Rangel
2024-08-22  8:15                           ` Petr Mladek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox