[alsa-devel] Interrupts and kmalloc in alsa modules
Lee Revell
rlrevell at joe-job.com
Tue Apr 10 23:59:19 CEST 2007
On 4/10/07, Ciaccia <ciacciax at yahoo.com> wrote:
> Could someone of you explain to me why I have to
> enable the interrupts before calling kmalloc? The
> strange thing is that the module never explicitly
> turns them off (I attached the file to the mail)
>
I guess you're allocating memory in the trigger callback which is
atomic meaning that the ALSA middle layer always calls it with
interrupts disabled. It's a bug to call a function that can sleep
with interrupts disabled.
The standard way to do it is to allocate your buffers in a callback
that can sleep like prepare. See numerous examples in other ALSA
drivers.
Of course without seeing your code, this is all guesswork...
Lee
More information about the Alsa-devel
mailing list