public inbox for linuxppc-dev@ozlabs.org
 help / color / mirror / Atom feed
* [PATCH] Revert "ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put()"
@ 2026-02-10 14:38 Ziyi Guo
  2026-02-10 14:40 ` Mark Brown
  2026-02-10 17:09 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Ziyi Guo @ 2026-02-10 14:38 UTC (permalink / raw)
  To: Mark Brown, Alexander Stein
  Cc: Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-sound,
	linuxppc-dev, linux-kernel, Ziyi Guo

This reverts commit f514248727606b9087bc38a284ff686e0093abf1.

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.

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>
---
 sound/soc/fsl/fsl_xcvr.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c
index 0b9dd64b9a82..a268fb81a2f8 100644
--- a/sound/soc/fsl/fsl_xcvr.c
+++ b/sound/soc/fsl/fsl_xcvr.c
@@ -223,13 +223,10 @@ static int fsl_xcvr_mode_put(struct snd_kcontrol *kcontrol,
 
 	xcvr->mode = snd_soc_enum_item_to_val(e, item[0]);
 
-	down_read(&card->snd_card->controls_rwsem);
 	fsl_xcvr_activate_ctl(dai, fsl_xcvr_arc_mode_kctl.name,
 			      (xcvr->mode == FSL_XCVR_MODE_ARC));
 	fsl_xcvr_activate_ctl(dai, fsl_xcvr_earc_capds_kctl.name,
 			      (xcvr->mode == FSL_XCVR_MODE_EARC));
-	up_read(&card->snd_card->controls_rwsem);
-	
 	/* Allow playback for SPDIF only */
 	rtd = snd_soc_get_pcm_runtime(card, card->dai_link);
 	rtd->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count =
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Revert "ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put()"
  2026-02-10 14:38 [PATCH] Revert "ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put()" Ziyi Guo
@ 2026-02-10 14:40 ` Mark Brown
  2026-02-10 17:09 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-02-10 14:40 UTC (permalink / raw)
  To: Ziyi Guo
  Cc: Alexander Stein, Shengjiu Wang, Xiubo Li, Fabio Estevam,
	Nicolin Chen, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	linux-sound, linuxppc-dev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 839 bytes --]

On Tue, Feb 10, 2026 at 02:38:09PM +0000, Ziyi Guo wrote:

> This reverts commit f514248727606b9087bc38a284ff686e0093abf1.

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.

Please include human readable descriptions of things like commits and
issues being discussed in e-mail in your mails, this makes them much
easier for humans to read especially when they have no internet access.
I do frequently catch up on my mail on flights or while otherwise
travelling so this is even more pressing for me than just being about
making things a bit easier to read.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Revert "ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put()"
  2026-02-10 14:38 [PATCH] Revert "ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put()" Ziyi Guo
  2026-02-10 14:40 ` Mark Brown
@ 2026-02-10 17:09 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-02-10 17:09 UTC (permalink / raw)
  To: Ziyi Guo
  Cc: Alexander Stein, Shengjiu Wang, Xiubo Li, Fabio Estevam,
	Nicolin Chen, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	linux-sound, linuxppc-dev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 814 bytes --]

On Tue, Feb 10, 2026 at 02:38:09PM +0000, Ziyi Guo wrote:
> This reverts commit f514248727606b9087bc38a284ff686e0093abf1.
> 
> 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.

This doesn't apply against v6.19:

Applying: ASoC: fsl_xcvr: ASoC revert missing lock change in fsl_xcvr_mode_put()
error: sha1 information is lacking or useless (sound/soc/fsl/fsl_xcvr.c).
error: could not build fake ancestor
Patch failed at 0001 ASoC: fsl_xcvr: ASoC revert missing lock change in fsl_xcvr_mode_put()

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-10 17:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10 14:38 [PATCH] Revert "ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put()" Ziyi Guo
2026-02-10 14:40 ` Mark Brown
2026-02-10 17:09 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox