From: Takashi Iwai Subject: Re: Call to mmap in ALSA lib 1.0.13 fails in src/pcm/pcm_mmap.c line 367 Date: Mon, 15 Jan 2007 17:11:45 +0100 Message-ID: References: <45880176.3070300@teligy.com> <45898126.3060808@teligy.com> <458989BD.7050005@teligy.com> <45A26544.3000201@teligy.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <45A26544.3000201@teligy.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: David Cullen Cc: Jason Yates , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Mon, 08 Jan 2007 10:37:40 -0500, David Cullen wrote: > > Dear Mr. Iwai, > > Takashi Iwai wrote: > > The implementation depends pretty much on the architecture. > > (Also, dma_mmap() is no global function but specific only for ARM.) > > Since the vm_region struct is different between ppc and arm (the page > > pointer is missing in ppc version), it cannot be copied as it is. > > > > A simple (but totally untested) version would be like below: > > > > int dma_mmap_coherent(struct device *dev, > > struct vm_area_struct *vma, void *cpu_addr, > > dma_addr_t dma_addr, size_t size) > > { > > unsigned long pfn; > > > > pfn = page_to_pfn(virt_to_page(bus_to_virt(dma_addr))); > > vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); > > return remap_pfn_range(vma, vma->vm_start, pfn + vma->vm_pgoff, > > vma->vm_end - vma->vm_start, > > vma->vm_pgprot); > > } > > > > (This might not work for some ppc models, though...) > > > > Then either add .mmap callback to each of snd_pcm_ops table in ca0106 > > that calls dma_mmap_coherent() above, or change snd_pcm_default_mmap > > to call dma_mmap_coherent() directly instead of nopage method. > > For the former way, take a look at sound/arm/aaci.c (and devdma.c) as > > a reference. > > > > I implemented the "former way". However, when I put a breakpoint in > __dma_alloc_coherent it does not get called when I run speaker-test. > It does get called during execution of "modprobe snd-ca0106". You mean change ca0106 codes to add dma_alloc_coherent() as mmap callback? Then please show the patch you changed. It's easier to check. Takashi ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV