linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] serial: sunhv: Initialize lock for non-registered console
@ 2020-04-02 17:20 Andy Shevchenko
  2020-04-02 17:38 ` Greg Kroah-Hartman
  2020-04-04 17:50 ` Anatoly Pugachev
  0 siblings, 2 replies; 5+ messages in thread
From: Andy Shevchenko @ 2020-04-02 17:20 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-serial, sparclinux
  Cc: Andy Shevchenko, Anatoly Pugachev, David Miller

The commit a3cb39d258ef
("serial: core: Allow detach and attach serial device for console")
changed a bit logic behind lock initialization since for most of the console
driver it's supposed to have lock already initialized even if console is not
enabled. However, it's not the case for Sparc HV console.

Initialize lock explicitly in the ->probe().

Note, there is still an open question should or shouldn't not this driver
register console properly.

Fixes: a3cb39d258ef ("serial: core: Allow detach and attach serial device for console")
Reported-by: Anatoly Pugachev <matorola@gmail.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/tty/serial/sunhv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c
index eafada8fb6fa..e35073e93a5b 100644
--- a/drivers/tty/serial/sunhv.c
+++ b/drivers/tty/serial/sunhv.c
@@ -567,6 +567,9 @@ static int hv_probe(struct platform_device *op)
 	sunserial_console_match(&sunhv_console, op->dev.of_node,
 				&sunhv_reg, port->line, false);
 
+	/* We need to initialize lock even for non-registered console */
+	spin_lock_init(&port->lock);
+
 	err = uart_add_one_port(&sunhv_reg, port);
 	if (err)
 		goto out_unregister_driver;
-- 
2.25.1


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

* Re: [PATCH v1] serial: sunhv: Initialize lock for non-registered console
  2020-04-02 17:20 [PATCH v1] serial: sunhv: Initialize lock for non-registered console Andy Shevchenko
@ 2020-04-02 17:38 ` Greg Kroah-Hartman
  2020-04-04 17:50 ` Anatoly Pugachev
  1 sibling, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-02 17:38 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-serial, sparclinux, Anatoly Pugachev, David Miller

On Thu, Apr 02, 2020 at 08:20:26PM +0300, Andy Shevchenko wrote:
> The commit a3cb39d258ef
> ("serial: core: Allow detach and attach serial device for console")
> changed a bit logic behind lock initialization since for most of the console
> driver it's supposed to have lock already initialized even if console is not
> enabled. However, it's not the case for Sparc HV console.
> 
> Initialize lock explicitly in the ->probe().
> 
> Note, there is still an open question should or shouldn't not this driver
> register console properly.
> 
> Fixes: a3cb39d258ef ("serial: core: Allow detach and attach serial device for console")
> Reported-by: Anatoly Pugachev <matorola@gmail.com>
> Cc: David Miller <davem@davemloft.net>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/tty/serial/sunhv.c | 3 +++
>  1 file changed, 3 insertions(+)

Thanks, will pick this up after -rc1 is out.

greg k-h

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

* Re: [PATCH v1] serial: sunhv: Initialize lock for non-registered console
  2020-04-02 17:20 [PATCH v1] serial: sunhv: Initialize lock for non-registered console Andy Shevchenko
  2020-04-02 17:38 ` Greg Kroah-Hartman
@ 2020-04-04 17:50 ` Anatoly Pugachev
  2020-04-06 10:52   ` Andy Shevchenko
  1 sibling, 1 reply; 5+ messages in thread
From: Anatoly Pugachev @ 2020-04-04 17:50 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Greg Kroah-Hartman, linux-serial, Sparc kernel list, David Miller

On Thu, Apr 2, 2020 at 8:20 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> The commit a3cb39d258ef
> ("serial: core: Allow detach and attach serial device for console")
> changed a bit logic behind lock initialization since for most of the console
> driver it's supposed to have lock already initialized even if console is not
> enabled. However, it's not the case for Sparc HV console.
>
> Initialize lock explicitly in the ->probe().
>
> Note, there is still an open question should or shouldn't not this driver
> register console properly.
>
> Fixes: a3cb39d258ef ("serial: core: Allow detach and attach serial device for console")
> Reported-by: Anatoly Pugachev <matorola@gmail.com>
> Cc: David Miller <davem@davemloft.net>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/tty/serial/sunhv.c | 3 +++
>  1 file changed, 3 insertions(+)


fixes issue for me, sorry for the late testing

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

* Re: [PATCH v1] serial: sunhv: Initialize lock for non-registered console
  2020-04-04 17:50 ` Anatoly Pugachev
@ 2020-04-06 10:52   ` Andy Shevchenko
  2020-04-06 10:57     ` Anatoly Pugachev
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2020-04-06 10:52 UTC (permalink / raw)
  To: Anatoly Pugachev
  Cc: Greg Kroah-Hartman, linux-serial, Sparc kernel list, David Miller

On Sat, Apr 04, 2020 at 08:50:56PM +0300, Anatoly Pugachev wrote:
> On Thu, Apr 2, 2020 at 8:20 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > The commit a3cb39d258ef
> > ("serial: core: Allow detach and attach serial device for console")
> > changed a bit logic behind lock initialization since for most of the console
> > driver it's supposed to have lock already initialized even if console is not
> > enabled. However, it's not the case for Sparc HV console.
> >
> > Initialize lock explicitly in the ->probe().
> >
> > Note, there is still an open question should or shouldn't not this driver
> > register console properly.
> >
> > Fixes: a3cb39d258ef ("serial: core: Allow detach and attach serial device for console")
> > Reported-by: Anatoly Pugachev <matorola@gmail.com>
> > Cc: David Miller <davem@davemloft.net>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >  drivers/tty/serial/sunhv.c | 3 +++
> >  1 file changed, 3 insertions(+)
> 
> 
> fixes issue for me, sorry for the late testing

Thank you! Can you formally provide a Tested-by tag?

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1] serial: sunhv: Initialize lock for non-registered console
  2020-04-06 10:52   ` Andy Shevchenko
@ 2020-04-06 10:57     ` Anatoly Pugachev
  0 siblings, 0 replies; 5+ messages in thread
From: Anatoly Pugachev @ 2020-04-06 10:57 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Greg Kroah-Hartman, linux-serial, Sparc kernel list, David Miller

On Mon, Apr 6, 2020 at 1:52 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> >
> > fixes issue for me, sorry for the late testing
>
> Thank you! Can you formally provide a Tested-by tag?

Andy,

up to you actually to add needed tags. Thanks.

But anyway,

Tested-by: Anatoly Pugachev <matorola@gmail.com>

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

end of thread, other threads:[~2020-04-06 10:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02 17:20 [PATCH v1] serial: sunhv: Initialize lock for non-registered console Andy Shevchenko
2020-04-02 17:38 ` Greg Kroah-Hartman
2020-04-04 17:50 ` Anatoly Pugachev
2020-04-06 10:52   ` Andy Shevchenko
2020-04-06 10:57     ` Anatoly Pugachev

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