From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752923Ab2F1N2u (ORCPT ); Thu, 28 Jun 2012 09:28:50 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38989 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751079Ab2F1N2t (ORCPT ); Thu, 28 Jun 2012 09:28:49 -0400 Date: Thu, 28 Jun 2012 15:28:45 +0200 Message-ID: From: Takashi Iwai To: Laxman Dewangan Cc: Mark Brown , Lars-Peter Clausen , "alsa-devel@alsa-project.org" , Stephen Warren , "linux-kernel@vger.kernel.org" , "lrg@ti.com" , Marek Szyprowski Subject: Re: [alsa-devel] [PATCH] ASoC: snd_dmaengine: add common api for pcm_mmap In-Reply-To: <4FEC5642.9080908@nvidia.com> References: <1340866886-24432-1-git-send-email-ldewangan@nvidia.com> <4FEC3B70.5030902@metafoo.de> <20120628121816.GB21029@sirena.org.uk> <4FEC4E62.3020101@metafoo.de> <20120628122830.GJ28922@opensource.wolfsonmicro.com> <4FEC4FA9.20004@nvidia.com> <4FEC5642.9080908@nvidia.com> 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.3 (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 At Thu, 28 Jun 2012 18:34:02 +0530, Laxman Dewangan wrote: > > On Thursday 28 June 2012 06:27 PM, Takashi Iwai wrote: > > At Thu, 28 Jun 2012 18:05:53 +0530, > > Laxman Dewangan wrote: > >> On Thursday 28 June 2012 05:58 PM, Mark Brown wrote: > >>> * PGP Signed by an unknown key > >>> > >>> On Thu, Jun 28, 2012 at 02:30:26PM +0200, Lars-Peter Clausen wrote: > >>>> On 06/28/2012 02:18 PM, Mark Brown wrote: > >>>>> Oh, dear - this means we don't actually have a generic API at all. Is > >>>>> there any effort being made to make this generally available? > >>>> Yes there is, and in fact in next/master there is generic > >>>> dma_mmap_writecombine. I'm not quite sure how it behaves on non ARM archs > >>>> though. But in theory it should fallback to a normal coherent mapping. Marek > >>>> did a lot of work on this, I've put him on Cc. > >> So can we put the function snd_pcm_lib_writecombine_mmap() in the > >> pcm_native.c and only export this api for ARM i.e. under macro #ifdef > >> CONFIG_ARM so that ARM based SOCs like Tegra/epa3xx/mxs/spear can > >> directly use that one? > >> Or, wait for this common API until all ARCH support it? > > I think it's fine to put it first in ALSA side with some ifdef. > > A similar trick is already found for snd_pcm_lib_mmap_iomem. > > See include/sound/pcm.h. > > > > But, actually it's a still question what if an architecture doesn't > > support the mmap of writecombine at all. The proposed patch doesn't > > allow you to know whether writecombine-mmap is possible or not on the > > running architecture until you really try to call it and fail. > > It's a missing piece, IMO. > > Lars wanted to move the buffer allocation also to common place. Which common place? > Then how about this? > create new file and header for snd-pcm-writecombine-buffer.c/.h and put > this in sound/core. > Select this file compilation through config SND_PCM_WRITECOMBINE_BUFFER > which will be select this config through sound/soc/xxx/Kconfig if they > want to use. > This will provide three apis: new, free and mmap. Way too much hustles than necessary... Takashi