All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Patrick Lai <plai@codeaurora.org>,
	alsa-devel@alsa-project.org,
	Banajit Goswami <bgoswami@codeaurora.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Takashi Iwai <tiwai@suse.com>, Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH RFC 01/15] ASoC: qcom: use snd_dma_alloc/free* apis
Date: Wed, 3 Feb 2016 08:48:27 +0000	[thread overview]
Message-ID: <56B1BEDB.6060709@linaro.org> (raw)
In-Reply-To: <20160203003507.GB14436@kwestfie-linux.qualcomm.com>



On 03/02/16 00:35, Kenneth Westfield wrote:
> On Mon, Feb 01, 2016 at 09:27:59AM -0800, Srinivas Kandagatla wrote:
>> diff --git a/sound/soc/qcom/lpass-platform.c
>> b/sound/soc/qcom/lpass-platform.c
>> index 4aeb8e1..a6dce1b 100644
>> --- a/sound/soc/qcom/lpass-platform.c
>> +++ b/sound/soc/qcom/lpass-platform.c
>> @@ -439,39 +439,6 @@ static irqreturn_t lpass_platform_lpaif_irq(int irq,
>> void *data)
>>   	return IRQ_HANDLED;
>>   }
>>
>> -static int lpass_platform_alloc_buffer(struct snd_pcm_substream
>> *substream,
>> -		struct snd_soc_pcm_runtime *rt)
>> -{
>> -	struct snd_dma_buffer *buf = &substream->dma_buffer;
>> -	size_t size = lpass_platform_pcm_hardware.buffer_bytes_max;
>> -
>> -	buf->dev.type = SNDRV_DMA_TYPE_DEV;
>> -	buf->dev.dev = rt->platform->dev;
>> -	buf->private_data = NULL;
>> -	buf->area = dma_alloc_coherent(rt->platform->dev, size,
>> &buf->addr,
>> -			GFP_KERNEL);
>> -	if (!buf->area) {
>> -		dev_err(rt->platform->dev, "%s: Could not allocate DMA
>> buffer\n",
>> -				__func__);
>> -		return -ENOMEM;
>> -	}
>
> ...
>
>> @@ -499,7 +467,8 @@ static int lpass_platform_pcm_new(struct
>> snd_soc_pcm_runtime *soc_runtime)
>>
>>   	snd_soc_pcm_set_drvdata(soc_runtime, data);
>>
>> -	ret = lpass_platform_alloc_buffer(substream, soc_runtime);
>> +	ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->card->dev,
>> +				size, &substream->dma_buffer);
>>   	if (ret)
>>   		return ret;
>>
>
> Is there a particular reason for using the soundcard device (pcm-card->dev)
> rather than the platform device (rt->platform->dev) for memory
> allocation?  Especially considering you posted a fix for this several
> weeks ago (ASoC: qcom: use correct device pointer in dma allocation).

Thanks for spotting this, I will fix it and resend it with platform->dev.

>

WARNING: multiple messages have this Message-ID (diff)
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Patrick Lai <plai@codeaurora.org>,
	alsa-devel@alsa-project.org,
	Banajit Goswami <bgoswami@codeaurora.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Takashi Iwai <tiwai@suse.com>, Mark Brown <broonie@kernel.org>
Subject: Re: [alsa-devel] [PATCH RFC 01/15] ASoC: qcom: use snd_dma_alloc/free* apis
Date: Wed, 3 Feb 2016 08:48:27 +0000	[thread overview]
Message-ID: <56B1BEDB.6060709@linaro.org> (raw)
In-Reply-To: <20160203003507.GB14436@kwestfie-linux.qualcomm.com>



On 03/02/16 00:35, Kenneth Westfield wrote:
> On Mon, Feb 01, 2016 at 09:27:59AM -0800, Srinivas Kandagatla wrote:
>> diff --git a/sound/soc/qcom/lpass-platform.c
>> b/sound/soc/qcom/lpass-platform.c
>> index 4aeb8e1..a6dce1b 100644
>> --- a/sound/soc/qcom/lpass-platform.c
>> +++ b/sound/soc/qcom/lpass-platform.c
>> @@ -439,39 +439,6 @@ static irqreturn_t lpass_platform_lpaif_irq(int irq,
>> void *data)
>>   	return IRQ_HANDLED;
>>   }
>>
>> -static int lpass_platform_alloc_buffer(struct snd_pcm_substream
>> *substream,
>> -		struct snd_soc_pcm_runtime *rt)
>> -{
>> -	struct snd_dma_buffer *buf = &substream->dma_buffer;
>> -	size_t size = lpass_platform_pcm_hardware.buffer_bytes_max;
>> -
>> -	buf->dev.type = SNDRV_DMA_TYPE_DEV;
>> -	buf->dev.dev = rt->platform->dev;
>> -	buf->private_data = NULL;
>> -	buf->area = dma_alloc_coherent(rt->platform->dev, size,
>> &buf->addr,
>> -			GFP_KERNEL);
>> -	if (!buf->area) {
>> -		dev_err(rt->platform->dev, "%s: Could not allocate DMA
>> buffer\n",
>> -				__func__);
>> -		return -ENOMEM;
>> -	}
>
> ...
>
>> @@ -499,7 +467,8 @@ static int lpass_platform_pcm_new(struct
>> snd_soc_pcm_runtime *soc_runtime)
>>
>>   	snd_soc_pcm_set_drvdata(soc_runtime, data);
>>
>> -	ret = lpass_platform_alloc_buffer(substream, soc_runtime);
>> +	ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->card->dev,
>> +				size, &substream->dma_buffer);
>>   	if (ret)
>>   		return ret;
>>
>
> Is there a particular reason for using the soundcard device (pcm-card->dev)
> rather than the platform device (rt->platform->dev) for memory
> allocation?  Especially considering you posted a fix for this several
> weeks ago (ASoC: qcom: use correct device pointer in dma allocation).

