All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Robert Baldyga <r.baldyga@samsung.com>
Cc: dan.j.williams@intel.com, lars@metafoo.de,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	m.szyprowski@samsung.com, k.kozlowski@samsung.com,
	kyungmin.park@samsung.com, l.czerwinski@samsung.com,
	padma.kvr@gmail.com
Subject: Re: [PATCH v3 2/2] dma: pl330: add DMA_PAUSE feature
Date: Tue, 10 Feb 2015 16:24:05 -0800	[thread overview]
Message-ID: <20150211002405.GC21387@intel.com> (raw)
In-Reply-To: <1418208918-28127-3-git-send-email-r.baldyga@samsung.com>

On Wed, Dec 10, 2014 at 11:55:18AM +0100, Robert Baldyga wrote:
> DMA_PAUSE command is used for halting DMA transfer on chosen channel.
> It can be useful when we want to safely read residue before terminating
> all requests on channel. Otherwise there can be situation when some data
> is transferred before channel termination but after reading residue,
> which obviously results with data loss. To avoid this situation we can
> pause channel, read residue and then terminate all requests.
> This scenario is common, for example, in serial port drivers.
And where is the resume here? Also this needs rebase

-- 
~Vinod

> 
> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
> ---
>  drivers/dma/pl330.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index 2f4d561..ead4369 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -2137,6 +2137,25 @@ static int pl330_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, unsigned
>  		pm_runtime_mark_last_busy(pl330->ddma.dev);
>  		pm_runtime_put_autosuspend(pl330->ddma.dev);
>  		break;
> +	case DMA_PAUSE:
> +		/*
> +		 * We don't support DMA_RESUME command because of hardware
> +		 * limitations, so after pausing the channel we cannot restore
> +		 * it to active state. We have to terminate channel and setup
> +		 * DMA transfer again. This pause feature was implemented to
> +		 * allow safely read residue before channel termination.
> +		 */
> +		pm_runtime_get_sync(pl330->ddma.dev);
> +		spin_lock_irqsave(&pch->lock, flags);
> +
> +		spin_lock(&pl330->lock);
> +		_stop(pch->thread);
> +		spin_unlock(&pl330->lock);
> +
> +		spin_unlock_irqrestore(&pch->lock, flags);
> +		pm_runtime_mark_last_busy(pl330->ddma.dev);
> +		pm_runtime_put_autosuspend(pl330->ddma.dev);
> +		break;
>  	case DMA_SLAVE_CONFIG:
>  		slave_config = (struct dma_slave_config *)arg;
>  
> -- 
> 1.9.1
> 

-- 

  reply	other threads:[~2015-02-11  0:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10 10:55 [PATCH v3 0/2] dma: pl330: improve status checking Robert Baldyga
2014-12-10 10:55 ` [PATCH v3 1/2] dma: pl330: improve pl330_tx_status() function Robert Baldyga
2015-02-11  0:23   ` Vinod Koul
2015-02-11 10:50     ` Robert Baldyga
2014-12-10 10:55 ` [PATCH v3 2/2] dma: pl330: add DMA_PAUSE feature Robert Baldyga
2015-02-11  0:24   ` Vinod Koul [this message]
2015-02-11 11:02     ` Robert Baldyga

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=20150211002405.GC21387@intel.com \
    --to=vinod.koul@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=k.kozlowski@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=l.czerwinski@samsung.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=padma.kvr@gmail.com \
    --cc=r.baldyga@samsung.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.