dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Sanjay R Mehta <Sanju.Mehta@amd.com>
Cc: gregkh@linuxfoundation.org, dan.j.williams@intel.com,
	Thomas.Lendacky@amd.com, Shyam-sundar.S-k@amd.com,
	Nehal-bakulchandra.Shah@amd.com, robh@kernel.org,
	mchehab+samsung@kernel.org, davem@davemloft.net,
	Jonathan.Cameron@huawei.com, linux-kernel@vger.kernel.org,
	dmaengine@vger.kernel.org
Subject: Re: [PATCH v3 2/3] dmaengine: ptdma: Register pass-through engine as a DMA resource
Date: Fri, 24 Jan 2020 11:35:32 +0530	[thread overview]
Message-ID: <20200124060532.GD2841@vkoul-mobl> (raw)
In-Reply-To: <1579597494-60348-3-git-send-email-Sanju.Mehta@amd.com>

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

  reply	other threads:[~2020-01-24  6:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-21  9:04 [PATCH v3 0/3] Add AMD PassThru DMA Engine driver Sanjay R Mehta
2020-01-21  9:04 ` [PATCH v3 1/3] dmaengine: ptdma: Initial driver for the AMD PassThru DMA engine Sanjay R Mehta
2020-01-24  6:00   ` Vinod Koul
2020-01-21  9:04 ` [PATCH v3 2/3] dmaengine: ptdma: Register pass-through engine as a DMA resource Sanjay R Mehta
2020-01-24  6:05   ` Vinod Koul [this message]
2020-01-21  9:04 ` [PATCH v3 3/3] dmaengine: ptdma: Add debugfs entries for PTDMA information Sanjay R Mehta
2020-03-26 16:05 ` [PATCH v3 0/3] Add AMD PassThru DMA Engine driver Vitaly Mayatskih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200124060532.GD2841@vkoul-mobl \
    --to=vkoul@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Nehal-bakulchandra.Shah@amd.com \
    --cc=Sanju.Mehta@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=Thomas.Lendacky@amd.com \
    --cc=dan.j.williams@intel.com \
    --cc=davem@davemloft.net \
    --cc=dmaengine@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).