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>,
	First Light <xiaoguang.chen@dji.com>
Subject: Re: 答复: 答复: [PATCH] serial: 8250: add lock for dma rx
Date: Thu, 9 Dec 2021 11:07:27 +0100	[thread overview]
Message-ID: <YbHVXwdCUCvmZrbS@kroah.com> (raw)
In-Reply-To: <f2150f8a7b7242b48227e30e5550da0b@MAIL-MBX-cwP12.dji.com>

On Thu, Dec 09, 2021 at 09:08:51AM +0000, wigin zeng wrote:
> > What issue exactly?
> The interval of UART input packages is very small(1ms~ 10ms), and some package size larger than configured DMA transfer size.

What do you mean exactly by "package size"?  Isn't it up to the DMA
transfer to do the whole copy?

> > 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?
> Both places will modify tty_port *port->buf.tail (kmalloc operation and write the data/flag into this address)

What is the "second" place here?  Data should only be coming in from the
DMA transfer copy, right?

> >So all tty buffer accesses need to be protected by your new lock?
> New lock only protected the tty_buffer alloc and write operation in serial-tty case. 

You need to document that really well as it does not seem that all
accesses are now protected by this lock.  Only one odd access is, and I
still do not understand how this is happening at the same time now.

Again, what changed recently to cause this to start happening?  Why is
this only showing up now?  What is unique about your system that causes
this and prevents it from happening on any other system?

thanks,

greg k-h

  reply	other threads:[~2021-12-09 10:07 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
2021-12-09  9:08       ` 答复: " wigin zeng
2021-12-09 10:07         ` Greg KH [this message]
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=YbHVXwdCUCvmZrbS@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 \
    --cc=xiaoguang.chen@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