]> www.infradead.org Git - linux-platform-drivers-x86.git/commitdiff
ALSA: firewire-lib: fix the context to call snd_pcm_stop_xrun()
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sat, 5 Jun 2021 09:10:54 +0000 (18:10 +0900)
committerTakashi Iwai <tiwai@suse.de>
Sat, 5 Jun 2021 12:52:58 +0000 (14:52 +0200)
In the workqueue to queue wake-up event, isochronous context is not
processed, thus it's useless to check context for the workqueue to switch
status of runtime for PCM substream to XRUN. On the other hand, in
software IRQ context of 1394 OHCI, it's needed.

This commit fixes the bug introduced when tasklet was replaced with
workqueue.

Cc: <stable@vger.kernel.org>
Fixes: 2b3d2987d800 ("ALSA: firewire: Replace tasklet with work")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210605091054.68866-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/amdtp-stream.c

index e0faa6601966cae2a53e82e80b4a768d79997192..5805c5de39fbf7fc8c4011aa2e9433e4ab367ae1 100644 (file)
@@ -804,7 +804,7 @@ static void generate_pkt_descs(struct amdtp_stream *s, struct pkt_desc *descs,
 static inline void cancel_stream(struct amdtp_stream *s)
 {
        s->packet_index = -1;
-       if (current_work() == &s->period_work)
+       if (in_interrupt())
                amdtp_stream_pcm_abort(s);
        WRITE_ONCE(s->pcm_buffer_pointer, SNDRV_PCM_POS_XRUN);
 }