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=1796393464; b=f9w4RaWY6NbfUEwbpvLqnXGSFv9+KmU79SZfAZiEZrKkhcY57GBzCSxJ4tMPwFCMgNWz Z1Q9amJ4JaOF6On1Zsy+4KQj8phsU1Rv1jCcMmhEz9ZtkEYY93yIXNpzwfWqqP9SD/9/7 MYfeCMPXkZW4ejo2Fhh5veeYg8Gjcl7k1vTjoySyQXVCBIFK2UfOx9dHPBJbI6M3Q1q7g b8oV+y8ZqsjRaQvzMwL6t4VMkv3Yb9BiCHg86JlYz6SYJU9BMsHf1hb9tm17SOWiNBKtX HAhM0fhfi476k8Uofj5Eegx+fxBwDW/TVx1OCTLn0u/TuyV5looO5IP/Sq+Rfa198aw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796393464; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=4qEDliMmdB+wf9FpKEjmHhH1noogUjEWdoBnBHO6LKs=; b=jSKHOggku5K+Mqo1kOjkYbVbLtK5EOW3mMSYTUIZwZgEgNaE22H5QLmcJN+mFqKbzwj0 teTwn/BjkodlpT1W6AuT/7IHFRMv5mXPWl6rxQpsMinKRuBvAKRCg5PObKLTnlj4rdFo6 Xl1HZiXSgLd9zMF/aiYmmFXuFyGDGLV9Dm2wLHn2aZRsLNzk7TlkX+ewxLX/22AyHHaUE EnWvM1waSOlpXrN1wnYOoPR9EcLLZ3R4+x9gF6s7yopiFa3XpD5n7cf4rfl6O6Kaz5b41 QjiJG9pNXSZULQwQ48C3y9tXuiD0kkAtTxU0H3sZiy8YYrkfuKfmc+9kKgKXagJlkag== 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=Xjtr2elv; 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 2D0C4606A32C; Fri, 4 Dec 2026 14:11:03 +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=Xjtr2elv Received: by smtp.kernel.org (Postfix) with ESMTPSA id 861E11F000C2; Fri, 4 Dec 2026 14:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796393463; bh=4qEDliMmdB+wf9FpKEjmHhH1noogUjEWdoBnBHO6LKs=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Xjtr2elvOtoxbXBETufU2P3X/17mjhWCevMUsYSZWsnxJ3E7tRlkRsap/oU8EklTq c37K7N6vBYAQEgojRvErpTPIVFHHe8NTKMP7YWH5tmy2gkcNP+klwQkhakniIjlYSj wu97KCcEuARzMYlXBsx3XlWFAr7jFCQePtkXk/vYKHssqdkf/ZZlIc5ut17HfrfE9Y 4x4yVIbLUpEJXpM4TbIvrYN3Lxaf3UVQLYqv4mFwt+9ZL6Fv5k0V37dkHQNtzoWi0M fptVaE0SqMNKuQsAk9yZ2SaexP5wzq3byE23+3SU1eA/3bLURQ1018FjktJ/ANpuEt kcYCMjVHH4BkQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v5 20/24] ASoC: qcom: x1e80100: carry WSA VI feedback on the WSA Playback BE link 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-21-srinivas.kandagatla@oss.qualcomm.com> References: <20261204113101.1141644-1-srinivas.kandagatla@oss.qualcomm.com> <20261204113101.1141644-21-srinivas.kandagatla@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 14:11:03 +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 2 potential issues to consider: - [High] ASoC: qcom: sdw: SDW_STREAM_RELEASED breaks multi-direction VI prepare - [High] ASoC: qcom: sdw VI stream state and m_rt_count break on hw_free/hw_params -- commit fcb4d5953ce1c17d2a685b1658cf4d75828397a0 Author: Srinivas Kandagatla ASoC: qcom: x1e80100: carry WSA VI feedback on the WSA Playback BE link This commit enables multi_direction_codecs and a capture params fixup on the WSA_CODEC_DMA_RX_0 BE link when VI codec DAIs are present so speaker V/I sense feedback runs alongside playback. > diff --git a/sound/soc/qcom/x1e80100.c b/sound/soc/qcom/x1e80100.c > index 4fe86ec062c40..745975574658c 100644 > --- a/sound/soc/qcom/x1e80100.c > +++ b/sound/soc/qcom/x1e80100.c [ ... ] > @@ -386,6 +423,19 @@ static void x1e80100_add_be_ops(struct snd_soc_card = *card) > link->be_hw_params_fixup =3D x1e80100_be_hw_params_fixup; > link->ops =3D &x1e80100_be_ops; > } > + > + /* > + * The WSA playback link also carries the VI codec DAIs when > + * the DT wires them in. Only advertise multi_direction_codecs > + * then, so stock setups without VI feedback do not pay the > + * extra TX startup/prepare path. > + */ > + if (link->id =3D=3D WSA_CODEC_DMA_RX_0 && > + x1e80100_link_has_vi_codec(link)) { > + link->multi_direction_codecs =3D 1; > + link->multi_direction_params_fixup =3D > + x1e80100_wsa_vi_params_fixup; > + } > } > } [Severity: High] Can enabling multi_direction_codecs cause speaker playback prepare to fail with -EINVAL after an hw_free/hw_params cycle while the VISENSE Switch is off? On hw_free without closing the PCM, qcom_swrm_hw_free() calls sdw_stream_remove_master(), which sets the VI capture stream's state to SDW_STREAM_RELEASED. On the next hw_params with VISENSE Switch off (the wsa884x default), wsa884x_vi_hw_params() skips sdw_stream_add_slave() and qcom_swrm_hw_params() leaves sr_opp->state at 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); ... } Because SDW_STREAM_RELEASED !=3D SDW_STREAM_ALLOCATED, qcom_snd_sdw_prepare= () calls sdw_prepare_stream(sr_opp), which rejects SDW_STREAM_RELEASED with -EINVAL and aborts playback prepare. qcom_snd_sdw_hw_free() has the same state !=3D SDW_STREAM_ALLOCATED check a= nd will also call sdw_disable_stream() and sdw_deprepare_stream() on an unconfigured released stream. Checking for the configured/active states instead of !=3D SDW_STREAM_ALLOCATED would avoid both. [Severity: High] Does enabling multi_direction_codecs also leak stream->m_rt_count on the VI capture stream across hw_params/hw_free cycles when multiple capture DAIs share a SoundWire controller? With VISENSE Switch off, wsa884x_vi_hw_params() returns early without adding a slave, but qcom_swrm_stream_alloc_ports() still calls sdw_stream_add_master() with nports =3D 0 for each capture DAI on the bus. drivers/soundwire/stream.c:sdw_stream_add_master() { ... if (!sdw_master_port_allocated(m_rt)) { ret =3D sdw_master_port_alloc(m_rt, num_ports); if (ret) goto alloc_error; stream->m_rt_count++; } ... } Because sdw_master_port_allocated() tests !list_empty(&m_rt->port_list), which remains false when num_ports is 0, each extra capture DAI on the same controller increments stream->m_rt_count again while reusing the single m_rt. On hw_free, sdw_stream_remove_master() decrements m_rt_count only once per bus, leaking +1 per extra capture DAI per cycle. Once the leaked m_rt_count reaches bus->hw_sync_min_links (3 on SWRM v2.0.0+), a later prepare with VISENSE Switch turned on takes the multi-link path in sdw_bank_switch() -> sdw_transfer_defer(), which fails with -ENOTSUPP because qcom_swrm_ops does not implement .xfer_msg_defer, breaking playback until the PCM is closed and reopened. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204113101.1141= 644-1-srinivas.kandagatla@oss.qualcomm.com?part=3D20