[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20070420.183920.128619859.nemoto@toshiba-tops.co.jp>
Date: Fri, 20 Apr 2007 18:39:20 +0900 (JST)
From: Atsushi Nemoto <anemo@....ocn.ne.jp>
To: fxzhang@....ac.cn
Cc: ralf@...ux-mips.org, tiansm@...ote.com, perex@...e.cz,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
linux-mips@...ux-mips.org, zhangfx@...ote.com
Subject: Re: [PATCH 16/16] alsa sound support for mips
On Wed, 18 Apr 2007 22:13:02 +0800, Fuxin Zhang <fxzhang@....ac.cn> wrote:
> >> +#if defined(__mips__) && defined(CONFIG_DMA_NONCOHERENT)
> >> + /* all mmap using uncached mode */
> >> + area->vm_page_prot = pgprot_noncached(area->vm_page_prot);
> >> + area->vm_flags |= ( VM_RESERVED | VM_IO);
> >>
> >
> > VM_RESERVED will prevent the buffer from being freed. I assume that is
> > another workaround for some kernel subsystem blowing up when being fed a
> > pointer to an uncached RAM address? This smells like a memory leak.
> >
> >
> Oh, VM_RESERVED should be a memory leak problem, we can remove it.
> I don't remember any case of other subsystem's problem, just did not
> think much
> to add those flags.
I think pgprot_noncached() is needed because user mapping for a DMA
buffer (runtime->dma_area) should be uncache. If so, doing this in
snd_pcm_mmap() looks a bit suspicious. It seems snd_pcm_mmap_data()
is a place to do such an adjustment. But for now, both
snd_pcm_mmap_status() and snd_pcm_mmap_control() returns -ENXIO for
MIPS so this is not a real problem.
And I wonder if VM_IO is really needed. The area is a DMA buffer,
_not_ a memory mapped IO area, isn't it?
> > I would suggest to get rid of this ifdef with a new arch-specific function
> > like vmap_io_buffer which will do whatever a platform seems fit for this
> > case?
> >
> I think arch-specific function is the correct way, but don't know what
> the alsa gods think.
JFYI, there were some discussions on this topic a while ago:
http://lkml.org/lkml/2006/1/25/117
and I'v seen MIPS version of dma_mmap_coherent(), etc. somewhere...
---
Atsushi Nemoto
-
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