Thread (7 messages) 7 messages, 3 authors, 2020-05-25

Re: [PATCH v1] serial: imx: Initialize lock for non-registered console

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2020-05-25 15:34:18

On Mon, May 25, 2020 at 04:07:52PM +0200, Greg Kroah-Hartman wrote:
On Mon, May 25, 2020 at 07:01:13AM -0700, Guenter Roeck wrote:
quoted
On 5/25/20 3:59 AM, Andy Shevchenko wrote:
quoted
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 Freescale IMX 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: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
I really wonder if this is the correct fix, especially since it looks like
there are several other drivers which don't call register_console() either
but implement a console device.

Guenter
quoted
---
 drivers/tty/serial/imx.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 986d902fb7fe..6b078e395931 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2404,6 +2404,9 @@ static int imx_uart_probe(struct platform_device *pdev)
 		}
 	}
 
+	/* We need to initialize lock even for non-registered console */
+	spin_lock_init(&sport->port.lock);
Why are we having to do this for all console drivers recently?
Shouldn't the original patch that required this gone through and fixed
up all drivers?

I'm with Guenter here, let's fix them all at once please.
Okay. Do you want series per driver or one for all?


-- 
With Best Regards,
Andy Shevchenko

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help