diff mbox

[2/2] dmaengine: dmatest: add norandom option

Message ID 1516617881-30044-2-git-send-email-shunyong.yang@hxt-semitech.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Shunyong Yang Jan. 22, 2018, 10:44 a.m. UTC
Existing option noverify disables both random src/dst address offset
setup and data verification. Sometimes, we need to control random
src/dst address setup and verification separately, such as disabling
random to make sure that test covers addresses in all interleaving
banks in one run. This patch adds option norandom to disable random
offset setup. Option noverify has been changed to disable data
verification only.

Signed-off-by: Yang Shunyong <shunyong.yang@hxt-semitech.com>
---
 drivers/dma/dmatest.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

Comments

Vinod Koul Jan. 31, 2018, 7:34 a.m. UTC | #1
On Mon, Jan 22, 2018 at 06:44:41PM +0800, Yang Shunyong wrote:
> Existing option noverify disables both random src/dst address offset
> setup and data verification. Sometimes, we need to control random
> src/dst address setup and verification separately, such as disabling
> random to make sure that test covers addresses in all interleaving
> banks in one run. This patch adds option norandom to disable random
> offset setup. Option noverify has been changed to disable data
> verification only.

This doesn't apply for me due to dependency on previous patch. Please rebase
and resend.
Shunyong Yang Jan. 31, 2018, 7:38 a.m. UTC | #2
Hi, Vinod

On Wed, 2018-01-31 at 13:04 +0530, Vinod Koul wrote:
> On Mon, Jan 22, 2018 at 06:44:41PM +0800, Yang Shunyong wrote:
> > 
> > Existing option noverify disables both random src/dst address
> > offset
> > setup and data verification. Sometimes, we need to control random
> > src/dst address setup and verification separately, such as
> > disabling
> > random to make sure that test covers addresses in all interleaving
> > banks in one run. This patch adds option norandom to disable random
> > offset setup. Option noverify has been changed to disable data
> > verification only.
> This doesn't apply for me due to dependency on previous patch. Please
> rebase
> and resend.
> 

Thanks. I have finished the rebase. I will send out v2 patch when I
finish test.

Thanks.
Shunyong.--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index 4cdccc3..cc3ab97 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -72,7 +72,11 @@ 
 
 static bool noverify;
 module_param(noverify, bool, 0644);
-MODULE_PARM_DESC(noverify, "Disable random data setup and verification");
+MODULE_PARM_DESC(noverify, "Disable data verification (default: verify)");
+
+static bool norandom;
+module_param(norandom, bool, 0644);
+MODULE_PARM_DESC(norandom, "Disable random offset setup (default: random)");
 
 static bool verbose;
 module_param(verbose, bool, 0644);
@@ -101,6 +105,7 @@  struct dmatest_params {
 	unsigned int	pq_sources;
 	int		timeout;
 	bool		noverify;
+	bool		norandom;
 };
 
 /**
@@ -573,7 +578,7 @@  static int dmatest_func(void *data)
 			break;
 		}
 
-		if (params->noverify)
+		if (params->norandom)
 			len = params->buf_size;
 		else
 			len = dmatest_random() % params->buf_size + 1;
@@ -584,17 +589,19 @@  static int dmatest_func(void *data)
 
 		total_len += len;
 
-		if (params->noverify) {
+		if (params->norandom) {
 			src_off = 0;
 			dst_off = 0;
 		} else {
-			start = ktime_get();
 			src_off = dmatest_random() % (params->buf_size - len + 1);
 			dst_off = dmatest_random() % (params->buf_size - len + 1);
 
 			src_off = (src_off >> align) << align;
 			dst_off = (dst_off >> align) << align;
+		}
 
+		if (!params->noverify) {
+			start = ktime_get();
 			dmatest_init_srcs(thread->srcs, src_off, len,
 					  params->buf_size, is_memset);
 			dmatest_init_dsts(thread->dsts, dst_off, len,
@@ -973,6 +980,7 @@  static void run_threaded_test(struct dmatest_info *info)
 	params->pq_sources = pq_sources;
 	params->timeout = timeout;
 	params->noverify = noverify;
+	params->norandom = norandom;
 
 	request_channels(info, DMA_MEMCPY);
 	request_channels(info, DMA_MEMSET);