From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@lists.sourceforge.net
Subject: Re: snd_pcm_lib_preallocate_pages_for_all
Date: Mon, 05 Jul 2004 11:17:28 +0200 [thread overview]
Message-ID: <s5h8ydy95jr.wl@alsa2.suse.de> (raw)
In-Reply-To: <20040705100038.B17721@flint.arm.linux.org.uk>
At Mon, 5 Jul 2004 10:00:39 +0100,
Russell King wrote:
>
> On Mon, Jul 05, 2004 at 11:56:25AM +0300, Bo Henriksen wrote:
> > It now crashes again. I have tried to preallocate the buffer using
> > dma_alloc_coherent and free it with dma_free_coherent. This succeeds and
> > I am using this in other drivers as well. I guess I am missing something
> > else?
>
> Yes, ALSA assumes that memory returned from dma_alloc_coherent is
> kernel direct mapped memory. ALSA is wrong in that assumption.
> Hopefully ALSA people can help you further.
The simplest solution is to disable mmap on your driver.
(i.e. removing SNDRV_PCM_INFO_MMAP from info field of hw struct).
The ALSA core part believes that the buffer is mmappable as long as
that flag is set, regardless whether it's allocated via
dma_alloc_coherent() or anything else.
I have a hack on my local tree to adapt the new dma_to_*() macros for
ARM, but it's not clean enough yet for merging to the main ALSA tree.
I hope in future the kernel will have a support function for easier
mmap as Russell proposed on lkml.
Takashi
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
next prev parent reply other threads:[~2004-07-05 9:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-05 8:56 snd_pcm_lib_preallocate_pages_for_all Bo Henriksen
2004-07-05 9:00 ` snd_pcm_lib_preallocate_pages_for_all Russell King
2004-07-05 9:17 ` Takashi Iwai [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-07-05 10:57 snd_pcm_lib_preallocate_pages_for_all Bo Henriksen
2004-07-05 11:10 ` snd_pcm_lib_preallocate_pages_for_all Takashi Iwai
2004-07-06 8:34 ` snd_pcm_lib_preallocate_pages_for_all Jaroslav Kysela
2004-07-05 7:03 snd_pcm_lib_preallocate_pages_for_all Bo Henriksen
2004-07-05 8:15 ` snd_pcm_lib_preallocate_pages_for_all Russell King
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=s5h8ydy95jr.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@lists.sourceforge.net \
/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.