linux-mips
[Top] [All Lists]

Re: [alsa-devel] ALSA on MIPS platform

To: Songmao Tian <tiansm@lemote.com>
Subject: Re: [alsa-devel] ALSA on MIPS platform
From: Takashi Iwai <tiwai@suse.de>
Date: Fri, 03 Aug 2007 15:59:50 +0200
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>, linux-mips@linux-mips.org, alsa-devel@alsa-project.org, Dajie Tan <jiankemeng@gmail.com>, greg@kroah.com
In-reply-to: <46B332AC.8020403@lemote.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <46B03CC0.3090000@lemote.com> <20070802.235606.122255120.anemo@mba.ocn.ne.jp> <46B332AC.8020403@lemote.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (Sanjō) APEL/10.6 MULE XEmacs/21.5 (beta27) (fiddleheads) (+CVS-20060704) (i386-suse-linux)
At Fri, 03 Aug 2007 21:50:36 +0800,
Songmao Tian wrote:
> 
> Atsushi Nemoto wrote:
> > On Wed, 01 Aug 2007 15:56:48 +0800, Songmao Tian <tiansm@lemote.com> wrote:
> >   
> >>     The problem is clear:
> >> 1. dma_alloc_noncoherent() return a non-cached address, and 
> >> virt_to_page() need a cached logical addr (Have I named it right?)
> >> 2. mmaped dam buffer should be non-cached.
> >>
> >> We have a ugly patch, but we want to solve the problem cleanly, so can 
> >> anyone show me the way?
> >>     
> >
> > virt_to_page() is used in many place in mm so making it robust might
> > affect performance.  IMHO virt_to_page() seems too low-level as DMA
> > API.
> >
> > If something like dma_virt_to_page(dev, cpu_addr) which can take a cpu
> > address returned by dma_xxx APIs was defined, MIPS can implement it
> > appropriately.
> >
> > And then pgprot_noncached issues still exist...
> >
> > ---
> > Atsushi Nemoto
> >
> >
> >
> >   
> 
> I agree, and I am investigating to implement a dma_map_coherent, but It 
> seems dma_map_coherent doesn't solve all the problem and will change a 
> lot of code:(

It won't be that much.  You'll need to change snd_pcm_default_mmap()
in sound/core/pcm_native.c to call dma_mmap_coherent() directly
instead of nopage ops.  But, this won't work with SG-buffers, which
requires some more additional works.


Takashi

<Prev in Thread] Current Thread [Next in Thread>