Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1345825
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 1/4] ACPI: parse SPCR and enable matching console |
| Date | 2016-02-29 14:40 +0100 |
| Message-ID | <r7wdm-3Cq-31@gated-at.bofh.it> (permalink) |
| References | <r7uOd-2PD-5@gated-at.bofh.it> <r7uOf-2PD-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Feb 29, 2016 at 2:02 PM, Aleksey Makarov
<aleksey.makarov@linaro.org> wrote:
> 'ARM Server Base Boot Requiremets' [1] mentions SPCR (Serial Port
> Console Redirection Table) [2] as a mandatory ACPI table that
> specifies the configuration of serial console.
>
> Parse this table and check if any registered console match the
> description. If it does, enable that console.
>
> Introduce a new function acpi_console_check(). At the uart port
> registration, this function checks if the ACPI SPCR table specifies
> its argument of type struct uart_port to be a console
> and if so calls add_preferred_console().
> + if (ACPI_FAILURE(status)) {
> + pr_err("could not get the table\n");
Is it worse to have on error level? Is it possible to have firmware
without this table? I think it would be a normal case for non-arm
world.
I'm also not sure if this message useful even on warn level.
> + return -ENOENT;
> + }
> +
> + if (table->header.revision < 2) {
> + err = -EINVAL;
> + pr_err("wrong table version\n");
And this one quite good to have, indeed.
> + * acpi_console_check - Check if uart matches the console specified by SPCR.
> + *
> + * @uport: uart port to check
> + *
Since you use sections, you may add:
+ * Description:
> + * This function checks if the ACPI SPCR table specifies @uport to be a console
> + * and if so calls add_preferred_console()
> + *
> + * Return: a non-error value if the console matches.
> @@ -2654,8 +2655,17 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport)
> spin_lock_init(&uport->lock);
> lockdep_set_class(&uport->lock, &port_lock_key);
> }
> - if (uport->cons && uport->dev)
> - of_console_check(uport->dev->of_node, uport->cons->name, uport->line);
> +
> + /*
> + * Support both open FW and ACPI access to console definitions.
> + * Both of_console_check() and acpi_console_check() will call
> + * add_preferred_console() if a console definition is found.
> + */
> + if (uport->cons && uport->dev) {
> + if (!acpi_console_check(uport))
if (cond1) {
if (cond2) {
...
}
}
is equivalent to
if (cond1 && cond2) {
...
}
> + of_console_check(uport->dev->of_node, uport->cons->name,
> + uport->line);
> + }
--
With Best Regards,
Andy Shevchenko
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 0/4] ACPI: parse the SPCR table Aleksey Makarov <aleksey.makarov@linaro.org> - 2016-02-29 13:10 +0100
[PATCH v4 1/4] ACPI: parse SPCR and enable matching console Aleksey Makarov <aleksey.makarov@linaro.org> - 2016-02-29 13:10 +0100
Re: [PATCH v4 1/4] ACPI: parse SPCR and enable matching console Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-02-29 14:40 +0100
Re: [PATCH v4 1/4] ACPI: parse SPCR and enable matching console Aleksey Makarov <aleksey.makarov@linaro.org> - 2016-02-29 15:00 +0100
[PATCH v4 3/4] ACPI: add definitions of DBG2 subtypes Aleksey Makarov <aleksey.makarov@linaro.org> - 2016-02-29 13:10 +0100
Re: [PATCH v4 0/4] ACPI: parse the SPCR table Peter Hurley <peter@hurleysoftware.com> - 2016-03-01 16:30 +0100
Re: [PATCH v4 0/4] ACPI: parse the SPCR table Peter Hurley <peter@hurleysoftware.com> - 2016-03-01 16:40 +0100
Re: [PATCH v4 0/4] ACPI: parse the SPCR table Aleksey Makarov <amakarov.linux@gmail.com> - 2016-03-03 13:10 +0100
Re: [PATCH v4 0/4] ACPI: parse the SPCR table Peter Hurley <peter@hurleysoftware.com> - 2016-03-03 16:40 +0100
csiph-web