From: Leo Li <leoyang.li@nxp.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>, Timur Tabi <timur@kernel.org>
Cc: Qiang Zhao <qiang.zhao@nxp.com>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
Scott Wood <oss@buserror.net>,
Christophe Leroy <christophe.leroy@c-s.fr>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] serial: cpm_uart: call cpm_muram_init before registering console
Date: Thu, 13 Feb 2020 21:25:13 +0000 [thread overview]
Message-ID: <VE1PR04MB668747A445A3882DCDAE60358F1A0@VE1PR04MB6687.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20200213114342.21712-1-linux@rasmusvillemoes.dk>
> -----Original Message-----
> From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> Sent: Thursday, February 13, 2020 5:44 AM
> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; Jiri Slaby
> <jslaby@suse.com>; Timur Tabi <timur@kernel.org>; Leo Li
> <leoyang.li@nxp.com>; Rasmus Villemoes <linux@rasmusvillemoes.dk>
> Cc: Qiang Zhao <qiang.zhao@nxp.com>; linuxppc-dev@lists.ozlabs.org; Scott
> Wood <oss@buserror.net>; Christophe Leroy <christophe.leroy@c-s.fr>;
> linux-serial@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] serial: cpm_uart: call cpm_muram_init before registering
> console
>
> Christophe reports that powerpc 8xx silently fails to 5.6-rc1. It turns out I was
> wrong about nobody relying on the lazy initialization of the cpm/qe muram in
> commit b6231ea2b3c6 (soc: fsl: qe: drop broken lazy call of
> cpm_muram_init()).
>
> Rather than reinstating the somewhat dubious lazy call (initializing a currently
> held spinlock, and implicitly doing a GFP_KERNEL under that spinlock), make
> sure that cpm_muram_init() is called early enough - I thought the calls from
> the subsys_initcalls were good enough, but when used by console drivers,
> that's obviously not the case. cpm_muram_init() is safe to call twice (there's
> an early return if it is already initialized), so keep the call from cpm_init() - in
> case SERIAL_CPM_CONSOLE=n.
>
> Reported-by: Christophe Leroy <christophe.leroy@c-s.fr>
> Fixes: b6231ea2b3c6 (soc: fsl: qe: drop broken lazy call of cpm_muram_init())
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Li Yang <leoyang.li@nxp.com>
> ---
>
> Christophe, can I get you to add a formal Tested-by?
>
> I'm not sure which tree this should go through.
>
> drivers/tty/serial/cpm_uart/cpm_uart_core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c
> b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
> index 19d5a4cf29a6..d4b81b06e0cb 100644
> --- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c
> +++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
> @@ -1373,6 +1373,7 @@ static struct console cpm_scc_uart_console = {
>
> static int __init cpm_uart_console_init(void) {
> + cpm_muram_init();
> register_console(&cpm_scc_uart_console);
> return 0;
> }
> --
> 2.23.0
prev parent reply other threads:[~2020-02-13 21:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-13 11:43 [PATCH] serial: cpm_uart: call cpm_muram_init before registering console Rasmus Villemoes
2020-02-13 11:55 ` Christophe Leroy
2020-02-13 20:00 ` Greg Kroah-Hartman
2020-02-13 21:25 ` Leo Li [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=VE1PR04MB668747A445A3882DCDAE60358F1A0@VE1PR04MB6687.eurprd04.prod.outlook.com \
--to=leoyang.li@nxp.com \
--cc=christophe.leroy@c-s.fr \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=oss@buserror.net \
--cc=qiang.zhao@nxp.com \
--cc=timur@kernel.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).