From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796074611; b=npQPFbsllv6C1OfQD4Usv5VcUzFQUIDtj/okEJ5cqDuD68kh3KhgMMJAP3WA2vsF7hyH MGHrJIMwOTdxOp3KHo1alzhn/2pYZpkK0qI9GSZrrf8uw3IVqkK4eYa+0qPWsdtW08Rab jRxp713TKkx3lna2CTFdMeLd97uWoSezQnwqdizz8nX+EkLTztgw0E0yCOfo/fX5mmQ6h uJt9fYjUUmsfxjRQrstBxUjMJpAKb79u2NY5qL7MSUpZtnh6iLFFjI6kNhQ3kri8aDWNU 8869H1g4ppex9mLSYErhmyAzhNzoKcq3veQNxVmH6qPApw/0ZXWLdJ7z6iUenzwb0HQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796074611; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=hi6EF4l+FMSWjlcumxD2BUi/04trd17GV+Kl4vCUAMU=; b=ExA0j0EaFk90GnTjEyXZrw0aXiT9BVA/lR1FDn3mDa3rU4iH7YmGo6WKdnU+P/Lygahb PPT02q7OTtif55Cf/qpn1CxdFjatkKHVnu/+0piKvaUeJyBYqCsW/a9zpjSB0meFnhWjs ANXL+AQ622jyCwE/uhA7FYoWc3qz649z9QtuviGABLCL1oe5PWjuUPIizlxjwdFmH2kHf Nb95CkAx7jdj4UM9Hhoz9DHlARMBQANeBCtYknlAXh0U1VhrcaSGeGKd9MRvAMWd2klRM nyifowtAioUiDxli5Q3d97n9XNRju5aiHIapOemOfA0veY00zBXSBlNs+ztcxOIpfzw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=baGl6JSL; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5036D606A325; Mon, 30 Nov 2026 21:36:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=baGl6JSL Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B2F01F00898; Mon, 30 Nov 2026 21:36:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796074610; bh=hi6EF4l+FMSWjlcumxD2BUi/04trd17GV+Kl4vCUAMU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=baGl6JSL/tmDGaqEHeiciy8SgQQNFTwwvPnmKbWAvlSDkuw1Ds3d/9kQV0LknHdEK HcdDmDfw83OzkzRD8V9dTSE/fN47rcWfejcFlfddWwFbG1pCcjZ+vp/ygG1SqOI1iW NZ9t07Eh0tLxx5be9bjTENlZjgUydUXjRp6PbJ9lQGNFX7+dLQhyESj4QVRl8yX1KL 63tuYQNpndlAKllIC/bI6GNo5pizkQ97vtU1MlCunxkYFadDyyub4oN8Vb+csaMNmI bsuGpHZ09ixm1SV9ng8aXAXfAtBzEsQi7awmDCEenqp6pW6f3basNfPUsLYW0kbqYP T7Ck2RGwKucRA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 06/24] ASoC: codecs: wsa884x: add VI sense capture DAI Reply-To: sashiko-reviews@lists.linux.dev To: "Srinivas Kandagatla" Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261130212258.7376-7-srinivas.kandagatla@oss.qualcomm.com> References: <20261130212258.7376-1-srinivas.kandagatla@oss.qualcomm.com> <20261130212258.7376-7-srinivas.kandagatla@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 21:36:50 +0000 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] ASoC: wsa884x: skip of sdw_stream_add_slave() in wsa884x_vi_hw_params() -- commit 2fa2f14769a60d3a9ba8b264a65cae8eba72c5d8 Author: Ravi Hothi ASoC: codecs: wsa884x: add VI sense capture DAI This commit moves the WSA884x VI sense port from the sink port list to a source port with its own capture DAI, ops, and SoundWire stream runtime. > diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c > index f58ce92c46d40..91aa004d7137b 100644 > --- a/sound/soc/codecs/wsa884x.c > +++ b/sound/soc/codecs/wsa884x.c [ ... ] > @@ -1767,6 +1774,27 @@ static const struct snd_soc_component_driver wsa88= 4x_component_drv =3D { > .num_dapm_routes =3D ARRAY_SIZE(wsa884x_audio_map), > }; > =20 > +static int wsa884x_vi_hw_params(struct snd_pcm_substream *substream, > + struct snd_pcm_hw_params *params, > + struct snd_soc_dai *dai) > +{ > + struct wsa884x_priv *wsa884x =3D dev_get_drvdata(dai->dev); > + > + if (!wsa884x->port_enable[WSA884X_PORT_VISENSE]) > + return 0; > + > + wsa884x->vi_port_config =3D wsa884x_pconfig[WSA884X_PORT_VISENSE]; > + wsa884x->vi_sconfig.frame_rate =3D params_rate(params); > + wsa884x->vi_sconfig.ch_count =3D 2; > + wsa884x->vi_sconfig.bps =3D 1; > + wsa884x->vi_sconfig.type =3D SDW_STREAM_PDM; > + wsa884x->vi_sconfig.direction =3D SDW_DATA_DIR_TX; > + > + return sdw_stream_add_slave(wsa884x->slave, &wsa884x->vi_sconfig, > + &wsa884x->vi_port_config, 1, > + wsa884x->vi_sruntime); > +} [Severity: High] Does returning early when port_enable[WSA884X_PORT_VISENSE] is false leave vi_sruntime unconfigured and break stream preparation? sdw_stream_add_slave() is what transitions a SoundWire stream runtime to SDW_STREAM_CONFIGURED (note that wsa884x_hw_params() calls it even when active_ports is 0). When the VISENSE Switch control is off, qcom_swrm_hw_params() still adds the master runtime to vi_sruntime, and a subsequent hw_free transitions vi_sruntime->state to SDW_STREAM_RELEASED in sdw_stream_remove_master(). If hw_params and prepare then run again on that substream while VISENSE is still off, wsa884x_vi_hw_params() leaves vi_sruntime in SDW_STREAM_RELEASED: sound/soc/qcom/sdw.c:qcom_snd_sdw_prepare() { ... if (rtd->dai_link->multi_direction_codecs) { struct sdw_stream_runtime *sr_opp =3D sruntime[substream->stream ^ 1]; /* Skip if no slave registered at hw_params (e.g. VI off) */ if (sr_opp && sr_opp->state !=3D SDW_STREAM_ALLOCATED) { ret =3D qcom_snd_sdw_prepare_dir(rtd, substream->stream ^ 1); ... } Because sr_opp->state is SDW_STREAM_RELEASED rather than SDW_STREAM_ALLOCATED (or on a direct capture substream where the primary direction is prepared unconditionally), qcom_snd_sdw_prepare_dir() calls sdw_prepare_stream(), which rejects the unconfigured state with -EINVAL and tears down playback. In addition, if hw_params is called again without an intervening hw_free after VISENSE Switch is turned from on to off, returning 0 early leaves the previously added slave runtime and VISENSE port attached to vi_sruntime. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130212258.7376= -1-srinivas.kandagatla@oss.qualcomm.com?part=3D6