From: Mark Rutland <mark.rutland@arm.com>
To: Leif Lindholm <leif.lindholm@linaro.org>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"al.stone@linaro.org" <al.stone@linaro.org>,
"torez@redhat.com" <torez@redhat.com>,
"jcm@redhat.com" <jcm@redhat.com>,
"graeme.gregory@linaro.org" <graeme.gregory@linaro.org>,
"linaro-acpi@lists.linaro.org" <linaro-acpi@lists.linaro.org>,
"lv.zheng@intel.com" <lv.zheng@intel.com>
Subject: Re: [RFC 3/5] acpi/serial: add DBG2 earlycon support
Date: Tue, 8 Sep 2015 14:09:51 +0100 [thread overview]
Message-ID: <20150908130951.GE20562@leverpostej> (raw)
In-Reply-To: <1441716217-23786-4-git-send-email-leif.lindholm@linaro.org>
On Tue, Sep 08, 2015 at 01:43:35PM +0100, Leif Lindholm wrote:
> The ACPI DBG2 table defines a debug console. Add support for parsing it
> and using it to select earlycon destination when no arguments provided.
>
> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
[...]
> diff --git a/drivers/acpi/console.c b/drivers/acpi/console.c
> new file mode 100644
> index 0000000..a985890
> --- /dev/null
> +++ b/drivers/acpi/console.c
> @@ -0,0 +1,103 @@
> +/*
> + * Copyright (c) 2012, Intel Corporation
> + * Copyright (c) 2015, Linaro Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +
> +#define DEBUG
Why?
> +#define pr_fmt(fmt) "ACPI: " KBUILD_MODNAME ": " fmt
> +
> +#include <linux/acpi.h>
> +#include <linux/kernel.h>
> +#include <linux/serial_core.h>
> +
> +#define NUM_ELEMS(x) (sizeof(x) / sizeof(*x))
Use ARRAY_SIZE (from kernel.h).
> +
> +#ifdef CONFIG_SERIAL_EARLYCON
> +static int use_earlycon __initdata;
> +static int __init setup_acpi_earlycon(char *buf)
> +{
> + if (!buf)
> + use_earlycon = 1;
> +
> + return 0;
> +}
> +early_param("earlycon", setup_acpi_earlycon);
It seems a shame to add this after folding the OF case into the earlycon
code. What necessitates this being a separate early_param? Why is it too
early to parse DBG2?
[...]
> diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> index 2bda09a..c063cbb 100644
> --- a/drivers/tty/serial/earlycon.c
> +++ b/drivers/tty/serial/earlycon.c
> @@ -13,6 +13,7 @@
>
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> +#include <linux/acpi.h>
> #include <linux/console.h>
> #include <linux/kernel.h>
> #include <linux/init.h>
> @@ -184,12 +185,16 @@ static int __init param_setup_earlycon(char *buf)
> int err;
>
> /*
> - * Just 'earlycon' is a valid param for devicetree earlycons;
> - * don't generate a warning from parse_early_params() in that case
> + * Just 'earlycon' is a valid param for devicetree or ACPI earlycons;
> + * ACPI cannot be parsed yet, so return without action if enabled.
> + * Otherwise, attempt initialization using DT.
> */
> - if (!buf || !buf[0])
> - if (IS_ENABLED(CONFIG_OF_FLATTREE))
> + if (!buf || !buf[0]) {
> + if (!acpi_disabled)
> + return 0;
> + else if (IS_ENABLED(CONFIG_OF_FLATTREE))
> return early_init_dt_scan_chosen_serial();
> + }
It would be much nicer if we could handle the ACPI earlycon parsing in
the same place. As above, I assume I'm missing something that prevents
that.
Mark.
next prev parent reply other threads:[~2015-09-08 13:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-08 12:43 [RFC 0/5] console/acpi: add DBG2 and SPCR console configuration Leif Lindholm
2015-09-08 12:43 ` [RFC 1/5] arm64: move acpi/dt decision earlier in boot process Leif Lindholm
2015-09-08 12:43 ` [RFC 2/5] of/serial: move earlycon early_param handling to serial Leif Lindholm
[not found] ` <1441716217-23786-3-git-send-email-leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-09-08 12:52 ` Mark Rutland
2015-09-08 16:45 ` Leif Lindholm
2015-09-08 12:43 ` [RFC 3/5] acpi/serial: add DBG2 earlycon support Leif Lindholm
2015-09-08 13:09 ` Mark Rutland [this message]
2015-09-08 17:03 ` Leif Lindholm
2015-09-09 9:36 ` Mark Rutland
2015-09-08 16:38 ` [Linaro-acpi] " Mark Salter
2015-09-08 17:17 ` Leif Lindholm
[not found] ` <20150908171744.GQ10728-t77nlHhSwNqAroYi2ySoxKxOck334EZe@public.gmane.org>
2015-09-08 17:40 ` Mark Salter
2015-09-08 17:53 ` Mark Salter
2015-09-08 12:43 ` [RFC 4/5] tty/console: use SPCR table to define console Leif Lindholm
2015-09-10 15:28 ` [Linaro-acpi] " Mark Salter
[not found] ` <1441716217-23786-1-git-send-email-leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-09-08 12:43 ` [RFC 5/5] HACK: serial: move pl011 initcall to device_initcall Leif Lindholm
2015-09-08 12:56 ` Mark Rutland
2015-09-08 16:55 ` Leif Lindholm
2015-09-23 7:38 ` [RFC 0/5] console/acpi: add DBG2 and SPCR console configuration Ming Lei
2015-09-23 15:45 ` G Gregory
2016-01-12 15:14 ` Christopher Covington
2016-01-13 0:07 ` Al Stone
-- strict thread matches above, loose matches on Subject: below --
2015-09-11 5:43 [RFC 3/5] acpi/serial: add DBG2 earlycon support Rob Herring
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=20150908130951.GE20562@leverpostej \
--to=mark.rutland@arm.com \
--cc=al.stone@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=graeme.gregory@linaro.org \
--cc=jcm@redhat.com \
--cc=leif.lindholm@linaro.org \
--cc=linaro-acpi@lists.linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=lv.zheng@intel.com \
--cc=torez@redhat.com \
/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).