From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mundt Subject: Re: Audio buffer mmap-ing on sh arch vs. cache aliasing problem Date: Fri, 26 Sep 2008 19:30:45 +0900 Message-ID: <20080926103045.GA18874@linux-sh.org> References: <1220527434.3299.2074.camel@bri1004.bri.st.com> <1222354553.28498.30.camel@bri1004.bri.st.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx.gate01.com (mta23.gyao.ne.jp [125.63.38.249]) by alsa0.perex.cz (Postfix) with ESMTP id B0EFA103812 for ; Fri, 26 Sep 2008 12:30:56 +0200 (CEST) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Takashi Iwai Cc: alsa-devel@alsa-project.org, Pawel MOLL , linux-sh@vger.kernel.org List-Id: alsa-devel@alsa-project.org On Fri, Sep 26, 2008 at 12:04:23PM +0200, Takashi Iwai wrote: > At Thu, 25 Sep 2008 15:55:53 +0100, > Pawel MOLL wrote: > > > > > One thing we can try is a patch like below. But, I'm not sure whether > > > this is correct over all architectures, too. At best, a generic API > > > would be helpful for such a thing... > > > + area->vm_page_prot = pgprot_noncached(area->vm_page_prot); > > > > Well, it's not enough, because the kernel mapping of buffer is still > > cached... A hack below does the job, but it is not nice as well... > > Yeah, that's not sexy, but maybe the only working case right now > (better with arch-specific ifdefs). > > IIRC, a similar buffer handling (via vmalloc) is used in video > drivers. I suppose they don't work as well, right? > DRM driver uses __vmalloc() with PAGE_KERNEL_NOCACHE, but it's only > for PPC32 non-coherent. > x86 does it also, via its PAGE_AGP definition. There are not that many platforms that define PAGE_KERNEL_NOCACHE though, so this gets a bit messy.. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mundt Date: Fri, 26 Sep 2008 10:30:45 +0000 Subject: Re: [alsa-devel] Audio buffer mmap-ing on sh arch vs. cache aliasing problem Message-Id: <20080926103045.GA18874@linux-sh.org> List-Id: References: <1220527434.3299.2074.camel@bri1004.bri.st.com> <1222354553.28498.30.camel@bri1004.bri.st.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Takashi Iwai Cc: alsa-devel@alsa-project.org, Pawel MOLL , linux-sh@vger.kernel.org On Fri, Sep 26, 2008 at 12:04:23PM +0200, Takashi Iwai wrote: > At Thu, 25 Sep 2008 15:55:53 +0100, > Pawel MOLL wrote: > > > > > One thing we can try is a patch like below. But, I'm not sure whether > > > this is correct over all architectures, too. At best, a generic API > > > would be helpful for such a thing... > > > + area->vm_page_prot = pgprot_noncached(area->vm_page_prot); > > > > Well, it's not enough, because the kernel mapping of buffer is still > > cached... A hack below does the job, but it is not nice as well... > > Yeah, that's not sexy, but maybe the only working case right now > (better with arch-specific ifdefs). > > IIRC, a similar buffer handling (via vmalloc) is used in video > drivers. I suppose they don't work as well, right? > DRM driver uses __vmalloc() with PAGE_KERNEL_NOCACHE, but it's only > for PPC32 non-coherent. > x86 does it also, via its PAGE_AGP definition. There are not that many platforms that define PAGE_KERNEL_NOCACHE though, so this gets a bit messy..