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=1796220955; b=iBs1gr8c09dWB7clTnoyts//tXIFXVVkhxb1XKkMVdOkJMlMhRnXgu+HP4b0Ib7x18Ni XP3zgwwVBtTDWZ9YawYR3PL8pE8S6HaHYYZQYV07ZKbBqh+QZdzvNbogviQL5R+SWYeId blPTAZmMcDOdIchE9mOjgyMDJ2hFmd+gDPOZ/mXEO8U3aECjT1F/wq7J/LzUaRjq69QfD Rvnw+Xny4Wu9F4BujKAGF78i2WKAtrKKJ/tAMUR5x4AGpppWgrFVteaHqwSGvMAMFKdk3 SjKPZfhXx/Qd5B6PUlBFGqogBvLMn7uFHxL0q/82Iu/IrfNw1qRGyEN2+s6rFTpzaHQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796220955; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=lywT9L8dIbgXUkCpXuLD9nE/JDek6GCCr9YEtHzCy2w=; b=HIRBMWahg2EjKr56tf3JXgNcglgOS5vu5/khXJMjIghejCKwkTy5gulb88CetPMaq293 EbvLMDEtMZuZJQHYMGqe8fxWpbb+MSmlixtFz2uGZHydHwzG2lFyzwJ3bL7nDLqke95kU fKyXAd+8nYBwemx0DzI1cql2TyCMrixCVGwkK987fK4WasRFxyQORuuGqfIGd29XLVL2I e7fYcZQvQesVYbYlSqlLmDgsyEkRJKq2QKAR9+I4qXic31pjpOLsJ7+0+wsM51HyNBokB S1/4SNJ686cc22nuX4KzP/DJAarjdmoKitG9MPB2btufaKhd5K0M6FnHS+adhquVUtw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=dpbVTv0b; 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 2B13A606A31A for ; Wed, 2 Dec 2026 14:15:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=dpbVTv0b Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6B2A1F00896; Wed, 2 Dec 2026 14:15:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796220954; bh=lywT9L8dIbgXUkCpXuLD9nE/JDek6GCCr9YEtHzCy2w=; h=Subject:To:Cc:From:Date; b=dpbVTv0bCOn4ACJ6Wb3QewGfwaqTRWS0s3qm2M4A+OsWWjETEQj0vm6NKcBnPiver tvsWDEYkfytpv4YlOxVoRu5YIgVfHuSVrvD/AJ3UjLyKvNpajTHye3QrnWKQ0ZTak/ wf5zwl4iqxiVjtJOzlIDANp82rO4Dc8tV4V3T2A0= Subject: FAILED: patch "[PATCH] ASoC: qcom: audioreach: use a 32-bit container for S24_LE PCM" failed to apply to 6.12-stable tree To: marcht@proton.me,broonie@kernel.org,srinivas.kandagatla@oss.qualcomm.com Cc: From: Date: Wed, 02 Dec 2026 13:57:24 +0100 Message-ID: <2026120224-feeble-fit-4dd8@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.12-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y git checkout FETCH_HEAD git cherry-pick -x feb416ba626e95b12fc238587f8fee93cae66c9c # git commit -s git send-email --to '' --in-reply-to '2026120224-feeble-fit-4dd8@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From feb416ba626e95b12fc238587f8fee93cae66c9c Mon Sep 17 00:00:00 2001 From: Marc Herrero Date: Mon, 16 Nov 2026 20:16:20 +0000 Subject: [PATCH] ASoC: qcom: audioreach: use a 32-bit container for S24_LE PCM SNDRV_PCM_FORMAT_S24_LE carries 24 valid bits in a 32-bit container, but audioreach_shmem_set_media_format() and audioreach_pcm_set_media_format() set bits_per_sample = bit_width = 24 in PARAM_ID_MEDIA_FORMAT and PARAM_ID_PCM_OUTPUT_FORMAT_CFG, which tells the DSP that the samples are packed 3-byte words. q6apm-dai advertises S24_LE, so with a topology that allows it on a playback front end the DSP walks the buffer with the wrong stride. On QCS6490 (Radxa Dragon Q6A) this crashes the ADSP audio_process: PDM: service 'audio_process' crash: 'EX:audio_process:0x2:...' q6apm-lpass-dais ...: Failed to start APM port 113 remoteproc remoteproc0: crash detected in adsp: type fatal error Use the container size (32) for 24-bit data and keep bit_width = 24, alignment = PCM_LSB_ALIGNED and q_factor = 23. With this change S24_LE playback works on the headphone path (codec DMA RX -> LPASS RX macro -> WCD9385), tested with the back end at S16_LE, S24_LE and S32_LE and at 48, 96 and 192 kHz. The DSP then reads each 32-bit word as Q23, so S24_LE samples must be sign-extended into the top byte, as alsa-lib's conversions do. Fixes: 25ab80db6b13 ("ASoC: qdsp6: audioreach: add module configuration command helpers") Cc: stable@vger.kernel.org Reviewed-by: Srinivas Kandagatla Signed-off-by: Marc Herrero Link: https://patch.msgid.link/20261116-q6apm-fixes-v2-1-ea89fb43316a@proton.me Signed-off-by: Mark Brown diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audioreach.c index d2dc5d37bccf..aa1f4e296764 100644 --- a/sound/soc/qcom/qdsp6/audioreach.c +++ b/sound/soc/qcom/qdsp6/audioreach.c @@ -1216,7 +1216,12 @@ static int audioreach_pcm_set_media_format(struct q6apm_graph *graph, media_cfg->interleaved = module->interleave_type; media_cfg->num_channels = mcfg->num_channels; media_cfg->q_factor = mcfg->bit_width - 1; - media_cfg->bits_per_sample = mcfg->bit_width; + /* + * bit_width is the number of valid bits in a sample, bits_per_sample + * the size of the container it is stored in. S24_LE keeps 24 valid + * bits in a 32-bit container, so it is 24/32, not packed 24/24. + */ + media_cfg->bits_per_sample = mcfg->bit_width == 24 ? 32 : mcfg->bit_width; /* Convert the physical mapping to a logical mapping of the channels */ for (i = 0, j = 0; i < AR_PCM_MAX_NUM_CHANNEL && j < mcfg->num_channels; i++) { if (!mcfg->channel_map[i]) @@ -1308,7 +1313,8 @@ static int audioreach_shmem_set_media_format(struct q6apm_graph *graph, cfg->sample_rate = mcfg->sample_rate; cfg->bit_width = mcfg->bit_width; cfg->alignment = PCM_LSB_ALIGNED; - cfg->bits_per_sample = mcfg->bit_width; + /* S24_LE: 24 valid bits in a 32-bit container, see above */ + cfg->bits_per_sample = mcfg->bit_width == 24 ? 32 : mcfg->bit_width; cfg->q_factor = mcfg->bit_width - 1; cfg->endianness = PCM_LITTLE_ENDIAN; cfg->num_channels = mcfg->num_channels;