Thanks for spotting this, I will fix it and resend it with platform->dev.

>

  reply	other threads:[~2016-02-03  8:48 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01 17:27 [PATCH RFC 00/15] ASoC: qcom: Add capture support Srinivas Kandagatla
2016-02-01 17:27 ` [PATCH RFC 01/15] ASoC: qcom: use snd_dma_alloc/free* apis Srinivas Kandagatla
2016-02-03  0:35   ` [alsa-devel] " Kenneth Westfield
2016-02-03  8:48     ` Srinivas Kandagatla [this message]
2016-02-03  8:48       ` Srinivas Kandagatla
2016-02-01 17:28 ` [PATCH RFC 02/15] ASoC: qcom: add wrdma register details to lpass_variant Srinivas Kandagatla
2016-02-03  0:35   ` [alsa-devel] " Kenneth Westfield
2016-02-01 17:28 ` [PATCH RFC 03/15] ASoC: qcom: rename rdmactl_audif_start to dmactrl_audif_start Srinivas Kandagatla
2016-02-03  0:35   ` [alsa-devel] " Kenneth Westfield
2016-02-03  8:48     ` Srinivas Kandagatla
2016-02-03  8:48       ` [alsa-devel] " Srinivas Kandagatla
2016-02-01 17:28 ` [PATCH RFC 04/15] ASoC: qcom: pass direction to dma allocation Srinivas Kandagatla
2016-02-03  0:36   ` [alsa-devel] " Kenneth Westfield
2016-02-01 17:28 ` [PATCH RFC 05/15] ASoC: qcom: ipq806x: add error in " Srinivas Kandagatla
2016-02-03  0:36   ` [alsa-devel] " Kenneth Westfield
2016-02-03  8:48     ` Srinivas Kandagatla
2016-02-01 17:28 ` [PATCH RFC 06/15] ASoC: qcom: ipq806x: add wrdma related register offsets Srinivas Kandagatla
2016-02-03  0:36   ` [alsa-devel] " Kenneth Westfield
2016-02-20 17:14   ` Applied "ASoC: qcom: ipq806x: add wrdma related register offsets" to the asoc tree Mark Brown
2016-02-01 17:28 ` [PATCH RFC 07/15] ASoC: qcom: add mic related i2s control register defines Srinivas Kandagatla
2016-02-03  0:36   ` [alsa-devel] " Kenneth Westfield
2016-02-03  8:48     ` Srinivas Kandagatla
2016-02-01 17:29 ` [PATCH RFC 08/15] ASoC: qcom: add wrdma dma channel start Srinivas Kandagatla
2016-02-03  0:36   ` [alsa-devel] " Kenneth Westfield
2016-02-03  8:48     ` Srinivas Kandagatla
2016-02-01 17:29 ` [PATCH RFC 09/15] ASoC: qcom: rename rdma_ch_bit_map to dma_ch_bit_map Srinivas Kandagatla
2016-02-03  0:37   ` [alsa-devel] " Kenneth Westfield
2016-02-03  8:48     ` Srinivas Kandagatla
2016-02-20 17:14   ` Applied "ASoC: qcom: rename rdma_ch_bit_map to dma_ch_bit_map" to the asoc tree Mark Brown
2016-02-01 17:29 ` [PATCH RFC 10/15] ASoC: qcom: apq8016: add wrdma support Srinivas Kandagatla
2016-02-03  0:37   ` [alsa-devel] " Kenneth Westfield
2016-02-03  8:48     ` Srinivas Kandagatla
2016-02-01 17:29 ` [PATCH RFC 11/15] ASoC: qcom: add wrdma register definations Srinivas Kandagatla
2016-02-03  0:37   ` [alsa-devel] " Kenneth Westfield
2016-02-20 17:14   ` Applied "ASoC: qcom: add wrdma register definitions" to the asoc tree Mark Brown
2016-02-01 17:29 ` [PATCH RFC 12/15] ASoC: qcom: add generic bit masks for RDMA and WRDMA Srinivas Kandagatla
2016-02-03  0:37   ` [alsa-devel] " Kenneth Westfield
2016-02-03  8:49     ` Srinivas Kandagatla
2016-02-01 17:29 ` [PATCH RFC 13/15] ASoC: qcom: apq8016: set the correct max register for regmap Srinivas Kandagatla
2016-02-03  0:37   ` [alsa-devel] " Kenneth Westfield
2016-02-20 17:14   ` Applied "ASoC: qcom: apq8016: set the correct max register for regmap" to the asoc tree Mark Brown
2016-02-01 17:29 ` [PATCH RFC 14/15] ASoC: qcom: apq8016-sbc: add mic support Srinivas Kandagatla
2016-02-03  0:38   ` [alsa-devel] " Kenneth Westfield
2016-02-20 17:14   ` Applied "ASoC: qcom: apq8016-sbc: add mic support" to the asoc tree Mark Brown
2016-02-01 17:29 ` [PATCH RFC 15/15] ASoC: qcom: add mic support Srinivas Kandagatla
2016-02-03  0:38   ` [alsa-devel] " Kenneth Westfield
2016-02-03  0:33 ` [alsa-devel] [PATCH RFC 00/15] ASoC: qcom: Add capture support Kenneth Westfield
2016-02-03  8:48   ` Srinivas Kandagatla

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=56B1BEDB.6060709@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@codeaurora.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plai@codeaurora.org \
    --cc=tiwai@suse.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.