Re: [PATCH v3] console: Add console=spcr option

From: Thomas Gleixner
Date: Thu Aug 30 2018 - 10:26:19 EST


On Wed, 29 Aug 2018, Prarit Bhargava wrote:
> +
> +void __init arch_console_setup(void)
> +{
> + int ret;
> +
> + ret = acpi_parse_spcr(false, true);
> + if (ret)
> + pr_err(PREFIX "ERROR: SPCR console is not enabled (%d)\n", ret);
> +}

Why does this require yet another arch/weak function?

> /*
> * Set up a console. Called via do_early_param() in init/main.c
> * for each "console=" parameter in the boot command line.
> @@ -2107,6 +2112,11 @@ static int __init console_setup(char *str)
> char *s, *options, *brl_options = NULL;
> int idx;
>
> + if (!strcmp(str, "spcr")) {
> + arch_console_setup();
> + return 1;

And this gets added to everything and the world whether it's
needed/supported or not.

Why can't we simply register the SPCR console as we do with any other
console when it is detected?

If we can't for some real good reason then there is no need to invoke
acpi_parse_spcr() twice. We simply can store the fact that it got selected
and use that information in acpi_boot_init().

Thanks,

tglx