mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Francesco Dolcini <francesco.dolcini@toradex.com>
Cc: Jiri Slaby <jirislaby@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Stefan Agner <stefan@agner.ch>,
	linux-serial@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] serial: imx: fix crash when un/re-binding console
Date: Thu, 14 Oct 2021 09:33:55 +0200	[thread overview]
Message-ID: <YWfdY/ws353nJEiE@kroah.com> (raw)
In-Reply-To: <20211014071053.568598-2-francesco.dolcini@toradex.com>

On Thu, Oct 14, 2021 at 09:10:52AM +0200, Francesco Dolcini wrote:
> From: Stefan Agner <stefan@agner.ch>
> 
> If the device used as a serial console gets un/re-binded, then
> register_console() will call imx_uart_setup_console() again.
> Drop __init so that imx_uart_setup_console() can be safely called
> at runtime.
> 
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
>  drivers/tty/serial/imx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

What commit does this "fix"?  Should this go to stable kernels?  If so,
how far back?

> 
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index 8b121cd869e9..51a9f9423b1a 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -2017,7 +2017,7 @@ imx_uart_console_write(struct console *co, const char *s, unsigned int count)
>   * If the port was already initialised (eg, by a boot loader),
>   * try to determine the current setup.
>   */
> -static void __init
> +static void
>  imx_uart_console_get_options(struct imx_port *sport, int *baud,
>  			     int *parity, int *bits)
>  {
> @@ -2076,7 +2076,7 @@ imx_uart_console_get_options(struct imx_port *sport, int *baud,
>  	}
>  }
>  
> -static int __init
> +static int
>  imx_uart_console_setup(struct console *co, char *options)

Why didn't we get a build warning about this section being called by
code that was not thrown away?  That feels odd...

thanks,

greg k-h

  reply	other threads:[~2021-10-14  7:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14  7:10 Francesco Dolcini
2021-10-14  7:10 ` [PATCH 1/2] serial: imx: fix crash when un/re-binding console Francesco Dolcini
2021-10-14  7:33   ` Greg Kroah-Hartman [this message]
2021-10-14  8:01     ` Francesco Dolcini
2021-10-14  8:10       ` Uwe Kleine-König
2021-10-14  9:12         ` Francesco Dolcini
2021-10-14 10:28       ` Francesco Dolcini
2021-10-14  7:10 ` [PATCH 2/2] serial: imx: disable console clocks on unregister Francesco Dolcini
2021-10-14  7:17 ` [PATCH 0/2] serial: imx: fix unbind/bind console Francesco Dolcini

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=YWfdY/ws353nJEiE@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=festevam@gmail.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=jirislaby@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=stefan@agner.ch \
    /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

all inboxes | Powered by JetHome®