From: gregkh@linuxfoundation.org (Greg Kroah-Hartman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 8/9] serial: 8250: add acpi_match
Date: Fri, 12 Feb 2016 10:56:33 -0800 [thread overview]
Message-ID: <20160212185633.GC10095@kroah.com> (raw)
In-Reply-To: <1455299022-11641-9-git-send-email-aleksey.makarov@linaro.org>
On Fri, Feb 12, 2016 at 08:43:39PM +0300, Aleksey Makarov wrote:
> From: Mark Salter <msalter@redhat.com>
>
> Add an implementation of acpi_match() to the 8250 driver.
> It allows console to check if it matches the console specified by
> ACPI SPCR table.
>
> Signed-off-by: Mark Salter <msalter@redhat.com>
> Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
> ---
> drivers/tty/serial/8250/8250_core.c | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
> index 7775221..059338a 100644
> --- a/drivers/tty/serial/8250/8250_core.c
> +++ b/drivers/tty/serial/8250/8250_core.c
> @@ -40,6 +40,7 @@
> #ifdef CONFIG_SPARC
> #include <linux/sunserialcore.h>
> #endif
> +#include <linux/acpi.h>
>
> #include <asm/irq.h>
>
> @@ -669,12 +670,34 @@ static int univ8250_console_match(struct console *co, char *name, int idx,
> return -ENODEV;
> }
>
> +static int __init univ8250_console_acpi_match(struct console *co,
> + struct acpi_table_spcr *spcr)
> +{
> + int index = co->index >= 0 ? co->index : 0;
> + struct uart_port *port = &serial8250_ports[index].port;
> +
> + if (spcr->interface_type != ACPI_DBG2_16550_SUBSET &&
> + spcr->interface_type != ACPI_DBG2_16550_COMPATIBLE)
> + return -ENODEV;
> +
> + if (spcr->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY &&
> + spcr->serial_port.address == (u64)port->mapbase)
> + return 0;
> +
> + if (spcr->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_IO &&
> + spcr->serial_port.address == (u64)port->iobase)
> + return 0;
> +
> + return -ENODEV;
> +}
Ick, I don't like this, you are doing almost the same thing that
univ8250_console_match does, yet you have to know the internals of the
acpi_table_spcr structure, which is insane (again, do you want to do
this for every firmware type?)
Isn't this something that resources are supposed to handle for us? What
happened to getting this type of information from the firmware in a
non-firmware-specific way to pass to the drivers? Please work on that
instead, then you don't have to modify each and every single driver you
want to work with your system, they will all "just work" automagically.
Please redo this series, as it is, I don't like it at all.
thanks,
greg k-h
next prev parent reply other threads:[~2016-02-12 18:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-12 17:43 [PATCH v2 0/9] ACPI: parse the SPCR table Aleksey Makarov
2016-02-12 17:43 ` [PATCH v2 1/9] printk: fix name and type of some variables Aleksey Makarov
2016-02-12 17:43 ` [PATCH v2 2/9] ACPI: Change __init to __ref for early_acpi_os_unmap_memory() Aleksey Makarov
2016-02-12 17:43 ` [PATCH v2 3/9] ACPI: introduce acpi_table_parse2() Aleksey Makarov
2016-02-12 18:44 ` kbuild test robot
2016-02-12 18:51 ` Greg Kroah-Hartman
2016-02-12 23:08 ` Rafael J. Wysocki
2016-02-15 12:57 ` Aleksey Makarov
2016-02-12 23:07 ` Rafael J. Wysocki
2016-02-15 12:51 ` Aleksey Makarov
2016-02-12 17:43 ` [PATCH v2 4/9] ACPI: parse SPCR and enable matching console Aleksey Makarov
2016-02-12 18:53 ` Greg Kroah-Hartman
2016-02-12 17:43 ` [PATCH v2 5/9] ACPI: enable ACPI_SPCR_TABLE on ARM64 Aleksey Makarov
2016-02-12 17:43 ` [PATCH v2 6/9] ACPI: add definition of DBG2 subtypes Aleksey Makarov
2016-02-12 22:47 ` Moore, Robert
2016-02-12 17:43 ` [PATCH v2 7/9] serial: pl011: add acpi_match Aleksey Makarov
2016-02-12 17:43 ` [PATCH v2 8/9] serial: 8250: " Aleksey Makarov
2016-02-12 18:56 ` Greg Kroah-Hartman [this message]
2016-02-12 17:43 ` [PATCH v2 9/9] serial: pl011: use SPCR to setup 32-bit access Aleksey Makarov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160212185633.GC10095@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).