Non-atomic code
Going through other drivers for ideas to write mine I notice lots of non-atomic code where the instructions say there shouldn't be code that can sleep eg
http://sosdg.org/~coywolf/lxr/source/sound/mips/au1x00.c?v=2.6.15#L143
which includes:
kmalloc(sizeof(au1000_period_t), GFP_KERNEL);
In a function called from the trigger callback.
How important is it that the code is atomic? it would make my life easier if it didn't need to be!
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
At Sun, 26 Feb 2006 19:18:03 +0000,
Quoted 7 lines · Adrian McMenamin
Going through other drivers for ideas to write mine I notice lots of non-atomic code where the instructions say there shouldn't be code that can sleep eg
http://sosdg.org/~coywolf/lxr/source/sound/mips/au1x00.c?v=2.6.15#L143
Quoted 8 lines
which includes:
kmalloc(sizeof(au1000_period_t), GFP_KERNEL);In a function called from the trigger callback.
How important is it that the code is atomic? it would make my life easier if it didn't need to be!
The atomicity is important as well as the life isn't always easy.
The trigger callback is designed basically to be executed immediately (as it name stands). The jobs that may take long time, i.e. setting up the hardware to be ready for start, should be done in prepare callback instead.
In your case, the whole au1000_period_t chunk allocations should be moved to prepare callback.
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642