* [PATCH v2] tty: serial: meson: hard LOCKUP on crtscts mode
@ 2023-10-12 13:22 pkrasavin
2023-10-12 13:30 ` Greg Kroah-Hartman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: pkrasavin @ 2023-10-12 13:22 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl
Cc: linux-kernel, linux-serial, linux-arm-kernel, linux-amlogic
There might be hard lockup if we set crtscts mode on port without RTS/CTS configured:
# stty -F /dev/ttyAML6 crtscts; echo 1 > /dev/ttyAML6; echo 2 > /dev/ttyAML6
[ 95.890386] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 95.890857] rcu: 3-...0: (201 ticks this GP) idle=e33c/1/0x4000000000000000 softirq=5844/5846 fqs=4984
[ 95.900212] rcu: (detected by 2, t=21016 jiffies, g=7753, q=296 ncpus=4)
[ 95.906972] Task dump for CPU 3:
[ 95.910178] task:bash state:R running task stack:0 pid:205 ppid:1 flags:0x00000202
[ 95.920059] Call trace:
[ 95.922485] __switch_to+0xe4/0x168
[ 95.925951] 0xffffff8003477508
[ 95.974379] watchdog: Watchdog detected hard LOCKUP on cpu 3
[ 95.974424] Modules linked in: 88x2cs(O) rtc_meson_vrtc
Possible solution would be to not allow to setup crtscts on such port.
Tested on S905X3 based board.
Signed-off-by: Pavel Krasavin <pkrasavin@imaqliq.com>
---
v2: braces for single statement removed according to Dmitry's note
v1: https://lore.kernel.org/lkml/OF28B2B8C9.5BC0CD28-ON00258A46.0037688F-00258A46.0039155B@gdc.ru/
---
--- a/drivers/tty/serial/meson_uart.c 2023-10-12 15:44:02.410538523 +0300
+++ b/drivers/tty/serial/meson_uart.c 2023-10-12 15:58:06.242395253 +0300
@@ -380,10 +380,14 @@ static void meson_uart_set_termios(struc
else
val |= AML_UART_STOP_BIT_1SB;
- if (cflags & CRTSCTS)
- val &= ~AML_UART_TWO_WIRE_EN;
- else
+ if (cflags & CRTSCTS) {
+ if (port->flags & UPF_HARD_FLOW)
+ val &= ~AML_UART_TWO_WIRE_EN;
+ else
+ termios->c_cflag &= ~CRTSCTS;
+ } else {
val |= AML_UART_TWO_WIRE_EN;
+ }
writel(val, port->membase + AML_UART_CONTROL);
@@ -705,6 +709,7 @@ static int meson_uart_probe(struct platf
u32 fifosize = 64; /* Default is 64, 128 for EE UART_0 */
int ret = 0;
int irq;
+ bool has_rtscts;
if (pdev->dev.of_node)
pdev->id = of_alias_get_id(pdev->dev.of_node, "serial");
@@ -732,6 +737,7 @@ static int meson_uart_probe(struct platf
return irq;
of_property_read_u32(pdev->dev.of_node, "fifo-size", &fifosize);
+ has_rtscts = of_property_read_bool(pdev->dev.of_node, "uart-has-rtscts");
if (meson_ports[pdev->id]) {
return dev_err_probe(&pdev->dev, -EBUSY,
@@ -762,6 +768,8 @@ static int meson_uart_probe(struct platf
port->mapsize = resource_size(res_mem);
port->irq = irq;
port->flags = UPF_BOOT_AUTOCONF | UPF_LOW_LATENCY;
+ if (has_rtscts)
+ port->flags |= UPF_HARD_FLOW;
port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_MESON_CONSOLE);
port->dev = &pdev->dev;
port->line = pdev->id;
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] tty: serial: meson: hard LOCKUP on crtscts mode
2023-10-12 13:22 [PATCH v2] tty: serial: meson: hard LOCKUP on crtscts mode pkrasavin
@ 2023-10-12 13:30 ` Greg Kroah-Hartman
2023-10-13 10:43 ` Jiri Slaby
2023-10-13 11:09 ` Pavel Krasavin
2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2023-10-12 13:30 UTC (permalink / raw)
To: pkrasavin
Cc: Jiri Slaby, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, linux-kernel, linux-serial,
linux-arm-kernel, linux-amlogic
On Thu, Oct 12, 2023 at 01:22:41PM +0000, pkrasavin@imaqliq.ru wrote:
> There might be hard lockup if we set crtscts mode on port without RTS/CTS configured:
>
> # stty -F /dev/ttyAML6 crtscts; echo 1 > /dev/ttyAML6; echo 2 > /dev/ttyAML6
> [ 95.890386] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
> [ 95.890857] rcu: 3-...0: (201 ticks this GP) idle=e33c/1/0x4000000000000000 softirq=5844/5846 fqs=4984
> [ 95.900212] rcu: (detected by 2, t=21016 jiffies, g=7753, q=296 ncpus=4)
> [ 95.906972] Task dump for CPU 3:
> [ 95.910178] task:bash state:R running task stack:0 pid:205 ppid:1 flags:0x00000202
> [ 95.920059] Call trace:
> [ 95.922485] __switch_to+0xe4/0x168
> [ 95.925951] 0xffffff8003477508
> [ 95.974379] watchdog: Watchdog detected hard LOCKUP on cpu 3
> [ 95.974424] Modules linked in: 88x2cs(O) rtc_meson_vrtc
>
> Possible solution would be to not allow to setup crtscts on such port.
>
> Tested on S905X3 based board.
>
> Signed-off-by: Pavel Krasavin <pkrasavin@imaqliq.com>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- It looks like you did not use your name for the patch on either the
Signed-off-by: line, or the From: line (both of which have to match).
Please read the kernel file,
Documentation/process/submitting-patches.rst for how to do this
correctly.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] tty: serial: meson: hard LOCKUP on crtscts mode
2023-10-12 13:22 [PATCH v2] tty: serial: meson: hard LOCKUP on crtscts mode pkrasavin
2023-10-12 13:30 ` Greg Kroah-Hartman
@ 2023-10-13 10:43 ` Jiri Slaby
2023-10-13 11:09 ` Pavel Krasavin
2 siblings, 0 replies; 4+ messages in thread
From: Jiri Slaby @ 2023-10-13 10:43 UTC (permalink / raw)
To: pkrasavin, Greg Kroah-Hartman, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl
Cc: linux-kernel, linux-serial, linux-arm-kernel, linux-amlogic
Subject: tty: serial: meson: hard LOCKUP on crtscts mode
Why would you want to add a hard lockup on crtscts mode?
Ah, you are fixing one? So how does this sound:
tty: serial: meson: fix hard LOCKUP on crtscts mode
?
On 12. 10. 23, 15:22, pkrasavin@imaqliq.ru wrote:
> There might be hard lockup if we set crtscts mode on port without RTS/CTS configured:
...
--
js
suse labs
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] tty: serial: meson: hard LOCKUP on crtscts mode
2023-10-12 13:22 [PATCH v2] tty: serial: meson: hard LOCKUP on crtscts mode pkrasavin
2023-10-12 13:30 ` Greg Kroah-Hartman
2023-10-13 10:43 ` Jiri Slaby
@ 2023-10-13 11:09 ` Pavel Krasavin
2 siblings, 0 replies; 4+ messages in thread
From: Pavel Krasavin @ 2023-10-13 11:09 UTC (permalink / raw)
To: Jiri Slaby
Cc: Pavel Krasavin, Greg Kroah-Hartman, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, linux-kernel, linux-serial,
linux-arm-kernel, linux-amlogic
Hello Jiri,
----- "Jiri Slaby" <jirislaby@kernel.org> писал(а): -----
> Subject: tty: serial: meson: hard LOCKUP on crtscts mode
> Ah, you are fixing one? So how does this sound:
> tty: serial: meson: fix hard LOCKUP on crtscts mode
> ?
you are right, idea was to fix it, not to add :)
I agree, your subject looks better!
So, do I need to prepare v4 of this patch, right?
--
Regards,
Pavel.
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-13 11:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-12 13:22 [PATCH v2] tty: serial: meson: hard LOCKUP on crtscts mode pkrasavin
2023-10-12 13:30 ` Greg Kroah-Hartman
2023-10-13 10:43 ` Jiri Slaby
2023-10-13 11:09 ` Pavel Krasavin
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®