From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AF1B3AA1A1 for ; Tue, 31 Mar 2026 23:37:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775000229; cv=none; b=QcpCSr8O6duGQxD85WjyqICUPmsVsxicjAJm2AozrGvJxMxXCoSks/gtkXgfaXxwymg3hOAwxtTpGlHbCjwr9Hs67eq82SrK7Bu4dGpO5ojUigbY3klrv/wGLolc8bapTTMo4UJ8LGecLuVp00LO2AW4ux2DkMU8O+vubttqNvo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775000229; c=relaxed/simple; bh=+aWwp7gYScpiG/F2aKif0srBr/lhuO53mgtcK932GFU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rNFfZq1XsnmM2WnJqapJ/+u5yphI8sCz9lUUjatO0EIcDBnIc8ya/PDIdEn+TBo7sWCyfJfkGTgIipg5+yr3Qe1nMNflnHjsOIxg/1sYtP4XVsikKGhXbxahOXMSwWrxDxPb/SGLwxuFTxUMt23boNrjLpArqEjR9oamb6FiCLA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=V+wSFUPV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="V+wSFUPV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7334FC2BCB0; Tue, 31 Mar 2026 23:37:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775000229; bh=+aWwp7gYScpiG/F2aKif0srBr/lhuO53mgtcK932GFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V+wSFUPV+3hopwVHSSurPv8AhoCMZX3CUc5/R0BbDwRbPEqdYkpBADsrdW4thYkJI Zy8ss72QvvBEAUPCHmdYEdx1VKM+gPOyFbKOHOTjZCVC6/LxJCyUDZIUJBlIJQ32zI 401Ckz6/+1GOO9s/HkgeUbQSbv65rskwMzfa/JG0jcZ7TO9ft9nEXxKuSR/8LrkD29 KjP+mo2xKfLRhV71HLJWCcCDUFKpRntUtbseUJ5GTHcMIP26QGAZN7uFi5Eybbb5L7 ihi9aUNObefbKe8Z5sRQWiI1eLI9WRV2AMvr0jtYgNm02cIqyKrSkF6IXRM7y3M1me fnX5djDZjyabA== From: Sasha Levin To: stable@vger.kernel.org Cc: Joy Zou , Frank Li , Vinod Koul , Sasha Levin Subject: [PATCH 6.6.y 2/2] dmaengine: fsl-edma: fix channel parameter config for fixed channel requests Date: Tue, 31 Mar 2026 19:37:05 -0400 Message-ID: <20260331233706.3629169-2-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260331233706.3629169-1-sashal@kernel.org> References: <2026033014-jitters-makeshift-a3d2@gregkh> <20260331233706.3629169-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Joy Zou [ Upstream commit 2e7b5cf72e51c9cf9c8b75190189c757df31ddd9 ] Configure only the requested channel when a fixed channel is specified to avoid modifying other channels unintentionally. Fix parameter configuration when a fixed DMA channel is requested on i.MX9 AON domain and i.MX8QM/QXP/DXL platforms. When a client requests a fixed channel (e.g., channel 6), the driver traverses channels 0-5 and may unintentionally modify their configuration if they are unused. This leads to issues such as setting the `is_multi_fifo` flag unexpectedly, causing memcpy tests to fail when using the dmatest tool. Only affect edma memcpy test when the channel is fixed. Fixes: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support") Signed-off-by: Joy Zou Cc: stable@vger.kernel.org Reviewed-by: Frank Li Link: https://patch.msgid.link/20250917-b4-edma-chanconf-v1-1-886486e02e91@nxp.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/fsl-edma-main.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 0e6207382cde1..745870d469028 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -152,10 +152,8 @@ static struct dma_chan *fsl_edma3_xlate(struct of_phandle_args *dma_spec, fsl_chan = to_fsl_edma_chan(chan); i = fsl_chan - fsl_edma->chans; - fsl_chan->priority = dma_spec->args[1]; - fsl_chan->is_rxchan = dma_spec->args[2] & FSL_EDMA_RX; - fsl_chan->is_remote = dma_spec->args[2] & FSL_EDMA_REMOTE; - fsl_chan->is_multi_fifo = dma_spec->args[2] & FSL_EDMA_MULTI_FIFO; + if (!b_chmux && i != dma_spec->args[0]) + continue; if ((dma_spec->args[2] & FSL_EDMA_EVEN_CH) && (i & 0x1)) continue; @@ -163,17 +161,15 @@ static struct dma_chan *fsl_edma3_xlate(struct of_phandle_args *dma_spec, if ((dma_spec->args[2] & FSL_EDMA_ODD_CH) && !(i & 0x1)) continue; - if (!b_chmux && i == dma_spec->args[0]) { - chan = dma_get_slave_channel(chan); - chan->device->privatecnt++; - return chan; - } else if (b_chmux && !fsl_chan->srcid) { - /* if controller support channel mux, choose a free channel */ - chan = dma_get_slave_channel(chan); - chan->device->privatecnt++; - fsl_chan->srcid = dma_spec->args[0]; - return chan; - } + fsl_chan->srcid = dma_spec->args[0]; + fsl_chan->priority = dma_spec->args[1]; + fsl_chan->is_rxchan = dma_spec->args[2] & FSL_EDMA_RX; + fsl_chan->is_remote = dma_spec->args[2] & FSL_EDMA_REMOTE; + fsl_chan->is_multi_fifo = dma_spec->args[2] & FSL_EDMA_MULTI_FIFO; + + chan = dma_get_slave_channel(chan); + chan->device->privatecnt++; + return chan; } return NULL; } -- 2.53.0