From: Paul Mundt <lethal@linux-sh.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Pawel MOLL <pawel.moll@st.com>,
linux-sh@vger.kernel.org
Subject: Re: [alsa-devel] Audio buffer mmap-ing on sh arch vs. cache aliasing problem
Date: Sat, 16 Jan 2010 19:20:36 +0900 [thread overview]
Message-ID: <20100116102036.GA32696@linux-sh.org> (raw)
In-Reply-To: <s5haawel607.wl%tiwai@suse.de>
On Sat, Jan 16, 2010 at 11:05:12AM +0100, Takashi Iwai wrote:
> At Fri, 15 Jan 2010 09:04:17 +0900,
> Paul Mundt wrote:
> >
> > 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.
> > >
> > To come back to this issue, we don't appear to have made any headway on
> > the vmalloc front, but pgprot_noncached() is now a standard interface
> > provided by all architectures, so the ifdef is no longer needed in the
> > snd_pcm_default_mmap() path.
>
> Thanks for heading up about this.
>
> It seems, however, that pgprot_noncached() is still dangerous to apply
> unconditionally, according to MIPS guys. Some MIPS platforms may freeze
> when this is set to invalid pages.
>
> So, this should be applied still in an arch-dependent manner...
> Oh well.
>
Then it is something they will have to fix on their own. It's used by the
generic VM code for VMA writenotify (see mm/mmap.c).
WARNING: multiple messages have this Message-ID (diff)
From: Paul Mundt <lethal@linux-sh.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Pawel MOLL <pawel.moll@st.com>,
linux-sh@vger.kernel.org
Subject: Re: [alsa-devel] Audio buffer mmap-ing on sh arch vs. cache aliasing problem
Date: Sat, 16 Jan 2010 10:20:36 +0000 [thread overview]
Message-ID: <20100116102036.GA32696@linux-sh.org> (raw)
In-Reply-To: <s5haawel607.wl%tiwai@suse.de>
On Sat, Jan 16, 2010 at 11:05:12AM +0100, Takashi Iwai wrote:
> At Fri, 15 Jan 2010 09:04:17 +0900,
> Paul Mundt wrote:
> >
> > 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.
> > >
> > To come back to this issue, we don't appear to have made any headway on
> > the vmalloc front, but pgprot_noncached() is now a standard interface
> > provided by all architectures, so the ifdef is no longer needed in the
> > snd_pcm_default_mmap() path.
>
> Thanks for heading up about this.
>
> It seems, however, that pgprot_noncached() is still dangerous to apply
> unconditionally, according to MIPS guys. Some MIPS platforms may freeze
> when this is set to invalid pages.
>
> So, this should be applied still in an arch-dependent manner...
> Oh well.
>
Then it is something they will have to fix on their own. It's used by the
generic VM code for VMA writenotify (see mm/mmap.c).
next prev parent reply other threads:[~2010-01-16 10:20 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-04 11:23 Audio buffer mmap-ing on sh arch vs. cache aliasing problem Pawel MOLL
2008-09-04 11:23 ` Pawel MOLL
2008-09-16 18:18 ` [alsa-devel] " Takashi Iwai
2008-09-16 18:18 ` Takashi Iwai
2008-09-21 1:13 ` Paul Mundt
2008-09-21 1:13 ` Paul Mundt
2008-09-25 14:55 ` Pawel MOLL
2008-09-25 14:55 ` [alsa-devel] Audio buffer mmap-ing on sh arch vs. cache Pawel MOLL
2008-09-26 10:04 ` [alsa-devel] Audio buffer mmap-ing on sh arch vs. cache aliasing problem Takashi Iwai
2008-09-26 10:04 ` Takashi Iwai
2008-09-26 10:30 ` Paul Mundt
2008-09-26 10:30 ` [alsa-devel] " Paul Mundt
2008-09-26 11:04 ` Takashi Iwai
2008-09-26 11:04 ` Takashi Iwai
2008-09-26 11:25 ` Pawel MOLL
2008-09-26 11:25 ` [alsa-devel] Audio buffer mmap-ing on sh arch vs Pawel MOLL
2008-09-26 12:38 ` Audio buffer mmap-ing on sh arch vs. cache aliasing problem Takashi Iwai
2008-09-26 12:38 ` [alsa-devel] " Takashi Iwai
2010-01-15 0:04 ` Paul Mundt
2010-01-15 0:04 ` Paul Mundt
2010-01-16 10:05 ` Takashi Iwai
2010-01-16 10:05 ` Takashi Iwai
2010-01-16 10:20 ` Paul Mundt [this message]
2010-01-16 10:20 ` Paul Mundt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100116102036.GA32696@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=alsa-devel@alsa-project.org \
--cc=linux-sh@vger.kernel.org \
--cc=pawel.moll@st.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.