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=1796380299; b=JlybZRoiKV0IrE6GmlWKgnUOlaaTQ0Hn4GyB7pOwS77lqjAHbnXP2WrzHa/Mnd6MXS1m eicCiXu9ssy+P18hKxJekDjHuw+E28tzzDf4v3llfFrasy0teMXwgAjEA5gPzPeQjEgDP T+RTeEzSOGn2gVwgBT1HhGRSvlSCjQvqwBVXICX1T7WslrhWw5FZEvJx6LaUVdLsIhxzJ rr6bb2goJYbjuifiMQbMJEJ6mbsN3CuGBFHmJdamQ1joDl8wthYCK+99IKg7XYmTkmD/i KTFiYvuHPL37/XLlQ6ZY2D2ZSunPYpvQ2qQO58XgTgXdOLK1loYFkEqUfJbPvDsUDUA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380299; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=YG+kAfnN9jihSXTDjphitOXdFCy9YueP//pRjhg8OBI=; b=dqZJh1P7xfppkEu48hsNyFQuxAFB8nCzOe2mvWIylkEeenADfawuFJ4AZiYIQJfufUTS GkI4FA/faf7QWkITJCzExAxJjT0mBi7pWpM/2SfVHCqRu4m597s8s4AaXXvhUYKDlq+pX rC1MNO5+ODqdMFL9qAaCqa9aKshVgRsCSxHLZW+KNLQKtqHRmq4cQDfLGqcRjtABCkous 8H6OREmYEI8SK54tq94ZntNEeYi2OnYgsbq6/3zXhKDgurCPxzhxzYxIbxZpIcSIYSHEH ACZMcMKfNPPLtGZItqLDSfWm/4OKHsoHCbbIjN5zIL0cyhj2A//iqy7DtmHmmdrLz1A== 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=LLCRiGSQ; 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 080EC606A322; Fri, 4 Dec 2026 10:31:39 +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=LLCRiGSQ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76EC81F000C2; Fri, 4 Dec 2026 10:31:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380298; bh=YG+kAfnN9jihSXTDjphitOXdFCy9YueP//pRjhg8OBI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LLCRiGSQ2MVI13EYW4ExF4soaWrGoMEN7xFQbXzQk4GLLIid6QE/kyApLhO7z4MmM hCx4wC8Babepm0UxysxwHNdfppu2JrJJGUYQvQzts1Q0oUUCz2d6X26tG675F0kBEe GjzWSb04+SIQqUQ0anKA1DpLFECF+0SGgxZbeEMc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Stefan Ghetu , Shengjiu Wang , Mark Brown , Sasha Levin Subject: [PATCH 7.3 212/742] ASoC: fsl_asrc_m2m: allow only one task at a time per stream Date: Fri, 4 Dec 2026 19:01:16 +0900 Message-ID: <20261204100640.712020117@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Ghetu [ Upstream commit f0277994dbd09cc45d600c2f86cbfde9c17c6fcf ] All tasks of a stream share one pair and one set of DMA channels, and get_caps() advertises a single fragment, but the compress core allows up to 64 tasks. A second task requests the pair again and overwrites the DMA channels. Freeing both tasks then releases the same channels twice and leaves a stale asrc->pair[] entry after close. Return -EBUSY from task_create() while a task exists, and clear the DMA channel pointers once they are released. Fixes: 24a01710f627 ("ASoC: fsl_asrc_m2m: Add memory to memory function") Signed-off-by: Stefan Ghetu Reviewed-by: Shengjiu Wang Link: https://patch.msgid.link/20261116093751.138455-6-stefan.ghetu@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/fsl_asrc_m2m.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c index b3f0b8c520876..9d124d2464027 100644 --- a/sound/soc/fsl/fsl_asrc_m2m.c +++ b/sound/soc/fsl/fsl_asrc_m2m.c @@ -470,6 +470,10 @@ static int fsl_asrc_m2m_comp_task_create(struct snd_compr_stream *stream, struct dma_chan *tmp_chan; int ret; + /* All tasks share the pair and DMA channels: one task at a time */ + if (pair->dma_chan[IN]) + return -EBUSY; + exp_info_in.ops = &fsl_asrc_m2m_dma_buf_ops; exp_info_in.size = ASRC_M2M_BUFFER_SIZE; exp_info_in.flags = O_RDWR; @@ -526,6 +530,7 @@ static int fsl_asrc_m2m_comp_task_create(struct snd_compr_stream *stream, err_dma_channel_out: dma_release_channel(pair->dma_chan[IN]); + pair->dma_chan[IN] = NULL; err_dma_channel_in: if (asrc->m2m_unprepare) asrc->m2m_unprepare(pair); @@ -570,6 +575,8 @@ static int fsl_asrc_m2m_comp_task_free(struct snd_compr_stream *stream, dma_release_channel(pair->dma_chan[IN]); if (pair->dma_chan[OUT]) dma_release_channel(pair->dma_chan[OUT]); + pair->dma_chan[IN] = NULL; + pair->dma_chan[OUT] = NULL; return 0; } -- 2.53.0