Linux-Serial Archive on lore.kernel.org
 help / color / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Hsin-Yi Wang <hsinyi@chromium.org>
Cc: "open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Serge Semin <Sergey.Semin@baikalelectronics.ru>,
	Changqi Hu <changqi.hu@mediatek.com>,
	Frank Wunderlich <frank-w@public-files.de>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	"moderated list:ARM/Mediatek SoC support" 
	<linux-mediatek@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Eddie Huang <eddie.huang@mediatek.com>
Subject: Re: [PATCH v2 1/2] tty: serial: print earlycon info after match->setup
Date: Fri, 18 Sep 2020 14:03:11 +0300
Message-ID: <CAHp75VetbOewxfr2weG_WJDQ7hNkmBBnL_A-JZV9iTXT2vd-_Q@mail.gmail.com> (raw)
In-Reply-To: <20200915054825.3289105-1-hsinyi@chromium.org>

On Tue, Sep 15, 2020 at 8:50 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> 8250 devices may modify iotype in their own earlycon setup. For example:
> 8250_mtk and 8250_uniphier force iotype to be MMIO32. Print earlycon info
> after match->setup to reflect actual earlycon info.

Thanks for an update.
I prefer to see some flag that tells user that options were forced by
the kernel itself (something like err > 0 returned from ->setup()),
but I think it's matter of an additional fix. In principle user can
check the command line and / or DT/ACPI vs. dmesg, although it will
require an extra work.

> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> ---
> Change:
> v1->v2: rename function
> ---
>  drivers/tty/serial/earlycon.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> index 2ae9190b64bb9..b70877932d47d 100644
> --- a/drivers/tty/serial/earlycon.c
> +++ b/drivers/tty/serial/earlycon.c
> @@ -56,7 +56,6 @@ static void __init earlycon_init(struct earlycon_device *device,
>                                  const char *name)
>  {
>         struct console *earlycon = device->con;
> -       struct uart_port *port = &device->port;
>         const char *s;
>         size_t len;
>
> @@ -70,6 +69,12 @@ static void __init earlycon_init(struct earlycon_device *device,
>         len = s - name;
>         strlcpy(earlycon->name, name, min(len + 1, sizeof(earlycon->name)));
>         earlycon->data = &early_console_dev;
> +}
> +
> +static void __init earlycon_print_info(struct earlycon_device *device)
> +{
> +       struct console *earlycon = device->con;
> +       struct uart_port *port = &device->port;
>
>         if (port->iotype == UPIO_MEM || port->iotype == UPIO_MEM16 ||
>             port->iotype == UPIO_MEM32 || port->iotype == UPIO_MEM32BE)
> @@ -140,6 +145,7 @@ static int __init register_earlycon(char *buf, const struct earlycon_id *match)
>
>         earlycon_init(&early_console_dev, match->name);
>         err = match->setup(&early_console_dev, buf);
> +       earlycon_print_info(&early_console_dev);
>         if (err < 0)
>                 return err;
>         if (!early_console_dev.con->write)
> @@ -302,6 +308,7 @@ int __init of_setup_earlycon(const struct earlycon_id *match,
>         }
>         earlycon_init(&early_console_dev, match->name);
>         err = match->setup(&early_console_dev, options);
> +       earlycon_print_info(&early_console_dev);
>         if (err < 0)
>                 return err;
>         if (!early_console_dev.con->write)
> --
> 2.28.0.618.gf4bc123cb7-goog
>


-- 
With Best Regards,
Andy Shevchenko

      parent reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15  5:48 Hsin-Yi Wang
2020-09-15  5:48 ` [PATCH v2 2/2] tty: serial: 8250_mtk: set regshift for mmio32 Hsin-Yi Wang
2020-09-18 11:03 ` Andy Shevchenko [this message]

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=CAHp75VetbOewxfr2weG_WJDQ7hNkmBBnL_A-JZV9iTXT2vd-_Q@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=changqi.hu@mediatek.com \
    --cc=eddie.huang@mediatek.com \
    --cc=enric.balletbo@collabora.com \
    --cc=frank-w@public-files.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=hsinyi@chromium.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=matthias.bgg@gmail.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

Linux-Serial Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-serial/0 linux-serial/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-serial linux-serial/ https://lore.kernel.org/linux-serial \
		linux-serial@vger.kernel.org
	public-inbox-index linux-serial

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-serial


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git