From: Nicolin Chen <b42378@freescale.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: broonie@kernel.org, lars@metafoo.de, lgirdwood@gmail.com,
alsa-devel@alsa-project.org
Subject: Re: [PATCH v2 1/2] ALSA: Add SoC on-chip internal memory support for DMA buffer allocation
Date: Wed, 16 Oct 2013 17:51:24 +0800 [thread overview]
Message-ID: <20131016095124.GC24805@MrMyself> (raw)
In-Reply-To: <s5heh7lmtgh.wl%tiwai@suse.de>
On Wed, Oct 16, 2013 at 11:54:38AM +0200, Takashi Iwai wrote:
> At Wed, 16 Oct 2013 17:34:45 +0800,
> Nicolin Chen wrote:
> > --- a/sound/core/pcm_native.c
> > +++ b/sound/core/pcm_native.c
> > @@ -3201,12 +3201,18 @@ int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream,
> > area->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
> > #ifdef ARCH_HAS_DMA_MMAP_COHERENT
> > if (!substream->ops->page &&
> > - substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV)
> > + substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV) {
> > return dma_mmap_coherent(substream->dma_buffer.dev.dev,
> > area,
> > substream->runtime->dma_area,
> > substream->runtime->dma_addr,
> > area->vm_end - area->vm_start);
> > + } else if (substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV_IRAM) {
> > + area->vm_page_prot = pgprot_writecombine(area->vm_page_prot);
> > + return remap_pfn_range(area, area->vm_start,
> > + substream->dma_buffer.addr >> PAGE_SHIFT,
> > + area->vm_end - area->vm_start, area->vm_page_prot);
> > + }
>
> Here is a wrong place to put. The handling of SNDRV_DMA_TYPE_IRAM
> must be irrelevant with the existence of dma_mmap_coherent(), thus it
> should be outside the ifdef block.
>
> In addition, you need the check whether SNDRV_DMA_TYPE_DEV_IRAM !=
> SNDRV_DMA_TYPE_DEV.
Thank you, Iwai-san.
I'll fix it in v3.
>
>
> thanks,
>
> Takashi
>
prev parent reply other threads:[~2013-10-16 9:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-16 9:34 [PATCH v2 1/2] ALSA: Add SoC on-chip internal memory support for DMA buffer allocation Nicolin Chen
2013-10-16 9:34 ` [PATCH v2 2/2] ASoC: generic-dmaengine-pcm: Use on-chip internal memory for DMA buffer Nicolin Chen
2013-10-16 9:54 ` [PATCH v2 1/2] ALSA: Add SoC on-chip internal memory support for DMA buffer allocation Takashi Iwai
2013-10-16 9:51 ` Nicolin Chen [this message]
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=20131016095124.GC24805@MrMyself \
--to=b42378@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.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