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=1796130208; b=ONI54exZKyCQnpM9/e0QMTgU3bfydQe1dNDiinGgtBumaE4QFu0Py7cJmMFWK9savh4o jVrqmUtuLFny9EhLAiR5JUBr2NO/XvZQ/PX+IUocoyF2rmfuOGFpDehaA3NPqq0tIOA5g Y1g7lbVBTlf2UC31izcJQz+/F8SctakjRmBPtZtaJEgeDAQKZNnqEQMwuD1z3b+2BxQo/ 4vPmcS+QcHIkOVoPDAGSQ0sIyXbFcWcAnNc7WqIZSBCTwa0HDyZiWvLCijccmLB5MPifm tczEg8RFkGNTxe8KPMUGDvspvutV7EII30HMVrPrWYqsVIyTuCbafhaU6jYglI3kpxQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796130208; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=8Jido+XKFNjwLrFdpoNW9ssORgaukRWRRoBbetwsd/c=; b=j0WsB36gIOq2774GfaHiPFsWL49bkbZnwekZqjqw4tY0lblZ6XdIuxCD+V9xdYc3tSIz WacC5tilGagHbP9Ri7ZHVccN2YLkTyZhZcTi3dxgZH3CfKNx5sowsptCT/lBp1XdrgrwV 7cMaJcd9DCJdSaD/jynrw/XQl3N83J7ykD6bu5kUIb3v6MuM6c9+VBx6wQF7w1oetPsBw fpUYUxdWPy8HxsgdeRMhOWxGduAi7H4za9C7SyycppgME+4HZ8jx4bygMgEHP9wm6/mpH nRS95Mg9Wa7MnJUujARHolxOyZDRPAkSgSQYLw1ZuTZcx/dNugRFVWvjPtvJ4hhPuQw== 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=YCSwJf4O; 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 B3529606A320; Tue, 1 Dec 2026 13:03:28 +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=YCSwJf4O Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1195C1F000C1; Tue, 1 Dec 2026 13:03:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796130208; bh=8Jido+XKFNjwLrFdpoNW9ssORgaukRWRRoBbetwsd/c=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=YCSwJf4ODzRSX6tCmvhEEBfGGxs2gfjJ9AIjckwOnnl9yqAigHdvfZLePZfmQpbA8 FvhOJJhTSq6P5ljNuMFlZ0CbBxb6t1bufTYj3EaGDxScV5fQ5LzWSNmcf7DHfXd6Uu od4Bqljh+KXRnmxJodxDPqS/ervvg4ZJ7tRLUznvwGKeAsVuQpeiLG2iN8VQtw+895 D2DTbm/WFI4iLbtglsYrgAwM6KdXlhSfnxXs+h2d7D41RbRGX7c2zBhtZ3Ko6VOn/l c11+vLVbBAooXy7EsUaKIPpp+DPID7mapcgGu3h/SR2ObcLuVNNeNyAbjLGxyOZLuZ +Fgk68UOW2zRg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v4 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: <20261201124753.196748-7-srinivas.kandagatla@oss.qualcomm.com> References: <20261201124753.196748-1-srinivas.kandagatla@oss.qualcomm.com> <20261201124753.196748-7-srinivas.kandagatla@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 13:03:27 +0000 X-Mailing-List: devicetree@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 5d2938219182b5ec30c59b2d10fc736bdd774d75 Author: Ravi Hothi ASoC: codecs: wsa884x: add VI sense capture DAI This commit moves the VI sense port from the playback sink ports to a dedicated source port and adds a VI capture DAI with its own SoundWire stream runtime and DAI operations. > 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 0 early when wsa884x->port_enable[WSA884X_PORT_VISENSE] is false leave wsa884x->vi_sruntime unconfigured and cause PCM prepare to fail with -EINVAL? Unlike wsa884x_hw_params(), which still calls sdw_stream_add_slave() with 0 ports, skipping sdw_stream_add_slave() here never transitions vi_sruntime->state to SDW_STREAM_CONFIGURED. When the VISENSE Switch mixer control is off (its default at probe), a direct capture prepare or a second hw_params and prepare after hw_free on a multi_direction_codecs link will find vi_sruntime->state in SDW_STREAM_ALLOCATED or SDW_STREAM_RELEASED: sound/soc/qcom/sdw.c:qcom_snd_sdw_prepare() { ... /* 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); ... } After qcom_swrm_hw_free() -> sdw_stream_remove_master() sets vi_sruntime->state to SDW_STREAM_RELEASED, qcom_snd_sdw_prepare() no longer skips sr_opp and calls sdw_prepare_stream(), which rejects SDW_STREAM_RELEASED with -EINVAL and tears down playback. In addition, if hw_params is called again without an intervening hw_free after disabling VISENSE Switch, returning early leaves the previously added slave port attached to vi_sruntime. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201124753.1967= 48-1-srinivas.kandagatla@oss.qualcomm.com?part=3D6