mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
PCI: tegra: edmatest: use stop edma API for abort
Use tegra_pcie_edma_stop() API to perform abort testing. Bug 3626323 Bug 3868928 Change-Id: Idc90b8ab2836ab535414cc1bd8b99bfda508d129 Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2708632 (cherry picked from commit d7fc5eebce85ac670a1a62d38c1572ff5a679258) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2815925 Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
0c594b0c0b
commit
2b9e2da317
@@ -13,6 +13,7 @@
|
||||
#include <linux/tegra-pcie-edma.h>
|
||||
|
||||
#define EDMA_ABORT_TEST_EN (edma->edma_ch & 0x40000000)
|
||||
#define EDMA_STOP_TEST_EN (edma->edma_ch & 0x20000000)
|
||||
#define IS_EDMA_CH_ENABLED(i) (edma->edma_ch & ((BIT(i) << 4)))
|
||||
#define IS_EDMA_CH_ASYNC(i) (edma->edma_ch & BIT(i))
|
||||
#define REMOTE_EDMA_TEST_EN (edma->edma_ch & 0x80000000)
|
||||
@@ -122,7 +123,7 @@ static int edmalib_common_test(struct edmalib_common *edma)
|
||||
|
||||
l_edma = edma;
|
||||
|
||||
if (EDMA_ABORT_TEST_EN) {
|
||||
if (EDMA_ABORT_TEST_EN || EDMA_STOP_TEST_EN) {
|
||||
edma->edma_ch &= ~0xFF;
|
||||
/* only channel 0, 2 is ASYNC, where chan 0 async gets aborted */
|
||||
edma->edma_ch |= 0xF5;
|
||||
@@ -257,7 +258,9 @@ static int edmalib_common_test(struct edmalib_common *edma)
|
||||
} else if ((ret != EDMA_XFER_SUCCESS) && (ret != EDMA_XFER_FAIL_NOMEM)) {
|
||||
dev_err(edma->fdev, "%s: LL %d, SZ: %u B CH: %d failed. %d at iter %d ret: %d\n",
|
||||
__func__, xfer_type, edma->dma_size, ch, ret, k, ret);
|
||||
if (EDMA_ABORT_TEST_EN) {
|
||||
if (EDMA_STOP_TEST_EN) {
|
||||
break;
|
||||
} else if (EDMA_ABORT_TEST_EN) {
|
||||
msleep(5000);
|
||||
break;
|
||||
}
|
||||
@@ -266,17 +269,28 @@ static int edmalib_common_test(struct edmalib_common *edma)
|
||||
dev_dbg(edma->fdev, "%s: LL EDMA LIB %d, SZ: %u B CH: %d iter %d\n",
|
||||
__func__, xfer_type, edma->dma_size, ch, i);
|
||||
}
|
||||
if (EDMA_ABORT_TEST_EN && i == 0) {
|
||||
if (i == 0) {
|
||||
if (EDMA_ABORT_TEST_EN) {
|
||||
msleep(edma->stress_count);
|
||||
dma_common_wr(edma->dma_base, DMA_WRITE_DOORBELL_OFF_WR_STOP,
|
||||
db_off);
|
||||
} else if (EDMA_STOP_TEST_EN) {
|
||||
bool stop_status;
|
||||
|
||||
msleep(edma->stress_count);
|
||||
stop_status = tegra_pcie_edma_stop(edma->cookie);
|
||||
dev_info(edma->fdev, "%s: EDMA LIB, status of stop DMA is %d",
|
||||
__func__, stop_status);
|
||||
}
|
||||
}
|
||||
diff = ktime_to_ns(ktime_get()) - ktime_to_ns(edma->edma_start_time[i]);
|
||||
if (ch_info->ch_type == EDMA_CHAN_XFER_SYNC)
|
||||
if (ch_info->ch_type == EDMA_CHAN_XFER_SYNC) {
|
||||
if (ret == EDMA_XFER_SUCCESS)
|
||||
dev_info(edma->fdev, "%s: EDMA LIB %s-%s-SYNC done for %d iter on channel %d. Total Size %llu bytes, time %llu nsec. Perf is %llu Mbps\n",
|
||||
__func__, xfer_str[xfer_type], l_r_str[l_r], edma->stress_count, i,
|
||||
edma->tsz, diff, EDMA_PERF);
|
||||
}
|
||||
}
|
||||
dev_info(edma->fdev, "%s: EDMA LIB submit done\n", __func__);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user