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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 10 Feb 2016 12:10:21 -0800
From:	Kenneth Westfield <kwestfie@...eaurora.org>
To:	Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc:	Patrick Lai <plai@...eaurora.org>, alsa-devel@...a-project.org,
	Mark Brown <broonie@...nel.org>,
	Banajit Goswami <bgoswami@...eaurora.org>,
	Liam Girdwood <lgirdwood@...il.com>,
	Jaroslav Kysela <perex@...ex.cz>,
	Takashi Iwai <tiwai@...e.com>, linux-kernel@...r.kernel.org,
	linux-arm-msm@...r.kernel.org, kwestfie@...eaurora.org
Subject: Re: [PATCH v1 13/14] ASoC: qcom: add mic support

On Wed, Feb 10, 2016 at 02:20:03AM -0800, Srinivas Kandagatla wrote:
> diff --git a/sound/soc/qcom/lpass-platform.c
> b/sound/soc/qcom/lpass-platform.c
> index 26a046a..574aa33 100644
> --- a/sound/soc/qcom/lpass-platform.c
> +++ b/sound/soc/qcom/lpass-platform.c

...

> @@ -92,7 +93,13 @@ static int lpass_platform_pcmops_hw_params(struct
> snd_pcm_substream *substream,
>  	unsigned int regval;
>  	int dir = substream->stream;
>  	int bitwidth;
> -	int ret, rdma_port = pcm_data->i2s_port + v->dmactl_audif_start;
> +	int ch, ret, dma_port = pcm_data->i2s_port +
> v->dmactl_audif_start;

IMO, changing rdma_port to dma_port should be in patch 3 (ASoC: qcom:
rename rdmactl_audif_start to dmactrl_audif_start).  However, as I
stated in my comments to your RFC submission, this is a nit.

...

> @@ -460,55 +483,106 @@ static int lpass_platform_pcm_new(struct
> snd_soc_pcm_runtime *soc_runtime)
>  	if (!data)
>  		return -ENOMEM;
>  
> -	if (v->alloc_dma_channel)
> -		data->rdma_ch = v->alloc_dma_channel(drvdata,
> -
> SNDRV_PCM_STREAM_PLAYBACK);
> +	data->i2s_port = cpu_dai->driver->id;
> +	snd_soc_pcm_set_drvdata(soc_runtime, data);
>  
> -	if (IS_ERR_VALUE(data->rdma_ch))
> -		return data->rdma_ch;
> +	psubstream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
> +	if (psubstream) {
> +		if (v->alloc_dma_channel)
> +			data->rdma_ch = v->alloc_dma_channel(drvdata,
> +
> SNDRV_PCM_STREAM_PLAYBACK);
>  
> -	drvdata->substream[data->rdma_ch] = substream;
> -	data->i2s_port = cpu_dai->driver->id;
> +		if (IS_ERR_VALUE(data->rdma_ch))
> +			return data->rdma_ch;
>  
> -	snd_soc_pcm_set_drvdata(soc_runtime, data);
> +		drvdata->substream[data->rdma_ch] = psubstream;
>  
> -	ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV,
> -				soc_runtime->platform->dev,
> -				size, &substream->dma_buffer);
> -	if (ret)
> -		return ret;
> +		ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV,
> pcm->card->dev,
> +					size, &psubstream->dma_buffer);

In patch 1 of this series (ASoC: qcom: use snd_dma_alloc/free* apis), you
correctly used the platform device for memory allocation.  However, that is
then replaced by the soundcard device here ...

> +	csubstream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
> +	if (csubstream) {
> +		if (v->alloc_dma_channel)
> +			data->wrdma_ch = v->alloc_dma_channel(drvdata,
> +						SNDRV_PCM_STREAM_CAPTURE);
> +
> +		if (IS_ERR_VALUE(data->wrdma_ch))
> +			goto capture_alloc_err;
> +
> +		drvdata->substream[data->wrdma_ch] = csubstream;
> +
> +		ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV,
> pcm->card->dev,
> +					size, &csubstream->dma_buffer);
> +		if (ret)
> +			goto capture_alloc_err;

... and here as well.

-- 
Kenneth Westfield
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project

Powered by blists - more mailing lists