Skip to contentSkip to conversation

add self test code for DMA engine drivers

PATCH New Sinan Kaya 1 participant 3 messages Nov 15, 2015

Subsystems (3)
lore
Share & tools
lore

Sinan Kaya

author
#0 lore raw

v5 cover add self test code for DMA engine drivers

Changes from V4 (https://lkml.org/lkml/2015/11/12/18)
* Seperate the series from HIDMA driver

Sinan Kaya (2):
dmaselftest: add memcpy selftest support functions
dma: qcom_hidma: add self test hooks

 drivers/dma/dmaengine.h   |   2 +
 drivers/dma/dmaselftest.c | 638 ++++++++++++++++++++++++++++++++++++++++++++++
 drivers/dma/qcom/Makefile |   2 +-
 drivers/dma/qcom/hidma.c  |   4 +
 4 files changed, 645 insertions(+), 1 deletion(-)
 create mode 100644 drivers/dma/dmaselftest.c
Signature · 2 lines
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
author
#1 lore raw

PATCH v5 1/2 dmaselftest: add memcpy selftest support functions

This patch adds supporting utility functions for selftest. The intention is to share the self test code between different drivers.

Supported test cases include:
1. dma_map_single
2. streaming DMA
3. coherent DMA
4. scatter-gather DMA

---
 drivers/dma/dmaengine.h   |   2 +
 drivers/dma/dmaselftest.c | 638 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 640 insertions(+)
 create mode 100644 drivers/dma/dmaselftest.c
drivers/dma/dmaengine.h +2 -0
index 17f983a..05b5a84 100644
@@ -86,4 +86,6 @@ static inline void dma_set_residue(struct dma_tx_state *state, u32 residue)
 		state->residue = residue;
 }
 
+int dma_selftest_memcpy(struct dma_device *dmadev);
+
 #endif
drivers/dma/dmaselftest.c new file +638 -0

638 lines not on this page · raw message

Signature · 2 lines
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
author
#2 lore raw

PATCH v5 2/2 dma: qcom_hidma: add self test hooks

In reply to Sinan Kaya

Add hooks for the self test code into the probe routine.

---
 drivers/dma/qcom/Makefile | 2 +-
 drivers/dma/qcom/hidma.c  | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/dma/qcom/Makefile +1 -1
index f702df1..2b68c9c 100644
@@ -1,4 +1,4 @@
 obj-$(CONFIG_QCOM_BAM_DMA) += bam_dma.o
 obj-$(CONFIG_QCOM_HIDMA_MGMT) += hidma_mgmt.o hidma_mgmt_sys.o
 obj-$(CONFIG_QCOM_HIDMA) +=  hdma.o
-hdma-objs        := hidma_ll.o hidma.o hidma_dbg.o
+hdma-objs        := hidma_ll.o hidma.o hidma_dbg.o ../dmaselftest.o
drivers/dma/qcom/hidma.c +4 -0
index 2eabc80..2820755 100644
@@ -649,6 +649,10 @@ static int hidma_probe(struct platform_device *pdev)
 	if (rc)
 		goto uninit;
 
+	rc = dma_selftest_memcpy(&dmadev->ddev);
+	if (rc)
+		goto uninit;
+
 	rc = dma_async_device_register(&dmadev->ddev);
 	if (rc)
 		goto uninit;
Signature · 2 lines
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project