lkml.org 
[lkml]   [2020]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/3] dmaengine: ptdma: Register pass-through engine as a DMA resource
On 21-01-20, 03:04, Sanjay R Mehta wrote:

> +static void pt_free_chan_resources(struct dma_chan *dma_chan)
> +{
> + struct pt_dma_chan *chan = container_of(dma_chan, struct pt_dma_chan,
> + dma_chan);
> + unsigned long flags;
> +
> + dev_dbg(chan->pt->dev, "%s - chan=%p\n", __func__, chan);
> +
> + spin_lock_irqsave(&chan->lock, flags);
> +
> + pt_free_desc_resources(chan->pt, &chan->complete);
> + pt_free_desc_resources(chan->pt, &chan->active);
> + pt_free_desc_resources(chan->pt, &chan->pending);
> + pt_free_desc_resources(chan->pt, &chan->created);

can you use the virt-dma layer instead for list and descriptor
management..

> +static enum dma_status pt_tx_status(struct dma_chan *dma_chan,
> + dma_cookie_t cookie,
> + struct dma_tx_state *state)
> +{
> + struct pt_dma_chan *chan = container_of(dma_chan, struct pt_dma_chan,
> + dma_chan);
> + struct pt_dma_desc *desc;
> + enum dma_status ret;
> + unsigned long flags;
> +
> + if (chan->status == DMA_PAUSED) {
> + ret = DMA_PAUSED;

the pt_tx_status is for a specific cookie and not for the channel, so
you need to return status of the cookie which may have been completed or
pending (where pause makes sense)

> +static int pt_pause(struct dma_chan *dma_chan)
> +{
> + struct pt_dma_chan *chan = container_of(dma_chan, struct pt_dma_chan,
> + dma_chan);
> +
> + chan->status = DMA_PAUSED;
> +
> + /*TODO: Wait for active DMA to complete before returning? */

When will the be resolved :)

--
~Vinod

\
 
 \ /
  Last update: 2020-01-24 07:07    [W:0.293 / U:0.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site