Thread (31 messages) 31 messages, 9 authors, 2012-04-23

Re: [PATCH v2 0/9] DMA engine cookie handling cleanups

flat view
STALE5307d

From: Vinod Koul <hidden>
Date: 2012-03-19 14:35:30
Also in: linux-arm-kernel
Subsystem: dma generic offload engine subsystem, intel i/oat dma driver, the rest · Maintainers: Vinod Koul, Dave Jiang, Linus Torvalds

On Tue, 2012-03-13 at 20:08 +0530, Vinod Koul wrote:
On Tue, 2012-03-13 at 12:31 +0000, Russell King - ARM Linux wrote:
quoted
On Tue, Mar 13, 2012 at 02:10:36PM +0530, Vinod Koul wrote:
quoted
Please see if the below patch is the right fix for build failures in
addition to one suggested by Jassi.
I'm not sure that Jassi's solution is correct - and I'm wondering whether
any of the DMA engine drivers do the right thing when transfers are
terminated.  Is it right for the DMA status function to return IN_PROGRESS
for a previously submitted cookie which has been terminated?

I can see two answers to that, both equally valid:

1. It allows you to find out exactly where the DMA engine got to before
   the transfer was terminated, and therefore recover from the termination
   if you wish to.

2. Returning in-progress when a cookie will never be completed is
   misleading, and could be misinterpreted by users of the tx_status
   function, especially if they are waiting for a particular transaction
   to complete.

Maybe we need to introduce a DMA_TERMINATED status?
I would agree with you that DMA_TERMINATED seems to be correct option.
IN_PROGRESS would certainly confuse... 
I will drop Jassi's fix from this branch. Care to send the patch? 
Even after adding such a state in dmaengine for DMA_TERMINATED, it
doesn't make much sense. In TERMINATE_ALL we do not update the
chan->complete value. So after client has terminated the channel it can
easily test to see if cookie is completed (before terminate will return
SUCCESS) or aborted (will return DMA_IN_PROGRESS)
So at present I am leaning on 1 :)

If I don't hear any opposition I will merge this (with Jassi's fix) and
then send pull to Linus

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