Linux-Serial Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] serial: cpm_uart: call cpm_muram_init before registering console
@ 2020-02-13 11:43 Rasmus Villemoes
  2020-02-13 11:55 ` Christophe Leroy
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rasmus Villemoes @ 2020-02-13 11:43 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Timur Tabi, Li Yang, Rasmus Villemoes
  Cc: Qiang Zhao, linuxppc-dev, Scott Wood, Christophe Leroy,
	linux-serial, linux-kernel

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>
---

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] serial: cpm_uart: call cpm_muram_init before registering console
  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
  2 siblings, 0 replies; 4+ messages in thread
From: Christophe Leroy @ 2020-02-13 11:55 UTC (permalink / raw)
  To: Rasmus Villemoes, Greg Kroah-Hartman, Jiri Slaby, Timur Tabi, Li Yang
  Cc: Qiang Zhao, linuxppc-dev, Scott Wood, linux-serial, linux-kernel



Le 13/02/2020 à 12:43, Rasmus Villemoes a écrit :
> 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>

Tested-by: Christophe Leroy <christophe.leroy@c-s.fr>

> ---
> 
> 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;
>   }
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] serial: cpm_uart: call cpm_muram_init before registering console
  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
  2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2020-02-13 20:00 UTC (permalink / raw)
  To: Rasmus Villemoes
  Cc: Jiri Slaby, Timur Tabi, Li Yang, Qiang Zhao, linuxppc-dev,
	Scott Wood, Christophe Leroy, linux-serial, linux-kernel

On Thu, Feb 13, 2020 at 12:43:42PM +0100, Rasmus Villemoes wrote:
> 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>
> ---
> 
> Christophe, can I get you to add a formal Tested-by?
> 
> I'm not sure which tree this should go through.

I can take it, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] serial: cpm_uart: call cpm_muram_init before registering console
  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
  2 siblings, 0 replies; 4+ messages in thread
From: Leo Li @ 2020-02-13 21:25 UTC (permalink / raw)
  To: Rasmus Villemoes, Greg Kroah-Hartman, Jiri Slaby, Timur Tabi
  Cc: Qiang Zhao, linuxppc-dev, Scott Wood, Christophe Leroy,
	linux-serial, linux-kernel



> -----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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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