From 3a9f9b5d12a37f8507a595ff491b7d67c2a6519c Mon Sep 17 00:00:00 2001 From: Nagarjuna Kristam Date: Tue, 1 Apr 2025 14:43:21 +0530 Subject: [PATCH] linux: dma-test-common: Fix DMA re-init sequence DMA channel is re-init based on incorrect previous and current channel change check, fix the same. Add DMA cookie pointer info logs for easy debugging. Bug 4742850 Change-Id: Iec5dd32ffb3699c5d57961949597c2c80ef250ad Signed-off-by: Nagarjuna Kristam Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330635 GVS: buildbot_gerritrpt Reviewed-by: Manikanta Maddireddy Reviewed-by: Bitan Biswas --- include/linux/tegra-pcie-edma-test-common.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/linux/tegra-pcie-edma-test-common.h b/include/linux/tegra-pcie-edma-test-common.h index f9c20be5..1923c7c3 100644 --- a/include/linux/tegra-pcie-edma-test-common.h +++ b/include/linux/tegra-pcie-edma-test-common.h @@ -380,9 +380,9 @@ static int edmalib_common_test(struct edmalib_common *edma) edma->tsz = (u64)edma->stress_count * (nents_per_ch) * (u64)edma->dma_size * 8UL; - if (!edma->cookie || ((edma->prev_edma_ch & 0xFF) != edma->edma_ch)) { - dev_info(edma->fdev, "%s: re-init edma lib prev_ch(%x) != current chans(%x)\n", - __func__, edma->prev_edma_ch, edma->edma_ch); + if (!edma->cookie || ((edma->prev_edma_ch & 0xFF) != (edma->edma_ch & 0xFF))) { + dev_info(edma->fdev, "%s: re-init edma lib prev_ch(%x) != current chans(%x); edma cookie:%p\n", + __func__, edma->prev_edma_ch, edma->edma_ch, edma->cookie); ret = tegra_pcie_dma_initialize(&info, &edma->cookie); if (ret != TEGRA_PCIE_DMA_SUCCESS) { dev_info(edma->fdev, "%s: tegra_pcie_dma_initialize() fail: %d\n", @@ -524,6 +524,7 @@ static int edmalib_common_test(struct edmalib_common *edma) dev_err(edma->fdev, "CRC check pass\n"); } + dev_info(edma->fdev, "%s: return success, coockie %p\n", __func__, edma->cookie); return 0; fail: if (ret != TEGRA_PCIE_DMA_DEINIT) {