Thread (9 messages) 9 messages, 3 authors, 2021-10-14

Re: [PATCH 1/2] serial: imx: fix crash when un/re-binding console

From: Francesco Dolcini <hidden>
Date: 2021-10-14 10:28:22
Also in: linux-serial, lkml

On Thu, Oct 14, 2021 at 10:01:53AM +0200, Francesco Dolcini wrote:
Hello Greg,

On Thu, Oct 14, 2021 at 09:33:55AM +0200, Greg Kroah-Hartman wrote:
quoted
On Thu, Oct 14, 2021 at 09:10:52AM +0200, Francesco Dolcini wrote:
quoted
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 <redacted>
---
 drivers/tty/serial/imx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
What commit does this "fix"?
root@colibri-imx6ull-06746657:~# cat /sys/devices/virtual/tty/console/active 
tty1 ttymxc0
root@colibri-imx6ull-06746657:~# echo -n N > /sys/devices/virtual/tty/console/subsystem/ttymxc0/console
root@colibri-imx6ull-06746657:~# echo -n Y > /sys/devices/virtual/tty/console/subsystem/ttymxc0/console

struct console ->setup is called at that time, but imx_uart_console_setup() is gone ...
This specific way I described here to reproduce the issue was introduced with
 a3cb39d258ef serial: core: Allow detach and attach serial device for console

that is kernel 5.9+

(Andy added to to:)

But the original report was about bind/unbind of the uart driver, I guess this is possible since
way more time.
According to the original report from Stefan the issue is the same with unbind/bind of the console,
see https://marc.info/?l=linux-serial&m=154221779312036&w=2.

quoted
Should this go to stable kernels?  If so, how far back?
This is present also in 4.19 kernel, I feel like the issue is there since it is possible to unbind
a console driver (since ever considering the current LTS releases?). I could
investigate this a little bit more.

We have this patch in our kernel branch since 3 years but for some reason we never managed to upstream it.


Francesco
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help