Skip to content
/ linux Public

Commit 29b2fbe

Browse files
haruki3hhhSasha Levin
authored andcommitted
ASoC: fsl_xcvr: Revert fix missing lock in fsl_xcvr_mode_put()
[ Upstream commit 9f16d96 ] This reverts commit f514248 ("ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put()"). The original patch attempted to acquire the card->controls_rwsem lock in fsl_xcvr_mode_put(). However, this function is called from the upper ALSA core function snd_ctl_elem_write(), which already holds the write lock on controls_rwsem for the whole put operation. So there is no need to simply hold the lock for fsl_xcvr_activate_ctl() again. Acquiring the read lock while holding the write lock in the same thread results in a deadlock and a hung task, as reported by Alexander Stein. Fixes: f514248 ("ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put()") Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com> Closes: https://lore.kernel.org/linux-sound/5056506.GXAFRqVoOG@steina-w/ Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu> Link: https://patch.msgid.link/20260210185714.556385-1-n7l8m4@u.northwestern.edu Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f8a5426 commit 29b2fbe

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

sound/soc/fsl/fsl_xcvr.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,10 @@ static int fsl_xcvr_mode_put(struct snd_kcontrol *kcontrol,
206206

207207
xcvr->mode = snd_soc_enum_item_to_val(e, item[0]);
208208

209-
down_read(&card->snd_card->controls_rwsem);
210209
fsl_xcvr_activate_ctl(dai, fsl_xcvr_arc_mode_kctl.name,
211210
(xcvr->mode == FSL_XCVR_MODE_ARC));
212211
fsl_xcvr_activate_ctl(dai, fsl_xcvr_earc_capds_kctl.name,
213212
(xcvr->mode == FSL_XCVR_MODE_EARC));
214-
up_read(&card->snd_card->controls_rwsem);
215-
216213
/* Allow playback for SPDIF only */
217214
rtd = snd_soc_get_pcm_runtime(card, card->dai_link);
218215
rtd->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count =

0 commit comments

Comments
 (0)