Skip to content

Commit

Permalink
ALSA: firewire-lib: Restrict calling flush_context_completion() when …
Browse files Browse the repository at this point in the history
…context exists

Currently, drivers can bring XRUN state for PCM substreams when error to
queue packets or detecting discontinuity of packet. The application may try to
recover this state by calling snd_pcm_prepare().

Depending on each driver, .prepare() includes restart streaming. Then there
is a state that PCM substreams are running but isochronous contexts are
stopped. In this case, when .pointer() is called, it refers to error pointer.

This commit is for a prevention of this bug.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Sakamoto authored and Takashi Iwai committed May 26, 2014
1 parent 7b2d99f commit c8de6db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/firewire/amdtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ EXPORT_SYMBOL(amdtp_stream_start);
unsigned long amdtp_stream_pcm_pointer(struct amdtp_stream *s)
{
/* this optimization is allowed to be racy */
if (s->pointer_flush)
if (s->pointer_flush && amdtp_stream_running(s))
fw_iso_context_flush_completions(s->context);
else
s->pointer_flush = true;
Expand Down

0 comments on commit c8de6db

Please sign in to comment.