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=1796406729; b=ZcIkVH1koBy3bHVvAEzJBh7SmXOZU5j1t0MLLog5Q1STjdBf1+HWuz/jTUgP7QLkWT/J coW23lnvln8UxI+KigEjiRG+hcbqyESNZmK9vwUU5ovMB9VzG/cJ3Hronzo2i1tHiFFBV xIx/a6MSRsy6ya+VUP2KBQHY1j0PXOlGpE882Z/AlAacR7HN023XSPQJPbr4aJVZDysUh qlqQJ4fHuDSuYR4HHVS5G9rGwdH7VHuGhjNIJKWFqvYv8vbQhlLEZm4ND7hosl2Ihbwtq 12x5Dx3U+xgXn2GPSCPuMuhP4Qlkldotgo3UjDpnC1QU1Z2FClBIJ5Mo70yFmULIwdQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796406729; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=JBHfqQJRUM9romjIqPGHc3VS7mZzA8AMnwm7tqm3xF4=; b=dpUz9p6MHKd7VvZYBzSUHxFN3mj/y9Kd4QJ7mkEVv+8yQ2No/hP6YIZbAfXQkARqcfyB 7+SVcDJtKlT6GjIvcy+Vz5xLuD3pFkvhPpUmRg3c45Bv6vmQRBYperjJ6iRYLc6BQH4If z3UXZ00b+yevalXZby4QBQ3vB7tvVYcDGa/r06Qvh8suNGRmxxNQfpOZdBKFNFqSD6M0H 64X0jINGzOQXLCLAdccq+HiiwT/GgmyekaxEb1njFWpiiEUwrUNxLwy/DBSve0bnylAiN xY7L7NVc6qDj+GxuUNU/7YJADN2E/Rk/gBJiUQaRpm6UlqNcfFESsQ1h4GfVm9PmW3w== 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=AKC6ZjOR; 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 29CE9606A697; Fri, 4 Dec 2026 17:52:08 +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=AKC6ZjOR Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8421A1F00936; Fri, 4 Dec 2026 17:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796406728; bh=JBHfqQJRUM9romjIqPGHc3VS7mZzA8AMnwm7tqm3xF4=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=AKC6ZjORe0yq8fKp0x1x+bnx9Xvwa+sF+WLWALL+HPCjdrmeh7xbqui1yt3JiDCOi 82RJGQs0MvqwKr+Nj0ZqxzThbLFsKGEFcLbud3hPloQPgAgPdHdGVaeSneuW0ejBRL 3xwnXRmH576z8tofflo1GqtfAqlcz3B5OGnYPtUIdGgg5ZeqDdOJSA3FiAWZnPmL9P YRtyp4/JzdCxsGK8AvgX6jdbT1dsSX0thoe8zSYUS86sLCa+wBOfve2vV7JPfByHww fypXmOtkBebV4CGksfZjagRjorbb9d0eB0frfSgr+3WhwAn/rIR/CItLl46JylLPep rbRADeH53/flQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 18/19] ASoC: qcom: sdw: allow LPASS_CDC_DMA_WSA_RX0 as soundwire dai Reply-To: sashiko-reviews@lists.linux.dev To: "Neil Armstrong" Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261204-topic-sm8650-el2-v3-18-8384ef0ac751@linaro.org> References: <20261204-topic-sm8650-el2-v3-0-8384ef0ac751@linaro.org> <20261204-topic-sm8650-el2-v3-18-8384ef0ac751@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 17:52:08 +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: qcom_snd_is_dsp_bypass_link() misclassifies QAIF links - [High] ASoC: qcom: sleep in atomic trigger context on LPASS_CDC_DMA_WSA_RX0 -- commit 901b97812de99037ffb2d847d92ed32893b5f329 Author: Neil Armstrong ASoC: qcom: sdw: allow LPASS_CDC_DMA_WSA_RX0 as soundwire dai This commit adds qcom_snd_is_dsp_bypass_link() to identify DSP bypass links and restricts LPASS CPU DAI ID matching in qcom_snd_is_sdw_dai() to those links, while also adding LPASS_CDC_DMA_WSA_RX0 as a SoundWire DAI. > diff --git a/sound/soc/qcom/common.h b/sound/soc/qcom/common.h > index 37b185a4968f3..1af9c32505e61 100644 > --- a/sound/soc/qcom/common.h > +++ b/sound/soc/qcom/common.h > @@ -32,5 +32,14 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime= *rtd, > int qcom_snd_dp_jack_setup(struct snd_soc_pcm_runtime *rtd, > struct snd_soc_jack *dp_jack, int id); > =20 > +/* > + * DSP Bypass links (lpass-cpu) are neither DPCM frontends nor backends, > + * their cpu dai ids overlap with the DSP dai ids. > + */ > +static inline bool qcom_snd_is_dsp_bypass_link(struct snd_soc_pcm_runtim= e *rtd) > +{ > + return !rtd->dai_link->no_pcm && !rtd->dai_link->dynamic; > +} [Severity: High] Can qcom_snd_is_dsp_bypass_link() misclassify non-DSP QAIF links as lpass-cpu links? qcom_snd_parse_of() leaves both no_pcm and dynamic as 0 for any plain CPU-to-codec DT link without a platform node, which includes QAIF links such as shikra_qaif_cpu_dai_driver in sound/soc/qcom/qaif-shikra.c. Unlike lpass-cpu, QAIF registers its SoundWire DAIs using qcom,q6dsp-lpass-ports.h IDs (RX_CODEC_DMA_RX_0, RX_CODEC_DMA_RX_1, VA_CODEC_DMA_TX_1), and sc8280xp_add_be_ops() attaches sc8280xp_be_ops to those links. Because qcom_snd_is_dsp_bypass_link() returns true for QAIF links, qcom_snd_is_sdw_dai() returns false in its default branch without reaching the second switch. qcom_snd_sdw_startup() then returns early without allocating or setting sruntime, causing a NULL pointer dereference during hw_params in qcom_swrm_hw_params() -> qcom_swrm_stream_alloc_ports() (and in slave codec hw_params via sdw_stream_add_slave() -> sdw_master_rt_find()). Identifying the lpass-cpu component/driver directly rather than inferring the DAI ID namespace from !no_pcm && !dynamic would avoid breaking QAIF links. > diff --git a/sound/soc/qcom/sdw.c b/sound/soc/qcom/sdw.c > index e19adb7c750b0..b071d2a797885 100644 > --- a/sound/soc/qcom/sdw.c > +++ b/sound/soc/qcom/sdw.c > @@ -6,10 +6,25 @@ > #include > #include > #include > +#include "common.h" > #include "sdw.h" > =20 > -static bool qcom_snd_is_sdw_dai(int id) > +static bool qcom_snd_is_sdw_dai(struct snd_soc_pcm_runtime *rtd) > { > + int id =3D snd_soc_rtd_to_cpu(rtd, 0)->id; > + > + /* DSP Bypass usecase, cpu dai ids overlap with DSP dai ids */ > + if (qcom_snd_is_dsp_bypass_link(rtd)) { > + switch (id) { > + case LPASS_CDC_DMA_TX3: > + case LPASS_CDC_DMA_RX0: > + case LPASS_CDC_DMA_WSA_RX0: > + return true; > + default: > + return false; > + } > + } [Severity: High] Does enabling LPASS_CDC_DMA_WSA_RX0 on DSP bypass links trigger sleeping in atomic context during PCM trigger? qcom_snd_parse_of() only sets link->nonatomic =3D 1 for DPCM links, so DSP bypass links remain atomic and ALSA holds spin_lock_irq across soc_pcm_trigger(). lpass_platform_wsaif_irq() can also reach soc_pcm_trigger(STOP) in hardirq context on DMA XRUN or error interrupts via snd_pcm_stop_xrun() and snd_pcm_stop(). soc_pcm_trigger() -> snd_soc_pcm_dai_trigger() calls snd_soc_dai_digital_mute() for codecs with .mute_unmute_on_trigger =3D true, which both wsa884x and wsa883x set. Their mute_stream callbacks perform SoundWire regmap writes (regmap_update_bits() -> sdw_transfer()), which acquire sleeping mutexes (map->mutex and bus->msg_lock) and wait for bus transfers while atomic or in hardirq context. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-topic-sm86= 50-el2-v3-0-8384ef0ac751@linaro.org?part=3D18