Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753261AbZKQJ3K (ORCPT ); Tue, 17 Nov 2009 04:29:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752674AbZKQJ3J (ORCPT ); Tue, 17 Nov 2009 04:29:09 -0500 Received: from cantor2.suse.de ([195.135.220.15]:54853 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752386AbZKQJ3I (ORCPT ); Tue, 17 Nov 2009 04:29:08 -0500 Date: Tue, 17 Nov 2009 10:29:10 +0100 Message-ID: From: Takashi Iwai To: Ralf Baechle Cc: Thomas Bogendoerfer , Wu Zhangjin , Jaroslav Kysela , alsa-devel@alsa-project.org, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Wu Zhangjin Subject: Re: [PATCH] MIPS: Fixups of ALSA memory maps In-Reply-To: <20091116174324.GA17748@linux-mips.org> References: <9cbcd06037c18288a6493459b8f3a6e1562eca77.1258389992.git.wuzhangjin@gmail.com> <20091116174324.GA17748@linux-mips.org> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.1 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2104 Lines: 58 At Mon, 16 Nov 2009 18:43:24 +0100, Ralf Baechle wrote: > > On Mon, Nov 16, 2009 at 06:12:22PM +0100, Takashi Iwai wrote: > > > Actually, this has been a looong-standing problem. > > I have a series of patches to fix these issues, but it's more > > intensively involved with dma_*() functions. > > > > The patches can be found in test/dma-fix branch of sound GIT tree. > > git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git test/dma-fix > > > > This basically adds dma_mmap_coherent() function to feasible > > architectures, which is already implemented for ARM, so far. > > Cool - but needs a little further tweaking to work right. That's a > solution which will use uncached accesses on all MIPS systems. > > IP27/IP35-family machines will explode when you try that. Eventually the > cache coherency logic will notice that cache, directory caches and memory > have become inconsistent and bombard the CPU with a bunch of nasty > exceptions. OK, that's really bad. > For cache-coherent machines otoh it's a big waste of performance. > > int dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma, > void *cpu_addr, dma_addr_t handle, size_t size) > { > struct page *pg; > > if (!plat_device_is_coherent(dev)) > vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); > cpu_addr = (void *)dma_addr_to_virt(handle); > pg = virt_to_page(cpu_addr); > > return remap_pfn_range(vma, vma->vm_start, > page_to_pfn(pg) + vma->vm_pgoff, > size, vma->vm_page_prot); > } > EXPORT_SYMBOL(dma_mmap_coherent); > > Thomas - you're the IP28 specialist. Would the plat_device_is_coherent() > above have to become a cpu_is_noncoherent_r10000() call? Any further > nasties? Thanks for checking! thanks, Takashi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/