lkml.org 
[lkml]   [2021]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 答复: 答复: 答 复: 答复: [PATCH] serial: 8250: add lock for dma rx
On Mon, Dec 20, 2021 at 09:44:04AM +0000, wigin zeng wrote:
> >That makes no sense, as what orders the data coming in? The 2 bytes could be added to the tty buffer before the 512 bytes, or the other way around.
>
> >What hardware are you using that is mixing dma and irq data like this?
> >That feels very wrong.
>
> It is not normal case, normally, the input size should smaller than DMA block size and DMA complete the whole copy.
> However, there are some abnormal situations. The external input is unexpectedly larger than the data length of the DMA configuration. This situation in my example will appear, and it may cause the kernel to panic.

You did not answer my question about hardware type :(

And again, how is this happening? If you use DMA, all data should be
coming through DMA and not the irq. Otherwise crazy stuff like this
will happen in any type of driver, your hardware can not mix this type
of stuff up.

> >If they are running on different cores, then you will have data corruption issues no matter if you have a lock or not, so this is not the correct solution for this hardware configuration problem.
>
> The purpose of adding lock is to ensure that the kernel will not panic in this extreme case, If you want to ensure the integrity of the serial port data, you need to add more flow control logic

How can flow control handle this at all? Flow control is at the serial
data stream level. This is confusing the PCI data stream order.

thanks,

greg k-h

\
 
 \ /
  Last update: 2021-12-20 11:00    [W:0.074 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site