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=1796387926; b=tZwaLSfN12XJud8x64vFMCSmB5/wmRxx7G21lPmIaJyiehaAnWiRWz5zf0ytc3fvc/XR BxVN+/0KBeKSjKCsZY/hP/yGlMTTk/4DMu3BYzfmigG4yHAbLuu89AD3hpabfTTeJqXyH 3e+17LrPL8RBw9igWnKTUU40m0ooYaxFVnHEF48bvA/r28EZgyvE0Dfz46t9fPQ5ZDGKT bxhC5PiXrNyG6gupRUWuVgzW/PFF2yw5L1WTct7RYAf3lO9ACmLXBaF1Mq5ObOt3J8W9+ 1kBbjRbnK4xVs5X+m4YROG+6//z+8X/uCY4b47HSCkxl8NmCmIh9HRWNfXFgO5acDAw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387926; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=+36PKm09LF7tCElj6G+rbp92rgAKmkZXgTd3E3L4zTg=; b=yvaBWNPFSlcXVcA0UdBbJH8204XAWz61g1MnUY6tyRaSBPwFxOge41aRcdwIW0Fa1FTy V6my1aNQDqUpjVDE2smanstXHTuSxY9kn1Cwswr/KEDDTVszLJQmOQoVyWRpM+iy9nt5F u+M7n6zz98a5ua7UcTv9M7wY+FmbSRrf7BzQsdGNag33Oxm2wovts4f22rCF/q+d28Sm2 J5aeeTVwQe3HK73vPxLaE1BRBzjA0mPegxhtlxfKYwTCHdhmUGFcKAbaW77uIJzrKIzTF RGcSH3ady0QGvHN+gBfFB+mrwfSByPjocgB+3b/wHBgAFMN+lFHvmHmhaphIaoXiIhw== 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="A/UIm7SN"; 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 14D66606A322; Fri, 4 Dec 2026 12:38:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=A/UIm7SN Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8AFC1F000CE; Fri, 4 Dec 2026 12:38:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796387925; bh=+36PKm09LF7tCElj6G+rbp92rgAKmkZXgTd3E3L4zTg=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=A/UIm7SNbYtb6TUYCBrcbGmd3Jj+jLTqgnOtY99jZCOX8WZXH81HJ18Zihq/X/cUq yFzq9pZpbrTSm0IdrDBHRzjK5gvQMRmKHQ3JAo/MdEPj/+8FDQzn95U0cl8WFTuXJT coRXs/wA7ZyxzdUnVMLa2ekxxN+PJuqZU9t2mrMGKL0OT2OKRDVv0Nd8q7yVTur+BN tx+JN+g5/tmlGgkzYhOjgQ8vOB7fj4NEbIIMN3ejI5zZA0gbbcN57Ja5TBJqoo5cIz +NPKgThfDE+qDQwHjieqW43lp+bLVAkR8wHkSDeiX6UJ2WrAEIO4iTAG9+ICyj8Qa6 6DLOliuosGomg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v5 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: <20261204113101.1141644-7-srinivas.kandagatla@oss.qualcomm.com> References: <20261204113101.1141644-1-srinivas.kandagatla@oss.qualcomm.com> <20261204113101.1141644-7-srinivas.kandagatla@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 12:38:45 +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 3 potential issues to consider: - [High] ASoC: wsa884x: wsa884x_vi_hw_params() early return restored in later patch - [Medium] ASoC: wsa884x: 0-based SoundWire port bitmasks in wsa884x_probe() - [Medium] ASoC: wsa884x: wsa884x_vi_hw_params() retains stale VI slave on ON->OFF -- commit 6c4b9dc62cf97c2e651c0b64607fa0cb3c6ee792 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 the source port list and adds a separate VI capture DAI with its own SoundWire stream runtime and DAI ops. > diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c > index f58ce92c46d40..abf9d88ec7a8a 100644 > --- a/sound/soc/codecs/wsa884x.c > +++ b/sound/soc/codecs/wsa884x.c [ ... ] > @@ -1767,6 +1774,29 @@ 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); > + unsigned int num_ports =3D 0; > + > + 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; > + > + if (wsa884x->port_enable[WSA884X_PORT_VISENSE]) { > + wsa884x->vi_port_config =3D wsa884x_pconfig[WSA884X_PORT_VISENSE]; > + num_ports =3D 1; > + } > + > + return sdw_stream_add_slave(wsa884x->slave, &wsa884x->vi_sconfig, > + &wsa884x->vi_port_config, num_ports, > + wsa884x->vi_sruntime); > +} [Severity: High] Does commit "ASoC: codecs: wsa884x: register the die temperature as a thermal zone" later in this series accidentally revert this block back to returning 0 early when port_enable[WSA884X_PORT_VISENSE] is false? With that early return restored, vi_sruntime is never configured when VISENSE Switch is off (its default state after probe). After hw_free() on an open substream, qcom_swrm_hw_free() calls sdw_stream_remove_master() and transitions vi_sruntime->state to SDW_STREAM_RELEASED. On the next hw_params() and prepare(), qcom_snd_sdw_prepare() only skips SDW_STREAM_ALLOCATED and calls sdw_prepare_stream(vi_sruntime), which rejects SDW_STREAM_RELEASED with -EINVAL and breaks speaker playback. If empty VI streams should be skipped instead of adding a zero-port slave, qcom_snd_sdw_prepare() and qcom_snd_sdw_hw_free() in commit "ASoC: qcom: sdw: add per-direction stream runtimes for multi_direction links" should skip both SDW_STREAM_ALLOCATED and SDW_STREAM_RELEASED. [Severity: Medium] Can repeated hw_params() calls without an intervening hw_free() leave the WSA884x slave runtime and DP5 port attached to vi_sruntime after VISENSE Switch is turned off? ALSA core (hw_params_state_check()) and ASoC DPCM (dpcm_be_dai_hw_params()) allow consecutive hw_params() calls without hw_free(). If VISENSE Switch is enabled on the first call and disabled before the second, wsa884x_vi_hw_params() never calls sdw_stream_remove_slave(). In this patch, sdw_stream_add_slave() sees sdw_slave_port_allocated(s_rt) is already true, keeps and reconfigures DP5 from the stale vi_port_config, and double-counts ch_count in sdw_config_stream(). Even with the early return later in the series, DP5 stays attached and enabled on prepare(). Calling sdw_stream_remove_slave(wsa884x->slave, wsa884x->vi_sruntime) when port_enable[WSA884X_PORT_VISENSE] is false detaches any stale port cleanly. [ ... ] > @@ -2091,9 +2156,11 @@ static int wsa884x_probe(struct sdw_slave *pdev, > WSA884X_MAX_SWR_PORTS)) > dev_dbg(dev, "Static Port mapping not specified\n"); > =20 > - pdev->prop.sink_ports =3D GENMASK(WSA884X_MAX_SWR_PORTS - 1, 0); > + pdev->prop.sink_ports =3D GENMASK(WSA884X_MAX_SWR_PORTS - 1, 0) & ~BIT(= WSA884X_PORT_VISENSE); > + pdev->prop.source_ports =3D BIT(WSA884X_PORT_VISENSE); > pdev->prop.simple_clk_stop_capable =3D true; > pdev->prop.sink_dpn_prop =3D wsa884x_sink_dpn_prop; > + pdev->prop.src_dpn_prop =3D wsa884x_src_dpn_prop; > pdev->prop.scp_int1_mask =3D SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARI= TY; [Severity: Medium] Should sink_ports and source_ports use 1-based SoundWire Data Port bit positions instead of 0-based enum wsa884x_port_ids values? SoundWire core defines source_ports and sink_ports as 1-based bitmasks covering Data Ports 1..14, matching dpn_prop[].num (where VISENSE is WSA884X_PORT_VISENSE + 1, or DP5). sdw_slave_sysfs_dpn_init() creates dpN_src and dpN_sink sysfs groups directly from each set bit. As written, source_ports sets bit 4 (dp4_src) instead of bit 5 (dp5_src), and sink_ports exposes an invalid dp0_sink and a misnumbered dp5_sink. Using GENMASK(WSA884X_MAX_SWR_PORTS, 1) & ~BIT(WSA884X_PORT_VISENSE + 1) and BIT(WSA884X_PORT_VISENSE + 1) matches the 1-based dpn_prop numbers. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204113101.1141= 644-1-srinivas.kandagatla@oss.qualcomm.com?part=3D6