Re: Revert "dmaengine: pl330: add DMA_PAUSE feature"

From: Frank Mori Hess
Date: Thu May 17 2018 - 11:23:26 EST


Sorry to keep coming back to this, but I'm experiencing a bit of
incredulity that you are saying what you seem to be saying. You seem
to be saying dmaengine provides no way to permanently stop a transfer
safely other than transferring the full number of bytes initially
requested. So the proper resolution is the 8250 serial driver needs
to remove rx dma support, because they are just trying to do something
that is not supported.

On Thu, May 17, 2018 at 12:19 AM, Vinod Koul <vinod.koul@xxxxxxxxxx> wrote:
>> > Terminate is abort, data loss may happen here.
>>
>> Wait, are you saying if you do
>>
>> dma pause
>
> no data loss
>> read residue
>
> here as well
>> dma terminate
>
> Oh yes, we aborted...
>>

I see two ways of interpreting what you are saying. First, from the
point of view of the user of the dmaengine api. From this point of
view it is impossible for data loss to occur during pause or reading
the residue, so saying they cause no data loss during
pause/residue/terminate is meaningless. This is because the user
can't confirm any data loss until after they have read the residue and
the transfer is terminated, since optimistically the data may still be
available if only the user would resume and allow the transfer to
continue.

Second there is the interpretation I want to believe. This is "no
data loss on pause" means that after the pause, no data has been
discarded by the dma controller hardware, in fact all the data it has
read before being paused has been fully transferred to its
destination. Reading the residue while paused gives you an accurate,
up-to-date state of the paused transfer. Then finally, although in
general dma terminate causes data loss, it does not in this case since
we terminated while we were paused and read the up-to-date residue.
This is the interpretation implicit in the 8250 serial driver.