Thread (12 messages) flat view 12 messages, 2 authors, 2021-12-30

Re: 答复: [PATCH] serial: 8250: add lock for dma rx

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2021-12-09 08:42:33
Also in: lkml

A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

On Thu, Dec 09, 2021 at 08:15:00AM +0000, wigin zeng wrote:
We encountered this issue when UART transfer very intensive.
What issue exactly?
DMA irq-thread processed on CPU0 and serial irq-thread executing on CPU1, 
In DMA irq-thread will invoke "tty_insert_filp_string" function to add the rx_buf into tty_buffer.
In serial irq-thread also has chance to access tty_insert_flip_char(in serial8250_rx_chars ) to access tty_buffer.
there is race condition, sometimes will cause panic.
But what data is being accessed at the same time to cause a crash?
How is data being added into the buffer at the same time in two
different places into the same queue?  What userspace programs are
causing this?
We add the spin_lock to sync the tty_buffer operation, and the issue gone after applied the patch.
So all tty buffer accesses need to be protected by your new lock?

thanks,

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