Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "ALSA: firewire-lib: obsolete workqueue for period update"

prepare resolution of AB/BA deadlock competition for substream lock:
restore workqueue previously used for process context:

revert commit b5b519965c4c ("ALSA: firewire-lib: obsolete workqueue
for period update")

Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/kwryofzdmjvzkuw6j3clftsxmoolynljztxqwg76hzeo4simnl@jn3eo7pe642q/
Signed-off-by: Edmund Raile <edmund.raile@protonmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240730195318.869840-2-edmund.raile@protonmail.com

authored by

Edmund Raile and committed by
Takashi Iwai
6ccf9984 3c0b6f92

+16
+15
sound/firewire/amdtp-stream.c
··· 77 77 // overrun. Actual device can skip more, then this module stops the packet streaming. 78 78 #define IR_JUMBO_PAYLOAD_MAX_SKIP_CYCLES 5 79 79 80 + static void pcm_period_work(struct work_struct *work); 81 + 80 82 /** 81 83 * amdtp_stream_init - initialize an AMDTP stream structure 82 84 * @s: the AMDTP stream to initialize ··· 107 105 s->flags = flags; 108 106 s->context = ERR_PTR(-1); 109 107 mutex_init(&s->mutex); 108 + INIT_WORK(&s->period_work, pcm_period_work); 110 109 s->packet_index = 0; 111 110 112 111 init_waitqueue_head(&s->ready_wait); ··· 350 347 */ 351 348 void amdtp_stream_pcm_prepare(struct amdtp_stream *s) 352 349 { 350 + cancel_work_sync(&s->period_work); 353 351 s->pcm_buffer_pointer = 0; 354 352 s->pcm_period_pointer = 0; 355 353 } ··· 626 622 } 627 623 } 628 624 } 625 + } 626 + 627 + static void pcm_period_work(struct work_struct *work) 628 + { 629 + struct amdtp_stream *s = container_of(work, struct amdtp_stream, 630 + period_work); 631 + struct snd_pcm_substream *pcm = READ_ONCE(s->pcm); 632 + 633 + if (pcm) 634 + snd_pcm_period_elapsed(pcm); 629 635 } 630 636 631 637 static int queue_packet(struct amdtp_stream *s, struct fw_iso_packet *params, ··· 1924 1910 return; 1925 1911 } 1926 1912 1913 + cancel_work_sync(&s->period_work); 1927 1914 fw_iso_context_stop(s->context); 1928 1915 fw_iso_context_destroy(s->context); 1929 1916 s->context = ERR_PTR(-1);
+1
sound/firewire/amdtp-stream.h
··· 191 191 192 192 /* For a PCM substream processing. */ 193 193 struct snd_pcm_substream *pcm; 194 + struct work_struct period_work; 194 195 snd_pcm_uframes_t pcm_buffer_pointer; 195 196 unsigned int pcm_period_pointer; 196 197 unsigned int pcm_frame_multiplier;