Skip to content

Commit 455c565

Browse files
tiwaibroonie
authored andcommitted
ASoC: sti: Fix deadlock via snd_pcm_stop_xrun() call
This is essentially a revert of the commit dc865fb ("ASoC: sti: Use snd_pcm_stop_xrun() helper"), which converted the manual snd_pcm_stop() calls with snd_pcm_stop_xrun(). The commit above introduced a deadlock as snd_pcm_stop_xrun() itself takes the PCM stream lock while the caller already holds it. Since the conversion was done only for consistency reason and the open-call with snd_pcm_stop() to the XRUN state is a correct usage, let's revert the commit back as the fix. Fixes: dc865fb ("ASoC: sti: Use snd_pcm_stop_xrun() helper") Reported-by: Daniel Palmer <daniel@0x0f.com> Cc: Arnaud POULIQUEN <arnaud.pouliquen@st.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20220315091319.3351522-1-daniel@0x0f.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> Link: https://lore.kernel.org/r/20220315164158.19804-1-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 54e1bf9 commit 455c565

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

sound/soc/sti/uniperif_player.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static irqreturn_t uni_player_irq_handler(int irq, void *dev_id)
9191
SET_UNIPERIF_ITM_BCLR_FIFO_ERROR(player);
9292

9393
/* Stop the player */
94-
snd_pcm_stop_xrun(player->substream);
94+
snd_pcm_stop(player->substream, SNDRV_PCM_STATE_XRUN);
9595
}
9696

9797
ret = IRQ_HANDLED;
@@ -105,7 +105,7 @@ static irqreturn_t uni_player_irq_handler(int irq, void *dev_id)
105105
SET_UNIPERIF_ITM_BCLR_DMA_ERROR(player);
106106

107107
/* Stop the player */
108-
snd_pcm_stop_xrun(player->substream);
108+
snd_pcm_stop(player->substream, SNDRV_PCM_STATE_XRUN);
109109

110110
ret = IRQ_HANDLED;
111111
}
@@ -138,7 +138,7 @@ static irqreturn_t uni_player_irq_handler(int irq, void *dev_id)
138138
dev_err(player->dev, "Underflow recovery failed\n");
139139

140140
/* Stop the player */
141-
snd_pcm_stop_xrun(player->substream);
141+
snd_pcm_stop(player->substream, SNDRV_PCM_STATE_XRUN);
142142

143143
ret = IRQ_HANDLED;
144144
}

sound/soc/sti/uniperif_reader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static irqreturn_t uni_reader_irq_handler(int irq, void *dev_id)
6565
if (unlikely(status & UNIPERIF_ITS_FIFO_ERROR_MASK(reader))) {
6666
dev_err(reader->dev, "FIFO error detected\n");
6767

68-
snd_pcm_stop_xrun(reader->substream);
68+
snd_pcm_stop(reader->substream, SNDRV_PCM_STATE_XRUN);
6969

7070
ret = IRQ_HANDLED;
7171
}

0 commit comments

Comments
 (0)