lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 11 Apr 2014 22:13:27 +0530
From:	Vinod Koul <vinod.koul@...el.com>
To:	Peter Ujfalusi <peter.ujfalusi@...com>
Cc:	dan.j.williams@...el.com, nsekhar@...com,
	dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org,
	joelf@...com, linux-arm-kernel@...ts.infradead.org,
	linux-omap@...r.kernel.org,
	davinci-linux-open-source@...ux.davincidsp.com, mporter@...aro.org
Subject: Re: [PATCH v2 03/14] dma: edma: Add support for DMA_PAUSE/RESUME
 operation

On Tue, Apr 01, 2014 at 04:06:04PM +0300, Peter Ujfalusi wrote:
> Pause/Resume can be used by the audio stack when the stream is paused/resumed
> The edma platform code has support for this and the legacy audio stack used
> this.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@...com>
> ---
>  drivers/dma/edma.c | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
> index 2742867fd1e6..7891378a03f0 100644
> --- a/drivers/dma/edma.c
> +++ b/drivers/dma/edma.c
> @@ -240,6 +240,26 @@ static int edma_slave_config(struct edma_chan *echan,
>  	return 0;
>  }
>  
> +static int edma_dma_pause(struct edma_chan *echan)
> +{
> +	/* Pause/Resume only allowed with cyclic mode */
> +	if (!echan->edesc->cyclic)
> +		return -EINVAL;
why this artificial restriction? The driver can do pause even for non cyclic
cases too? Yes the usage is in cyclic context but why should we limit any future
work on this?

-- 
~Vinod
> +
> +	edma_pause(echan->ch_num);
> +	return 0;
> +}
> +
> +static int edma_dma_resume(struct edma_chan *echan)
> +{
> +	/* Pause/Resume only allowed with cyclic mode */
> +	if (!echan->edesc->cyclic)
> +		return -EINVAL;
> +
> +	edma_resume(echan->ch_num);
> +	return 0;
> +}
> +
>  static int edma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
>  			unsigned long arg)
>  {
> @@ -255,6 +275,14 @@ static int edma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
>  		config = (struct dma_slave_config *)arg;
>  		ret = edma_slave_config(echan, config);
>  		break;
> +	case DMA_PAUSE:
> +		ret = edma_dma_pause(echan);
> +		break;
> +
> +	case DMA_RESUME:
> +		ret = edma_dma_resume(echan);
> +		break;
> +
>  	default:
>  		ret = -ENOSYS;
>  	}
> -- 
> 1.9.1
> 

-- 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