Subject: [PATCH v2 2/2] dmaengine: Add hisilicon k3 DMA engine driver

From: [email-masked] (Vinod Koul)
Date: Tue, 20 Aug 2013 14:20:37 +0530

On Tue, Aug 20, 2013 at 05:23:39PM +0800, zhangfei wrote:
> >>>>>why do we need the else part here?
> >>>>Since asynchronous mode is supported.
> >>>>Desc is submitted to list but may not get physical channel to run.
> >>>But when you pause you pause the running channel. You dont pause a descriptor.
> >>>So whatever you are trying to imply doesnt make sense to me.
> >>
> >>Here delete node from chan_pending, which will be quired from tasklet.
> >>
> >>The physical channel is free matched.
> >>dma_issue_pending will put node to d->k3_dma_issue_pending if no phy allocated.
> >>Tasklet do two jobs
> >>1, check running channel for new request form desc_issued.
> >>2, check any new chan_pending and alloc phy if available.
> >>
> >>If no phy, the node will be put in chan_pending.
> >>If pause does not remove from chan_pending, it may be got from tasklet
> >>to start a new transaction.
> >>So it's safe to remove from chan_pending when pause, and add back when resume.
> >But when you add, where do you start from, from the start of the descriptor or
> >the previosu position.
> >
> >The point is pause-resume you dont need to do all that. Channel is paused so
> >just pause it by stopping exuection, not more. Then you resume by asking
> >controller to start from where it left off.
> 
> Since it is async mode, it does not know the physical channel is
> really started or not.
> 
> When desc is submitted, it can be
> a). get phy and run, pause can stop and resume where it stops.
> b). Dot not start at all since no phy available (16 phys vs 27
> request line), if pause do nothing it will stay in chan_pending, if
> tasklet happens again, it will be fetched and started, while upper
> layer thought it is already paused.
> 
> Do we need consider case b?
and how do you handle when the desc is running on a phy.

~Vinod