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 E93CB320CD9; Tue, 17 Feb 2026 20:40:00 +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=1771360801; cv=none; b=HSbfc2P+u2OCDNgoh9SP/1sDCpdFqfBSWQ1p81TIkQruAR8BjOo45bOrC8//j6eCxBAdAQUMAj3DPw168aIf3gMesQ9+y+qJYiJpYc1jqnSKckOx1XMYkRDFBVdXizOiZWNiAE6W6NodyD35vt9MHAzOPk3gie3KrGMVwR/N2Aw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771360801; c=relaxed/simple; bh=1SfEfwad2A3VQf50em4YpQBDdgmaBLi008ARNN76Vv4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hhXW0IEYhw0Knuo2Xplg6sJi/nD831se25YU7LK7qpmM3yQQHwHHD4hbYntL594WBJ9pprd3x9klg5CxgX76PFQa1JtFEYJdvmXfWY10Nemy5r5unPvEzdvEkpsud4pbLVXbJKBSPomBH1LKvBMZrQyq72+/WDUvSrK0+oCFrTk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=V8kwtxrp; 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="V8kwtxrp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F2C5C4CEF7; Tue, 17 Feb 2026 20:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1771360800; bh=1SfEfwad2A3VQf50em4YpQBDdgmaBLi008ARNN76Vv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V8kwtxrpKVutwpyDDWlyCx37kydXsxo3xyqGywzcKYHshHOH/C2uqwgQmkX46RAW2 rWSJvBMTaBCkSBYnpKWQc4OEZh5GdfDufIo7KKZNmNfQZLp83mR/wHbqy9LRgcQHt4 gfJILieH/dOHE3e0d9P9422SSVikq8w9fQXLPT3Y= 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.6 19/39] ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put() Date: Tue, 17 Feb 2026 21:30:41 +0100 Message-ID: <20260217200004.957584167@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260217200004.221651386@linuxfoundation.org> References: <20260217200004.221651386@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.6-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 90a0a24c05d84..3a5ab8b536728 100644 --- a/sound/soc/fsl/fsl_xcvr.c +++ b/sound/soc/fsl/fsl_xcvr.c @@ -206,10 +206,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