From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15DDB29A1; Tue, 17 Feb 2026 20:51:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771361463; cv=none; b=U9S1pdfAkQuY55ZPKAGtSzqSgonpuUKkQUOTXSpdW9htmHqB8N1a3Yi4VYU0KrlrGRIrn7L7BCjIsCipz0WqJX3mdOAj9EDgQZGlJhKAMXaF5oC2b09eOWRAEpFGkIx4mjxcStlppSnHj/S4nvdgbdkRm2o397xJEzup2CcqzoU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771361463; c=relaxed/simple; bh=xPTGw1Mv7A+buWiU3hmTe3EMigVKybumodTuzBGPGg8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OVrd0h9ey3XVZT0NDW7E47vHpGkxRpfhL2O8MUEFV/0nxbn2kOA/76VYC5wx3eSWOBrnoc0eS8lDEjzQrfpG6K50O1mXH0gwoQQmskZg7lT/uebG9whgFYiCw3Zv6gkXu+1fB22zdRuGTcnet198vol6AwHRGp2GSBaGRh1EG2Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bZxqvWiM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="bZxqvWiM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7808AC4CEF7; Tue, 17 Feb 2026 20:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1771361463; bh=xPTGw1Mv7A+buWiU3hmTe3EMigVKybumodTuzBGPGg8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bZxqvWiMRwfH2Lfs6mtLFKs3k5O1z+ICsQJPIuXYuxMpUxYZo+D2fizvv70uWNKbR MlHPMXIhtARqL7+N4NwKd/IHuNkcS4XXvQihxfIAWaQmYoOWqMwTrgtlzNLrYxg7pO FlYiZ0eJpg1oBEg5OX1cjyB+5LslV0fcpZ3WlYMk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ziyi Guo , Mark Brown , Sasha Levin Subject: [PATCH 6.18 23/43] ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put() Date: Tue, 17 Feb 2026 21:32:03 +0100 Message-ID: <20260217200007.355268296@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260217200006.470920131@linuxfoundation.org> References: <20260217200006.470920131@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ziyi Guo [ Upstream commit f514248727606b9087bc38a284ff686e0093abf1 ] fsl_xcvr_activate_ctl() has lockdep_assert_held(&card->snd_card->controls_rwsem), but fsl_xcvr_mode_put() calls it without acquiring this lock. Other callers of fsl_xcvr_activate_ctl() in fsl_xcvr_startup() and fsl_xcvr_shutdown() properly acquire the lock with down_read()/up_read(). Add the missing down_read()/up_read() calls around fsl_xcvr_activate_ctl() in fsl_xcvr_mode_put() to fix the lockdep assertion and prevent potential race conditions when multiple userspace threads access the control. Signed-off-by: Ziyi Guo Link: https://patch.msgid.link/20260202174112.2018402-1-n7l8m4@u.northwestern.edu Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/fsl_xcvr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c index 58db4906a01d5..51669e5fe8888 100644 --- a/sound/soc/fsl/fsl_xcvr.c +++ b/sound/soc/fsl/fsl_xcvr.c @@ -223,10 +223,13 @@ 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.51.0