public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laxman Dewangan <ldewangan@nvidia.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: "lrg@ti.com" <lrg@ti.com>,
	"broonie@opensource.wolfsonmicro.com" 
	<broonie@opensource.wolfsonmicro.com>,
	"lars@metafoo.de" <lars@metafoo.de>,
	Stephen Warren <swarren@nvidia.com>,
	"perex@perex.cz" <perex@perex.cz>,
	"clemens@ladisch.de" <clemens@ladisch.de>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/3] ASoC: Move pcm writecombine dma buffer allocation to core
Date: Fri, 29 Jun 2012 21:19:29 +0530	[thread overview]
Message-ID: <4FEDCE89.8020804@nvidia.com> (raw)
In-Reply-To: <s5hd34iw3al.wl%tiwai@suse.de>

On Friday 29 June 2012 08:52 PM, Takashi Iwai wrote:
> At Fri, 29 Jun 2012 20:34:24 +0530,
> Laxman Dewangan wrote:
>> Hi Takashi,
>> Thanks for sample code. It helps lot.
>>
>> int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t
>> size)
>> {
>>           struct snd_pcm_runtime *runtime;
>>           struct snd_dma_buffer *dmab = NULL;
>>
>>           if (PCM_RUNTIME_CHECK(substream))
>>                   return -EINVAL;
>>
>>           if (snd_BUG_ON(substream->dma_buffer.dev.type ==
>>                          SNDRV_DMA_TYPE_UNKNOWN))
>>                   return -EINVAL;
>>
>>           runtime = substream->runtime;
>>
>>           if (runtime->dma_buffer_p) {
>> ---------------Kernel crash at this point ----------
>>
>> So I used the snd_dma_alloc_pages() from the driver to allocate WC memory.
> snd_pcm_lib_malloc_pages() should be called only from hw_params.
> Prior to that, you need to set up the dam_buffer type by calling
> snd_pcm_lib_preallocate_pages() or
> snd_pcm_lib_preallocate_pages_for_all() at the time to create a PCM
> instance.  The size can be 0 if not necessary to allocate there but
> later on demand.

It worked well. Cool implementation.

I will send the patch of memalloc and for Tegra actually using this feature.

Thanks for suggestion and help.


Laxman

  reply	other threads:[~2012-06-29 15:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-29 10:23 [PATCH 0/3] ASoC: Move pcm writecombine dma buffer allocation to core Laxman Dewangan
2012-06-29 10:23 ` [PATCH 1/3] ALSA: pcm: add apis for writecombine dma buffer allocation Laxman Dewangan
2012-06-29 10:23 ` [PATCH 2/3] ASoC: add apis for creating/free pcm dma buffer Laxman Dewangan
2012-06-29 10:23 ` [PATCH 3/3] ASoC: tegra: use core/pcm library for pcm buffer allocation Laxman Dewangan
2012-06-29 12:13 ` [PATCH 0/3] ASoC: Move pcm writecombine dma buffer allocation to core Takashi Iwai
2012-06-29 15:04   ` Laxman Dewangan
2012-06-29 15:22     ` Takashi Iwai
2012-06-29 15:49       ` Laxman Dewangan [this message]
2012-06-29 16:06     ` Lars-Peter Clausen
2012-06-29 16:18       ` Takashi Iwai
2012-06-29 16:32         ` Lars-Peter Clausen

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=4FEDCE89.8020804@nvidia.com \
    --to=ldewangan@nvidia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=clemens@ladisch.de \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=perex@perex.cz \
    --cc=swarren@nvidia.com \
    --cc=tiwai@suse.de \
    /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