linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] tty, serial, 8250: remove __init from function serial8250_console_setup()
@ 2014-11-20 18:00 Arianna Avanzini
  2014-11-25 17:51 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Arianna Avanzini @ 2014-11-20 18:00 UTC (permalink / raw)
  To: gregkh, jslaby, linux-kernel, linux-serial; +Cc: avanzini.arianna

Some RS232 adapters handled by this driver are hotpluggable. The function
serial8250_console_setup() is called during device init and is defined with
the __init macro. In case the driver is built-in, hotplugging the device after
the initialization phase has been completed (and the related memory has been
freed) results in a kernel crash.
This commit fixes the issue by removing __init from the function definition.

Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
---
 drivers/tty/serial/8250/8250_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index ca5cfdc..ca8108d 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -3237,7 +3237,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
 	serial8250_rpm_put(up);
 }
 
-static int __init serial8250_console_setup(struct console *co, char *options)
+static int serial8250_console_setup(struct console *co, char *options)
 {
 	struct uart_port *port;
 	int baud = 9600;
-- 
2.1.3


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

* Re: [PATCH RFC] tty, serial, 8250: remove __init from function serial8250_console_setup()
  2014-11-20 18:00 [PATCH RFC] tty, serial, 8250: remove __init from function serial8250_console_setup() Arianna Avanzini
@ 2014-11-25 17:51 ` Greg KH
  2014-11-25 22:18   ` Arianna Avanzini
  2014-11-25 22:21   ` [PATCH] " Arianna Avanzini
  0 siblings, 2 replies; 6+ messages in thread
From: Greg KH @ 2014-11-25 17:51 UTC (permalink / raw)
  To: Arianna Avanzini; +Cc: jslaby, linux-kernel, linux-serial

On Thu, Nov 20, 2014 at 07:00:56PM +0100, Arianna Avanzini wrote:
> Some RS232 adapters handled by this driver are hotpluggable. The function
> serial8250_console_setup() is called during device init and is defined with
> the __init macro. In case the driver is built-in, hotplugging the device after
> the initialization phase has been completed (and the related memory has been
> freed) results in a kernel crash.
> This commit fixes the issue by removing __init from the function definition.
> 
> Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
> ---
>  drivers/tty/serial/8250/8250_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
> index ca5cfdc..ca8108d 100644
> --- a/drivers/tty/serial/8250/8250_core.c
> +++ b/drivers/tty/serial/8250/8250_core.c
> @@ -3237,7 +3237,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
>  	serial8250_rpm_put(up);
>  }
>  
> -static int __init serial8250_console_setup(struct console *co, char *options)
> +static int serial8250_console_setup(struct console *co, char *options)
>  {
>  	struct uart_port *port;
>  	int baud = 9600;
> -- 
> 2.1.3

I don't apply "RFC" patches as it implies you don't even know if this
works or not.

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

* Re: [PATCH RFC] tty, serial, 8250: remove __init from function serial8250_console_setup()
  2014-11-25 17:51 ` Greg KH
@ 2014-11-25 22:18   ` Arianna Avanzini
  2014-11-25 22:21   ` [PATCH] " Arianna Avanzini
  1 sibling, 0 replies; 6+ messages in thread
From: Arianna Avanzini @ 2014-11-25 22:18 UTC (permalink / raw)
  To: Greg KH; +Cc: jslaby, linux-kernel, linux-serial

On Tue, Nov 25, 2014 at 09:51:21AM -0800, Greg KH wrote:
> On Thu, Nov 20, 2014 at 07:00:56PM +0100, Arianna Avanzini wrote:
> > Some RS232 adapters handled by this driver are hotpluggable. The function
> > serial8250_console_setup() is called during device init and is defined with
> > the __init macro. In case the driver is built-in, hotplugging the device after
> > the initialization phase has been completed (and the related memory has been
> > freed) results in a kernel crash.
> > This commit fixes the issue by removing __init from the function definition.
> > 
> > Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
> > ---
> >  drivers/tty/serial/8250/8250_core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
> > index ca5cfdc..ca8108d 100644
> > --- a/drivers/tty/serial/8250/8250_core.c
> > +++ b/drivers/tty/serial/8250/8250_core.c
> > @@ -3237,7 +3237,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
> >  	serial8250_rpm_put(up);
> >  }
> >  
> > -static int __init serial8250_console_setup(struct console *co, char *options)
> > +static int serial8250_console_setup(struct console *co, char *options)
> >  {
> >  	struct uart_port *port;
> >  	int baud = 9600;
> > -- 
> > 2.1.3
> 
> I don't apply "RFC" patches as it implies you don't even know if this
> works or not.

I was not aware of the fact that the "RFC" tag had such an implication; thank
you for pointing that out. As I have already tested the patch and it appears to
be effective, I'll resend it and drop the "RFC" tag.

Thank you,
Arianna


--
/*
 * Arianna Avanzini
 * avanzini.arianna@gmail.com
 * http://ava.webhop.me
 */

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

* [PATCH] tty, serial, 8250: remove __init from function serial8250_console_setup()
  2014-11-25 17:51 ` Greg KH
  2014-11-25 22:18   ` Arianna Avanzini
@ 2014-11-25 22:21   ` Arianna Avanzini
  2014-11-26 14:25     ` Peter Hurley
  2014-11-26 17:26     ` Greg KH
  1 sibling, 2 replies; 6+ messages in thread
From: Arianna Avanzini @ 2014-11-25 22:21 UTC (permalink / raw)
  To: gregkh, jslaby, linux-kernel, linux-serial; +Cc: avanzini.arianna

Some RS232 adapters handled by this driver are hotpluggable. The function
serial8250_console_setup() is called during device init and is defined with
the __init macro. In case the driver is built-in, hotplugging the device after
the initialization phase has been completed (and the related memory has been
freed) results in a kernel crash.
This commit fixes the issue by removing __init from the function definition.

Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
---
 drivers/tty/serial/8250/8250_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index ca5cfdc..ca8108d 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -3237,7 +3237,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
 	serial8250_rpm_put(up);
 }
 
-static int __init serial8250_console_setup(struct console *co, char *options)
+static int serial8250_console_setup(struct console *co, char *options)
 {
 	struct uart_port *port;
 	int baud = 9600;
-- 
2.1.3


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

* Re: [PATCH] tty, serial, 8250: remove __init from function serial8250_console_setup()
  2014-11-25 22:21   ` [PATCH] " Arianna Avanzini
@ 2014-11-26 14:25     ` Peter Hurley
  2014-11-26 17:26     ` Greg KH
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Hurley @ 2014-11-26 14:25 UTC (permalink / raw)
  To: Arianna Avanzini, gregkh; +Cc: jslaby, linux-kernel, linux-serial

On 11/25/2014 05:21 PM, Arianna Avanzini wrote:
> Some RS232 adapters handled by this driver are hotpluggable. The function
> serial8250_console_setup() is called during device init and is defined with
> the __init macro. In case the driver is built-in, hotplugging the device after
> the initialization phase has been completed (and the related memory has been
> freed) results in a kernel crash.
> This commit fixes the issue by removing __init from the function definition.

Reviewed-by: Peter Hurley <peter@hurleysoftware.com>



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

* Re: [PATCH] tty, serial, 8250: remove __init from function serial8250_console_setup()
  2014-11-25 22:21   ` [PATCH] " Arianna Avanzini
  2014-11-26 14:25     ` Peter Hurley
@ 2014-11-26 17:26     ` Greg KH
  1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2014-11-26 17:26 UTC (permalink / raw)
  To: Arianna Avanzini; +Cc: jslaby, linux-kernel, linux-serial

On Tue, Nov 25, 2014 at 11:21:22PM +0100, Arianna Avanzini wrote:
> Some RS232 adapters handled by this driver are hotpluggable. The function
> serial8250_console_setup() is called during device init and is defined with
> the __init macro. In case the driver is built-in, hotplugging the device after
> the initialization phase has been completed (and the related memory has been
> freed) results in a kernel crash.
> This commit fixes the issue by removing __init from the function definition.
> 
> Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
> ---
>  drivers/tty/serial/8250/8250_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
> index ca5cfdc..ca8108d 100644
> --- a/drivers/tty/serial/8250/8250_core.c
> +++ b/drivers/tty/serial/8250/8250_core.c
> @@ -3237,7 +3237,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
>  	serial8250_rpm_put(up);
>  }
>  
> -static int __init serial8250_console_setup(struct console *co, char *options)
> +static int serial8250_console_setup(struct console *co, char *options)
>  {
>  	struct uart_port *port;
>  	int baud = 9600;
> -- 
> 2.1.3

This has already been in my tree for a long time, always work against
linux-next to avoid redoing work that others have already done.

thanks,

greg k-h

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

end of thread, other threads:[~2014-11-26 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-20 18:00 [PATCH RFC] tty, serial, 8250: remove __init from function serial8250_console_setup() Arianna Avanzini
2014-11-25 17:51 ` Greg KH
2014-11-25 22:18   ` Arianna Avanzini
2014-11-25 22:21   ` [PATCH] " Arianna Avanzini
2014-11-26 14:25     ` Peter Hurley
2014-11-26 17:26     ` Greg KH

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