diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-03-25 02:51:54 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-03-25 06:13:12 -0400 |
commit | 3674f19dabd15f9541079a588149a370d888f4e6 (patch) | |
tree | 4a963fa23c738536cc935000d07f2ebebcc8e00f /sound/core | |
parent | 20b67dddcc5f29d3d0c900225d85e0ac655bc69d (diff) |
ALSA: vmalloc buffers should use normal mmap
It's a big no-no to use pgprot_noncached() when mmap'ing such buffers
into userspace since they are mapped cachable in kernel space.
This can cause all sort of interesting things ranging from to garbled
sound to lockups on various architectures. I've observed that usb-audio
is broken on powerpc 4xx for example because of that.
Also remove the now unused snd_pcm_lib_mmap_noncached(). It's
an arch business to know when to use uncached mappings, there's
already hacks for MIPS inside snd_pcm_default_mmap() and other
archs are supposed to use dma_mmap_coherent().
(See my separate patch that adds dma_mmap_coherent() to powerpc)
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/pcm_native.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index ae42b6509ce4..fe5c8036beba 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -3201,15 +3201,6 @@ int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, | |||
3201 | EXPORT_SYMBOL(snd_pcm_lib_mmap_iomem); | 3201 | EXPORT_SYMBOL(snd_pcm_lib_mmap_iomem); |
3202 | #endif /* SNDRV_PCM_INFO_MMAP */ | 3202 | #endif /* SNDRV_PCM_INFO_MMAP */ |
3203 | 3203 | ||
3204 | /* mmap callback with pgprot_noncached */ | ||
3205 | int snd_pcm_lib_mmap_noncached(struct snd_pcm_substream *substream, | ||
3206 | struct vm_area_struct *area) | ||
3207 | { | ||
3208 | area->vm_page_prot = pgprot_noncached(area->vm_page_prot); | ||
3209 | return snd_pcm_default_mmap(substream, area); | ||
3210 | } | ||
3211 | EXPORT_SYMBOL(snd_pcm_lib_mmap_noncached); | ||
3212 | |||
3213 | /* | 3204 | /* |
3214 | * mmap DMA buffer | 3205 | * mmap DMA buffer |
3215 | */ | 3206 | */ |