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 <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330635
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
This commit is contained in:
Nagarjuna Kristam
2025-04-01 14:43:21 +05:30
committed by Jon Hunter
parent 6dbef270d8
commit 3a9f9b5d12

View File

@@ -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; 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)) { 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)\n", 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); __func__, edma->prev_edma_ch, edma->edma_ch, edma->cookie);
ret = tegra_pcie_dma_initialize(&info, &edma->cookie); ret = tegra_pcie_dma_initialize(&info, &edma->cookie);
if (ret != TEGRA_PCIE_DMA_SUCCESS) { if (ret != TEGRA_PCIE_DMA_SUCCESS) {
dev_info(edma->fdev, "%s: tegra_pcie_dma_initialize() fail: %d\n", 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_err(edma->fdev, "CRC check pass\n");
} }
dev_info(edma->fdev, "%s: return success, coockie %p\n", __func__, edma->cookie);
return 0; return 0;
fail: fail:
if (ret != TEGRA_PCIE_DMA_DEINIT) { if (ret != TEGRA_PCIE_DMA_DEINIT) {