Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: wigin zeng <wigin.zeng@dji.com>
Cc: "jirislaby@kernel.org" <jirislaby@kernel.org>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: 答复: [PATCH] serial: 8250: add lock for dma rx
Date: Thu, 9 Dec 2021 09:42:23 +0100	[thread overview]
Message-ID: <YbHBb2uB9JRP0tWc@kroah.com> (raw)
In-Reply-To: <674707a0388c4a3a9bb25676c61e1737@MAIL-MBX-cwP12.dji.com>

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

  reply	other threads:[~2021-12-09  8:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20211209073339.21694-1-wigin.zeng@dji.com>
2021-12-09  7:38 ` [PATCH] serial: 8250: add lock for dma rx Greg KH
2021-12-09  8:15   ` 答复: " wigin zeng
2021-12-09  8:42     ` Greg KH [this message]
2021-12-09  9:08       ` 答复: " wigin zeng
2021-12-09 10:07         ` Greg KH
2021-12-20  5:27           ` 答复: " wigin zeng
2021-12-20  8:54             ` Greg KH
2021-12-20  9:44               ` 答复: " wigin zeng
2021-12-20  9:59                 ` Greg KH
2021-12-20 10:25                   ` 答复: " wigin zeng
2021-12-20 10:40                     ` Greg KH
2021-12-30  4:41                       ` 答复: " wigin zeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YbHBb2uB9JRP0tWc@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=wigin.zeng@dji.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox