Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
941a74ca
Commit
941a74ca
authored
Sep 15, 2014
by
Takashi Iwai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALSA: Update document about PCM nonatomic ops
Signed-off-by:
Takashi Iwai
<
tiwai@suse.de
>
parent
3b73cfe5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
+23
-5
Documentation/DocBook/writing-an-alsa-driver.tmpl
Documentation/DocBook/writing-an-alsa-driver.tmpl
+23
-5
No files found.
Documentation/DocBook/writing-an-alsa-driver.tmpl
View file @
941a74ca
...
...
@@ -2742,7 +2742,9 @@ struct _snd_pcm_runtime {
<para>
Another note is that this callback is non-atomic
(schedulable). This is important, because the
(schedulable) as default, i.e. when no
<structfield>
nonatomic
</structfield>
flag set.
This is important, because the
<structfield>
trigger
</structfield>
callback
is atomic (non-schedulable). That is, mutexes or any
schedule-related functions are not available in
...
...
@@ -2900,8 +2902,9 @@ struct _snd_pcm_runtime {
</para>
<para>
As mentioned, this callback is atomic. You cannot call
functions which may sleep.
As mentioned, this callback is atomic as default unless
<structfield>
nonatomic
</structfield>
flag set, and
you cannot call functions which may sleep.
The trigger callback should be as minimal as possible,
just really triggering the DMA. The other stuff should be
initialized hw_params and prepare callbacks properly
...
...
@@ -2936,7 +2939,7 @@ struct _snd_pcm_runtime {
</para>
<para>
This callback is also atomic.
This callback is also atomic
as default
.
</para>
</section>
...
...
@@ -2972,7 +2975,7 @@ struct _snd_pcm_runtime {
is useful only for such a purpose.
</para>
<para>
This callback is atomic.
This callback is atomic
as default
.
</para>
</section>
...
...
@@ -3175,6 +3178,21 @@ struct _snd_pcm_runtime {
called with local interrupts disabled.
</para>
<para>
The recent changes in PCM core code, however, allow all PCM
operations to be non-atomic. This assumes that the all caller
sides are in non-atomic contexts. For example, the function
<function>
snd_pcm_period_elapsed()
</function>
is called
typically from the interrupt handler. But, if you set up the
driver to use a threaded interrupt handler, this call can be in
non-atomic context, too. In such a case, you can set
<structfield>
nonatomic
</structfield>
filed of
<structname>
snd_pcm
</structname>
object after creating it.
When this flag is set, mutex and rwsem are used internally in
the PCM core instead of spin and rwlocks, so that you can call
all PCM functions safely in a non-atomic context.
</para>
</section>
<section
id=
"pcm-interface-constraints"
>
<title>
Constraints
</title>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment