Skip to contentSkip to conversation

dmatest: update the module to use debugfs

PATCH In review Andy Shevchenko 5 participants 32 messages Mar 4, 2013 – Nov 7, 2013 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover dmatest: update the module to use debugfs

The first approach to get dmatest module more flexible and easier to play with. The amount of patches could be reduced, but I would like to get a comments first on smaller pieces. The entire series creates dmatest.txt file in the Documentation folder. Similar description is scattered through the commit messages.

Module was tested on Intel Medfield and Lynxpoint systems with dw_dmac DMA controller embedded.

Andy Shevchenko (10):
dmatest: cancel thread immediately when asked for
dmatest: allocate memory for pq_coefs from heap
dmatest: create dmatest_info to keep test parameters
dmatest: move dmatest_channels and nr_channels to dmatest_info
dmatest: split test parameters to separate structure
dmatest: run test via debugfs
dmatest: return actual state in 'run' file
dmatest: define MAX_ERROR_COUNT constant
dmatest: gather test results in the linked list
dmatest: append verify result to results

 Documentation/dmatest.txt |  81 +++++
 drivers/dma/dmatest.c     | 887 +++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 832 insertions(+), 136 deletions(-)
 create mode 100644 Documentation/dmatest.txt
Signature · 1 line
1.8.2.rc0.22.gb3600c3
#1 lore raw

PATCH 1/10 dmatest: cancel thread immediately when asked for

If user have the timeout alike issues and wants to cancel the thread immediately, the current call of wait_event_freezable_timeout is preventing to this until timeout is expired. Thus, user will experience the unnecessary delays.

Adding kthread_should_stop() check inside wait_event_freezable_timeout() solves that.

---
 drivers/dma/dmatest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/dma/dmatest.c +2 -1
index a2c8904..e6b4cfa 100644
@@ -454,7 +454,8 @@ static int dmatest_func(void *data)
 		}
 		dma_async_issue_pending(chan);
 
-		wait_event_freezable_timeout(done_wait, done.done,
+		wait_event_freezable_timeout(done_wait,
+					     done.done || kthread_should_stop(),
 					     msecs_to_jiffies(timeout));
 
 		status = dma_async_is_tx_complete(chan, cookie, NULL, NULL);
Signature · 1 line
1.8.2.rc0.22.gb3600c3
Acked-by on v1 1/10
#2 lore raw

Re: [PATCH 01/10] dmatest: cancel thread immediately when asked for

Quoted 9 lines · Andy Shevchenko

If user have the timeout alike issues and wants to cancel the thread immediately, the current call of wait_event_freezable_timeout is preventing to this until timeout is expired. Thus, user will experience the unnecessary delays.

Adding kthread_should_stop() check inside wait_event_freezable_timeout() solves that.

#3 lore raw

PATCH 2/10 dmatest: allocate memory for pq_coefs from heap

In reply to Andy Shevchenko

This will help in future to hide a global variable usage.

---
 drivers/dma/dmatest.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/dma/dmatest.c +9 -2
index e6b4cfa..e3955be 100644
@@ -278,7 +278,7 @@ static int dmatest_func(void *data)
 	dma_cookie_t		cookie;
 	enum dma_status		status;
 	enum dma_ctrl_flags 	flags;
-	u8			pq_coefs[pq_sources + 1];
+	u8			*pq_coefs = NULL;
 	int			ret;
 	int			src_cnt;
 	int			dst_cnt;
@@ -302,10 +302,15 @@ static int dmatest_func(void *data)
 		/* force odd to ensure dst = src */
 		src_cnt = min_odd(pq_sources | 1, dma_maxpq(dev, 0));
 		dst_cnt = 2;
+
+		pq_coefs = kmalloc(pq_sources+1, GFP_KERNEL);
+		if (!pq_coefs)
+			goto err_thread_type;
+
 		for (i = 0; i < src_cnt; i++)
 			pq_coefs[i] = 1;
 	} else
-		goto err_srcs;
+		goto err_thread_type;
 
 	thread->srcs = kcalloc(src_cnt+1, sizeof(u8 *), GFP_KERNEL);
 	if (!thread->srcs)
@@ -533,6 +538,8 @@ err_dsts:
 err_srcbuf:
 	kfree(thread->srcs);
 err_srcs:
+	kfree(pq_coefs);
+err_thread_type:
 	pr_notice("%s: terminating after %u tests, %u failures (status %d)\n",
 			thread_name, total_tests, failed_tests, ret);
 
Signature · 1 line
1.8.2.rc0.22.gb3600c3
#5 lore raw

PATCH 3/10 dmatest: create dmatest_info to keep test parameters

In reply to Andy Shevchenko

The proposed change will remove usage of the module parameters as global variables. In future it helps to run different test cases sequentially.

The patch introduces the run_threaded_test() and stop_threaded_test() functions that could be used later outside of dmatest_init, dmatest_exit scope.

---
 drivers/dma/dmatest.c | 160 +++++++++++++++++++++++++++++++++++---------------
 1 file changed, 113 insertions(+), 47 deletions(-)
drivers/dma/dmatest.c +113 -47
index e3955be..7f9e3cc 100644
@@ -78,8 +78,11 @@ MODULE_PARM_DESC(timeout, "Transfer Timeout in msec (default: 3000), "
 #define PATTERN_OVERWRITE	0x20
 #define PATTERN_COUNT_MASK	0x1f
 
+struct dmatest_info;
+
 struct dmatest_thread {
 	struct list_head	node;
+	struct dmatest_info	*info;
 	struct task_struct	*task;
 	struct dma_chan		*chan;
 	u8			**srcs;
@@ -93,6 +96,32 @@ struct dmatest_chan {
 	struct list_head	threads;
 };
 
+/**
+ * struct dmatest_info - test information.
+ * @buf_size:		size of the memcpy test buffer
+ * @channel:		bus ID of the channel to test
+ * @device:		bus ID of the DMA Engine to test
+ * @threads_per_chan:	number of threads to start per channel
+ * @max_channels:	maximum number of channels to use
+ * @iterations:		iterations before stopping test
+ * @xor_sources:	number of xor source buffers
+ * @pq_sources:		number of p+q source buffers
+ * @timeout:		transfer timeout in msec, -1 for infinite timeout
+ */
+struct dmatest_info {
+	unsigned int	buf_size;
+	char		channel[20];
+	char		device[20];
+	unsigned int	threads_per_chan;
+	unsigned int	max_channels;
+	unsigned int	iterations;
+	unsigned int	xor_sources;
+	unsigned int	pq_sources;
+	int		timeout;
+};
+
+static struct dmatest_info test_info;
+
 /*
  * These are protected by dma_list_mutex since they're only used by
  * the DMA filter function callback
@@ -100,18 +129,20 @@ struct dmatest_chan {
 static LIST_HEAD(dmatest_channels);
 static unsigned int nr_channels;
 
-static bool dmatest_match_channel(struct dma_chan *chan)
+static bool dmatest_match_channel(struct dmatest_info *info,
+		struct dma_chan *chan)
 {
-	if (test_channel[0] == '\0')
+	if (info->channel[0] == '\0')
 		return true;
-	return strcmp(dma_chan_name(chan), test_channel) == 0;
+	return strcmp(dma_chan_name(chan), info->channel) == 0;
 }
 
-static bool dmatest_match_device(struct dma_device *device)
+static bool dmatest_match_device(struct dmatest_info *info,
+		struct dma_device *device)
 {
-	if (test_device[0] == '\0')
+	if (info->device[0] == '\0')
 		return true;
-	return strcmp(dev_name(device->dev), test_device) == 0;
+	return strcmp(dev_name(device->dev), info->device) == 0;
 }
 
 static unsigned long dmatest_random(void)
@@ -122,7 +153,8 @@ static unsigned long dmatest_random(void)
 	return buf;
 }
 
-static void dmatest_init_srcs(u8 **bufs, unsigned int start, unsigned int len)
+static void dmatest_init_srcs(u8 **bufs, unsigned int start, unsigned int len,
+		unsigned int buf_size)
 {
 	unsigned int i;
 	u8 *buf;
@@ -133,13 +165,14 @@ static void dmatest_init_srcs(u8 **bufs, unsigned int start, unsigned int len)
 		for ( ; i < start + len; i++)
 			buf[i] = PATTERN_SRC | PATTERN_COPY
 				| (~i & PATTERN_COUNT_MASK);
-		for ( ; i < test_buf_size; i++)
+		for ( ; i < buf_size; i++)
 			buf[i] = PATTERN_SRC | (~i & PATTERN_COUNT_MASK);
 		buf++;
 	}
 }
 
-static void dmatest_init_dsts(u8 **bufs, unsigned int start, unsigned int len)
+static void dmatest_init_dsts(u8 **bufs, unsigned int start, unsigned int len,
+		unsigned int buf_size)
 {
 	unsigned int i;
 	u8 *buf;
@@ -150,7 +183,7 @@ static void dmatest_init_dsts(u8 **bufs, unsigned int start, unsigned int len)
 		for ( ; i < start + len; i++)
 			buf[i] = PATTERN_DST | PATTERN_OVERWRITE
 				| (~i & PATTERN_COUNT_MASK);
-		for ( ; i < test_buf_size; i++)
+		for ( ; i < buf_size; i++)
 			buf[i] = PATTERN_DST | (~i & PATTERN_COUNT_MASK);
 	}
 }
@@ -268,6 +301,7 @@ static int dmatest_func(void *data)
 	DECLARE_WAIT_QUEUE_HEAD_ONSTACK(done_wait);
 	struct dmatest_thread	*thread = data;
 	struct dmatest_done	done = { .wait = &done_wait };
+	struct dmatest_info	*info;
 	struct dma_chan		*chan;
 	struct dma_device	*dev;
 	const char		*thread_name;
@@ -290,20 +324,21 @@ static int dmatest_func(void *data)
 	ret = -ENOMEM;
 
 	smp_rmb();
+	info = thread->info;
 	chan = thread->chan;
 	dev = chan->device;
 	if (thread->type == DMA_MEMCPY)
 		src_cnt = dst_cnt = 1;
 	else if (thread->type == DMA_XOR) {
 		/* force odd to ensure dst = src */
-		src_cnt = min_odd(xor_sources | 1, dev->max_xor);
+		src_cnt = min_odd(info->xor_sources | 1, dev->max_xor);
 		dst_cnt = 1;
 	} else if (thread->type == DMA_PQ) {
 		/* force odd to ensure dst = src */
-		src_cnt = min_odd(pq_sources | 1, dma_maxpq(dev, 0));
+		src_cnt = min_odd(info->pq_sources | 1, dma_maxpq(dev, 0));
 		dst_cnt = 2;
 
-		pq_coefs = kmalloc(pq_sources+1, GFP_KERNEL);
+		pq_coefs = kmalloc(info->pq_sources+1, GFP_KERNEL);
 		if (!pq_coefs)
 			goto err_thread_type;
 
@@ -316,7 +351,7 @@ static int dmatest_func(void *data)
 	if (!thread->srcs)
 		goto err_srcs;
 	for (i = 0; i < src_cnt; i++) {
-		thread->srcs[i] = kmalloc(test_buf_size, GFP_KERNEL);
+		thread->srcs[i] = kmalloc(info->buf_size, GFP_KERNEL);
 		if (!thread->srcs[i])
 			goto err_srcbuf;
 	}
@@ -326,7 +361,7 @@ static int dmatest_func(void *data)
 	if (!thread->dsts)
 		goto err_dsts;
 	for (i = 0; i < dst_cnt; i++) {
-		thread->dsts[i] = kmalloc(test_buf_size, GFP_KERNEL);
+		thread->dsts[i] = kmalloc(info->buf_size, GFP_KERNEL);
 		if (!thread->dsts[i])
 			goto err_dstbuf;
 	}
@@ -342,7 +377,7 @@ static int dmatest_func(void *data)
 	      | DMA_COMPL_SKIP_DEST_UNMAP | DMA_COMPL_SRC_UNMAP_SINGLE;
 
 	while (!kthread_should_stop()
-	       && !(iterations && total_tests >= iterations)) {
+	       && !(info->iterations && total_tests >= info->iterations)) {
 		struct dma_async_tx_descriptor *tx = NULL;
 		dma_addr_t dma_srcs[src_cnt];
 		dma_addr_t dma_dsts[dst_cnt];
@@ -358,24 +393,24 @@ static int dmatest_func(void *data)
 		else if (thread->type == DMA_PQ)
 			align = dev->pq_align;
 
-		if (1 << align > test_buf_size) {
+		if (1 << align > info->buf_size) {
 			pr_err("%u-byte buffer too small for %d-byte alignment\n",
-			       test_buf_size, 1 << align);
+			       info->buf_size, 1 << align);
 			break;
 		}
 
-		len = dmatest_random() % test_buf_size + 1;
+		len = dmatest_random() % info->buf_size + 1;
 		len = (len >> align) << align;
 		if (!len)
 			len = 1 << align;
-		src_off = dmatest_random() % (test_buf_size - len + 1);
-		dst_off = dmatest_random() % (test_buf_size - len + 1);
+		src_off = dmatest_random() % (info->buf_size - len + 1);
+		dst_off = dmatest_random() % (info->buf_size - len + 1);
 
 		src_off = (src_off >> align) << align;
 		dst_off = (dst_off >> align) << align;
 
-		dmatest_init_srcs(thread->srcs, src_off, len);
-		dmatest_init_dsts(thread->dsts, dst_off, len);
+		dmatest_init_srcs(thread->srcs, src_off, len, info->buf_size);
+		dmatest_init_dsts(thread->dsts, dst_off, len, info->buf_size);
 
 		for (i = 0; i < src_cnt; i++) {
 			u8 *buf = thread->srcs[i] + src_off;
@@ -396,16 +431,16 @@ static int dmatest_func(void *data)
 		/* map with DMA_BIDIRECTIONAL to force writeback/invalidate */
 		for (i = 0; i < dst_cnt; i++) {
 			dma_dsts[i] = dma_map_single(dev->dev, thread->dsts[i],
-						     test_buf_size,
+						     info->buf_size,
 						     DMA_BIDIRECTIONAL);
 			ret = dma_mapping_error(dev->dev, dma_dsts[i]);
 			if (ret) {
 				unmap_src(dev->dev, dma_srcs, len, src_cnt);
-				unmap_dst(dev->dev, dma_dsts, test_buf_size, i);
+				unmap_dst(dev->dev, dma_dsts, info->buf_size, i);
 				pr_warn("%s: #%u: mapping error %d with "
 					"dst_off=0x%x len=0x%x\n",
 					thread_name, total_tests - 1, ret,
-					dst_off, test_buf_size);
+					dst_off, info->buf_size);
 				failed_tests++;
 				continue;
 			}
@@ -433,7 +468,7 @@ static int dmatest_func(void *data)
 
 		if (!tx) {
 			unmap_src(dev->dev, dma_srcs, len, src_cnt);
-			unmap_dst(dev->dev, dma_dsts, test_buf_size, dst_cnt);
+			unmap_dst(dev->dev, dma_dsts, info->buf_size, dst_cnt);
 			pr_warning("%s: #%u: prep error with src_off=0x%x "
 					"dst_off=0x%x len=0x%x\n",
 					thread_name, total_tests - 1,
@@ -461,7 +496,7 @@ static int dmatest_func(void *data)
 
 		wait_event_freezable_timeout(done_wait,
 					     done.done || kthread_should_stop(),
-					     msecs_to_jiffies(timeout));
+					     msecs_to_jiffies(info->timeout));
 
 		status = dma_async_is_tx_complete(chan, cookie, NULL, NULL);
 
@@ -488,7 +523,7 @@ static int dmatest_func(void *data)
 		}
 
 		/* Unmap by myself (see DMA_COMPL_SKIP_DEST_UNMAP above) */
-		unmap_dst(dev->dev, dma_dsts, test_buf_size, dst_cnt);
+		unmap_dst(dev->dev, dma_dsts, info->buf_size, dst_cnt);
 
 		error_count = 0;
 
@@ -499,7 +534,7 @@ static int dmatest_func(void *data)
 				src_off + len, src_off,
 				PATTERN_SRC | PATTERN_COPY, true);
 		error_count += dmatest_verify(thread->srcs, src_off + len,
-				test_buf_size, src_off + len,
+				info->buf_size, src_off + len,
 				PATTERN_SRC, true);
 
 		pr_debug("%s: verifying dest buffer...\n",
@@ -510,7 +545,7 @@ static int dmatest_func(void *data)
 				dst_off + len, src_off,
 				PATTERN_SRC | PATTERN_COPY, false);
 		error_count += dmatest_verify(thread->dsts, dst_off + len,
-				test_buf_size, dst_off + len,
+				info->buf_size, dst_off + len,
 				PATTERN_DST, false);
 
 		if (error_count) {
@@ -547,7 +582,7 @@ err_thread_type:
 	if (ret)
 		dmaengine_terminate_all(chan);
 
-	if (iterations > 0)
+	if (info->iterations > 0)
 		while (!kthread_should_stop()) {
 			DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait_dmatest_exit);
 			interruptible_sleep_on(&wait_dmatest_exit);
@@ -576,7 +611,8 @@ static void dmatest_cleanup_channel(struct dmatest_chan *dtc)
 	kfree(dtc);
 }
 
-static int dmatest_add_threads(struct dmatest_chan *dtc, enum dma_transaction_type type)
+static int dmatest_add_threads(struct dmatest_info *info,
+		struct dmatest_chan *dtc, enum dma_transaction_type type)
 {
 	struct dmatest_thread *thread;
 	struct dma_chan *chan = dtc->chan;
@@ -592,7 +628,7 @@ static int dmatest_add_threads(struct dmatest_chan *dtc, enum dma_transaction_ty
 	else
 		return -EINVAL;
 
-	for (i = 0; i < threads_per_chan; i++) {
+	for (i = 0; i < info->threads_per_chan; i++) {
 		thread = kzalloc(sizeof(struct dmatest_thread), GFP_KERNEL);
 		if (!thread) {
 			pr_warning("dmatest: No memory for %s-%s%u\n",
@@ -600,6 +636,7 @@ static int dmatest_add_threads(struct dmatest_chan *dtc, enum dma_transaction_ty
 
 			break;
 		}
+		thread->info = info;
 		thread->chan = dtc->chan;
 		thread->type = type;
 		smp_wmb();
@@ -620,7 +657,8 @@ static int dmatest_add_threads(struct dmatest_chan *dtc, enum dma_transaction_ty
 	return i;
 }
 
-static int dmatest_add_channel(struct dma_chan *chan)
+static int dmatest_add_channel(struct dmatest_info *info,
+		struct dma_chan *chan)
 {
 	struct dmatest_chan	*dtc;
 	struct dma_device	*dma_dev = chan->device;
@@ -637,15 +675,15 @@ static int dmatest_add_channel(struct dma_chan *chan)
 	INIT_LIST_HEAD(&dtc->threads);
 
 	if (dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask)) {
-		cnt = dmatest_add_threads(dtc, DMA_MEMCPY);
+		cnt = dmatest_add_threads(info, dtc, DMA_MEMCPY);
 		thread_count += cnt > 0 ? cnt : 0;
 	}
 	if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) {
-		cnt = dmatest_add_threads(dtc, DMA_XOR);
+		cnt = dmatest_add_threads(info, dtc, DMA_XOR);
 		thread_count += cnt > 0 ? cnt : 0;
 	}
 	if (dma_has_cap(DMA_PQ, dma_dev->cap_mask)) {
-		cnt = dmatest_add_threads(dtc, DMA_PQ);
+		cnt = dmatest_add_threads(info, dtc, DMA_PQ);
 		thread_count += cnt > 0 ? cnt : 0;
 	}
 
@@ -660,13 +698,16 @@ static int dmatest_add_channel(struct dma_chan *chan)
 
 static bool filter(struct dma_chan *chan, void *param)
 {
-	if (!dmatest_match_channel(chan) || !dmatest_match_device(chan->device))
+	struct dmatest_info *info = param;
+
+	if (!dmatest_match_channel(info, chan) ||
+	    !dmatest_match_device(info, chan->device))
 		return false;
 	else
 		return true;
 }
 
-static int __init dmatest_init(void)
+static int run_threaded_test(struct dmatest_info *info)
 {
 	dma_cap_mask_t mask;
 	struct dma_chan *chan;
@@ -675,25 +716,22 @@ static int __init dmatest_init(void)
 	dma_cap_zero(mask);
 	dma_cap_set(DMA_MEMCPY, mask);
 	for (;;) {
-		chan = dma_request_channel(mask, filter, NULL);
+		chan = dma_request_channel(mask, filter, info);
 		if (chan) {
-			err = dmatest_add_channel(chan);
+			err = dmatest_add_channel(info, chan);
 			if (err) {
 				dma_release_channel(chan);
 				break; /* add_channel failed, punt */
 			}
 		} else
 			break; /* no more channels available */
-		if (max_channels && nr_channels >= max_channels)
+		if (info->max_channels && nr_channels >= info->max_channels)
 			break; /* we have all we need */
 	}
-
 	return err;
 }
-/* when compiled-in wait for drivers to load first */
-late_initcall(dmatest_init);
 
-static void __exit dmatest_exit(void)
+static void stop_threaded_test(struct dmatest_info *info)
 {
 	struct dmatest_chan *dtc, *_dtc;
 	struct dma_chan *chan;
@@ -707,6 +745,34 @@ static void __exit dmatest_exit(void)
 		dma_release_channel(chan);
 	}
 }
+
+static int __init dmatest_init(void)
+{
+	struct dmatest_info *info = &test_info;
+
+	memset(info, 0, sizeof(*info));
+
+	info->buf_size = test_buf_size;
+	strlcpy(info->channel, test_channel, sizeof(info->channel));
+	strlcpy(info->device, test_device, sizeof(info->device));
+	info->threads_per_chan = threads_per_chan;
+	info->max_channels = max_channels;
+	info->iterations = iterations;
+	info->xor_sources = xor_sources;
+	info->pq_sources = pq_sources;
+	info->timeout = timeout;
+
+	return run_threaded_test(info);
+}
+/* when compiled-in wait for drivers to load first */
+late_initcall(dmatest_init);
+
+static void __exit dmatest_exit(void)
+{
+	struct dmatest_info *info = &test_info;
+
+	stop_threaded_test(info);
+}
 module_exit(dmatest_exit);
 
 MODULE_AUTHOR("Haavard Skinnemoen (Atmel)");
Signature · 1 line
1.8.2.rc0.22.gb3600c3
Acked-by on v1 3/10
#6 lore raw

Re: [PATCH 03/10] dmatest: create dmatest_info to keep test parameters

Quoted 11 lines · Andy Shevchenko

The proposed change will remove usage of the module parameters as global variables. In future it helps to run different test cases sequentially.

The patch introduces the run_threaded_test() and stop_threaded_test() functions that could be used later outside of dmatest_init, dmatest_exit scope.

---
 drivers/dma/dmatest.c | 160 +++++++++++++++++++++++++++++++++++---------------
 1 file changed, 113 insertions(+), 47 deletions(-)
#7 lore raw

PATCH 4/10 dmatest: move dmatest_channels and nr_channels to dmatest_info

In reply to Andy Shevchenko

We don't need to have them global and later we would like to protect access to them as well.

---
 drivers/dma/dmatest.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)
drivers/dma/dmatest.c +16 -13
index 7f9e3cc..475a21a 100644
@@ -109,6 +109,7 @@ struct dmatest_chan {
  * @timeout:		transfer timeout in msec, -1 for infinite timeout
  */
 struct dmatest_info {
+	/* Test parameters */
 	unsigned int	buf_size;
 	char		channel[20];
 	char		device[20];
@@ -118,17 +119,14 @@ struct dmatest_info {
 	unsigned int	xor_sources;
 	unsigned int	pq_sources;
 	int		timeout;
+
+	/* Internal state */
+	struct list_head	channels;
+	unsigned int		nr_channels;
 };
 
 static struct dmatest_info test_info;
 
-/*
- * These are protected by dma_list_mutex since they're only used by
- * the DMA filter function callback
- */
-static LIST_HEAD(dmatest_channels);
-static unsigned int nr_channels;
-
 static bool dmatest_match_channel(struct dmatest_info *info,
 		struct dma_chan *chan)
 {
@@ -690,8 +688,8 @@ static int dmatest_add_channel(struct dmatest_info *info,
 	pr_info("dmatest: Started %u threads using %s\n",
 		thread_count, dma_chan_name(chan));
 
-	list_add_tail(&dtc->node, &dmatest_channels);
-	nr_channels++;
+	list_add_tail(&dtc->node, &info->channels);
+	info->nr_channels++;
 
 	return 0;
 }
@@ -725,7 +723,8 @@ static int run_threaded_test(struct dmatest_info *info)
 			}
 		} else
 			break; /* no more channels available */
-		if (info->max_channels && nr_channels >= info->max_channels)
+		if (info->max_channels &&
+		    info->nr_channels >= info->max_channels)
 			break; /* we have all we need */
 	}
 	return err;
@@ -736,14 +735,15 @@ static void stop_threaded_test(struct dmatest_info *info)
 	struct dmatest_chan *dtc, *_dtc;
 	struct dma_chan *chan;
 
-	list_for_each_entry_safe(dtc, _dtc, &dmatest_channels, node) {
+	list_for_each_entry_safe(dtc, _dtc, &info->channels, node) {
 		list_del(&dtc->node);
 		chan = dtc->chan;
 		dmatest_cleanup_channel(dtc);
-		pr_debug("dmatest: dropped channel %s\n",
-			 dma_chan_name(chan));
+		pr_debug("dmatest: dropped channel %s\n", dma_chan_name(chan));
 		dma_release_channel(chan);
 	}
+
+	info->nr_channels = 0;
 }
 
 static int __init dmatest_init(void)
@@ -752,6 +752,9 @@ static int __init dmatest_init(void)
 
 	memset(info, 0, sizeof(*info));
 
+	INIT_LIST_HEAD(&info->channels);
+
+	/* Set default parameters */
 	info->buf_size = test_buf_size;
 	strlcpy(info->channel, test_channel, sizeof(info->channel));
 	strlcpy(info->device, test_device, sizeof(info->device));
Signature · 1 line
1.8.2.rc0.22.gb3600c3
Acked-by on v1 4/10
#8 lore raw

Re: [PATCH 04/10] dmatest: move dmatest_channels and nr_channels to dmatest_info

Quoted 21 lines · Andy Shevchenko

We don't need to have them global and later we would like to protect access to them as well.

---
 drivers/dma/dmatest.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)
drivers/dma/dmatest.c +1 -0
index 7f9e3cc..475a21a 100644
@@ -109,6 +109,7 @@ struct dmatest_chan {
  * @timeout:           transfer timeout in msec, -1 for infinite timeout
  */
 struct dmatest_info {
+       /* Test parameters */
        unsigned int    buf_size;
        char            channel[20];
        char            device[20];

drivers/dma/dmatest.c struct dmatest_info { · line 126

Quoted 8 lines
drivers/dma/dmatest.c +4 -0
@@ -118,17 +119,14 @@ struct dmatest_info {
        unsigned int    xor_sources;
        unsigned int    pq_sources;
        int             timeout;
+
+       /* Internal state */
+       struct list_head        channels;
+       unsigned int            nr_channels;
 };

What about merging this patch with the patch which added this structure.

#9 lore raw

Re: [PATCH 04/10] dmatest: move dmatest_channels and nr_channels to dmatest_info

Quoted 34 lines · Viresh Kumar
Quoted 21 lines · Andy Shevchenko

We don't need to have them global and later we would like to protect access to them as well.

---
 drivers/dma/dmatest.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)
drivers/dma/dmatest.c +1 -0
index 7f9e3cc..475a21a 100644
@@ -109,6 +109,7 @@ struct dmatest_chan {
  * @timeout:           transfer timeout in msec, -1 for infinite timeout
  */
 struct dmatest_info {
+       /* Test parameters */
        unsigned int    buf_size;
        char            channel[20];
        char            device[20];

drivers/dma/dmatest.c struct dmatest_info { · line 126

Quoted 8 lines
drivers/dma/dmatest.c +4 -0
@@ -118,17 +119,14 @@ struct dmatest_info {
        unsigned int    xor_sources;
        unsigned int    pq_sources;
        int             timeout;
+
+       /* Internal state */
+       struct list_head        channels;
+       unsigned int            nr_channels;
 };
Quoted 1 line

What about merging this patch with the patch which added this structure.

As I said in cover letter I believe that few patches could be merged, but I would like to discuss the main point first.

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#10 lore raw

Re: [PATCH 04/10] dmatest: move dmatest_channels and nr_channels to dmatest_info

In reply to Andy Shevchenko
Quoted 21 lines · Andy Shevchenko

We don't need to have them global and later we would like to protect access to them as well.

---
 drivers/dma/dmatest.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)
drivers/dma/dmatest.c +1 -0
index 7f9e3cc..475a21a 100644
@@ -109,6 +109,7 @@ struct dmatest_chan {
  * @timeout:		transfer timeout in msec, -1 for infinite timeout
  */
 struct dmatest_info {
+	/* Test parameters */
 	unsigned int	buf_size;
 	char		channel[20];
 	char		device[20];

drivers/dma/dmatest.c struct dmatest_info { · line 126

Quoted 8 lines
drivers/dma/dmatest.c +4 -0
@@ -118,17 +119,14 @@ struct dmatest_info {
 	unsigned int	xor_sources;
 	unsigned int	pq_sources;
 	int		timeout;
+
+	/* Internal state */
+	struct list_head	channels;
+	unsigned int		nr_channels;
 };

Ideally this should be folded into previous...

Quoted 66 lines
drivers/dma/dmatest.c +11 -13
 static struct dmatest_info test_info;
 
-/*
- * These are protected by dma_list_mutex since they're only used by
- * the DMA filter function callback
- */
-static LIST_HEAD(dmatest_channels);
-static unsigned int nr_channels;
-
 static bool dmatest_match_channel(struct dmatest_info *info,
 		struct dma_chan *chan)
 {
@@ -690,8 +688,8 @@ static int dmatest_add_channel(struct dmatest_info *info,
 	pr_info("dmatest: Started %u threads using %s\n",
 		thread_count, dma_chan_name(chan));
 
-	list_add_tail(&dtc->node, &dmatest_channels);
-	nr_channels++;
+	list_add_tail(&dtc->node, &info->channels);
+	info->nr_channels++;
 
 	return 0;
 }
@@ -725,7 +723,8 @@ static int run_threaded_test(struct dmatest_info *info)
 			}
 		} else
 			break; /* no more channels available */
-		if (info->max_channels && nr_channels >= info->max_channels)
+		if (info->max_channels &&
+		    info->nr_channels >= info->max_channels)
 			break; /* we have all we need */
 	}
 	return err;
@@ -736,14 +735,15 @@ static void stop_threaded_test(struct dmatest_info *info)
 	struct dmatest_chan *dtc, *_dtc;
 	struct dma_chan *chan;
 
-	list_for_each_entry_safe(dtc, _dtc, &dmatest_channels, node) {
+	list_for_each_entry_safe(dtc, _dtc, &info->channels, node) {
 		list_del(&dtc->node);
 		chan = dtc->chan;
 		dmatest_cleanup_channel(dtc);
-		pr_debug("dmatest: dropped channel %s\n",
-			 dma_chan_name(chan));
+		pr_debug("dmatest: dropped channel %s\n", dma_chan_name(chan));
 		dma_release_channel(chan);
 	}
+
+	info->nr_channels = 0;
 }
 
 static int __init dmatest_init(void)
@@ -752,6 +752,9 @@ static int __init dmatest_init(void)
 
 	memset(info, 0, sizeof(*info));
 
+	INIT_LIST_HEAD(&info->channels);
+
+	/* Set default parameters */
 	info->buf_size = test_buf_size;
 	strlcpy(info->channel, test_channel, sizeof(info->channel));
 	strlcpy(info->device, test_device, sizeof(info->device));
Signature · 1 line
1.8.2.rc0.22.gb3600c3
#11 lore raw

PATCH 5/10 dmatest: split test parameters to separate structure

In reply to Andy Shevchenko

Better to keep test parameters separate from internal variables.

---
 drivers/dma/dmatest.c | 109 ++++++++++++++++++++++++++++----------------------
 1 file changed, 62 insertions(+), 47 deletions(-)
drivers/dma/dmatest.c +62 -47
index 475a21a..c6e5d83 100644
@@ -97,7 +97,7 @@ struct dmatest_chan {
 };
 
 /**
- * struct dmatest_info - test information.
+ * struct dmatest_params - test parameters.
  * @buf_size:		size of the memcpy test buffer
  * @channel:		bus ID of the channel to test
  * @device:		bus ID of the DMA Engine to test
@@ -108,8 +108,7 @@ struct dmatest_chan {
  * @pq_sources:		number of p+q source buffers
  * @timeout:		transfer timeout in msec, -1 for infinite timeout
  */
-struct dmatest_info {
-	/* Test parameters */
+struct dmatest_params {
 	unsigned int	buf_size;
 	char		channel[20];
 	char		device[20];
@@ -119,6 +118,15 @@ struct dmatest_info {
 	unsigned int	xor_sources;
 	unsigned int	pq_sources;
 	int		timeout;
+};
+
+/**
+ * struct dmatest_info - test information.
+ * @params:		test parameters
+ */
+struct dmatest_info {
+	/* Test parameters */
+	struct dmatest_params	params;
 
 	/* Internal state */
 	struct list_head	channels;
@@ -127,20 +135,20 @@ struct dmatest_info {
 
 static struct dmatest_info test_info;
 
-static bool dmatest_match_channel(struct dmatest_info *info,
+static bool dmatest_match_channel(struct dmatest_params *params,
 		struct dma_chan *chan)
 {
-	if (info->channel[0] == '\0')
+	if (params->channel[0] == '\0')
 		return true;
-	return strcmp(dma_chan_name(chan), info->channel) == 0;
+	return strcmp(dma_chan_name(chan), params->channel) == 0;
 }
 
-static bool dmatest_match_device(struct dmatest_info *info,
+static bool dmatest_match_device(struct dmatest_params *params,
 		struct dma_device *device)
 {
-	if (info->device[0] == '\0')
+	if (params->device[0] == '\0')
 		return true;
-	return strcmp(dev_name(device->dev), info->device) == 0;
+	return strcmp(dev_name(device->dev), params->device) == 0;
 }
 
 static unsigned long dmatest_random(void)
@@ -300,6 +308,7 @@ static int dmatest_func(void *data)
 	struct dmatest_thread	*thread = data;
 	struct dmatest_done	done = { .wait = &done_wait };
 	struct dmatest_info	*info;
+	struct dmatest_params	*params;
 	struct dma_chan		*chan;
 	struct dma_device	*dev;
 	const char		*thread_name;
@@ -323,20 +332,21 @@ static int dmatest_func(void *data)
 
 	smp_rmb();
 	info = thread->info;
+	params = &info->params;
 	chan = thread->chan;
 	dev = chan->device;
 	if (thread->type == DMA_MEMCPY)
 		src_cnt = dst_cnt = 1;
 	else if (thread->type == DMA_XOR) {
 		/* force odd to ensure dst = src */
-		src_cnt = min_odd(info->xor_sources | 1, dev->max_xor);
+		src_cnt = min_odd(params->xor_sources | 1, dev->max_xor);
 		dst_cnt = 1;
 	} else if (thread->type == DMA_PQ) {
 		/* force odd to ensure dst = src */
-		src_cnt = min_odd(info->pq_sources | 1, dma_maxpq(dev, 0));
+		src_cnt = min_odd(params->pq_sources | 1, dma_maxpq(dev, 0));
 		dst_cnt = 2;
 
-		pq_coefs = kmalloc(info->pq_sources+1, GFP_KERNEL);
+		pq_coefs = kmalloc(params->pq_sources+1, GFP_KERNEL);
 		if (!pq_coefs)
 			goto err_thread_type;
 
@@ -349,7 +359,7 @@ static int dmatest_func(void *data)
 	if (!thread->srcs)
 		goto err_srcs;
 	for (i = 0; i < src_cnt; i++) {
-		thread->srcs[i] = kmalloc(info->buf_size, GFP_KERNEL);
+		thread->srcs[i] = kmalloc(params->buf_size, GFP_KERNEL);
 		if (!thread->srcs[i])
 			goto err_srcbuf;
 	}
@@ -359,7 +369,7 @@ static int dmatest_func(void *data)
 	if (!thread->dsts)
 		goto err_dsts;
 	for (i = 0; i < dst_cnt; i++) {
-		thread->dsts[i] = kmalloc(info->buf_size, GFP_KERNEL);
+		thread->dsts[i] = kmalloc(params->buf_size, GFP_KERNEL);
 		if (!thread->dsts[i])
 			goto err_dstbuf;
 	}
@@ -375,7 +385,7 @@ static int dmatest_func(void *data)
 	      | DMA_COMPL_SKIP_DEST_UNMAP | DMA_COMPL_SRC_UNMAP_SINGLE;
 
 	while (!kthread_should_stop()
-	       && !(info->iterations && total_tests >= info->iterations)) {
+	       && !(params->iterations && total_tests >= params->iterations)) {
 		struct dma_async_tx_descriptor *tx = NULL;
 		dma_addr_t dma_srcs[src_cnt];
 		dma_addr_t dma_dsts[dst_cnt];
@@ -391,24 +401,24 @@ static int dmatest_func(void *data)
 		else if (thread->type == DMA_PQ)
 			align = dev->pq_align;
 
-		if (1 << align > info->buf_size) {
+		if (1 << align > params->buf_size) {
 			pr_err("%u-byte buffer too small for %d-byte alignment\n",
-			       info->buf_size, 1 << align);
+			       params->buf_size, 1 << align);
 			break;
 		}
 
-		len = dmatest_random() % info->buf_size + 1;
+		len = dmatest_random() % params->buf_size + 1;
 		len = (len >> align) << align;
 		if (!len)
 			len = 1 << align;
-		src_off = dmatest_random() % (info->buf_size - len + 1);
-		dst_off = dmatest_random() % (info->buf_size - len + 1);
+		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;
 
-		dmatest_init_srcs(thread->srcs, src_off, len, info->buf_size);
-		dmatest_init_dsts(thread->dsts, dst_off, len, info->buf_size);
+		dmatest_init_srcs(thread->srcs, src_off, len, params->buf_size);
+		dmatest_init_dsts(thread->dsts, dst_off, len, params->buf_size);
 
 		for (i = 0; i < src_cnt; i++) {
 			u8 *buf = thread->srcs[i] + src_off;
@@ -429,16 +439,17 @@ static int dmatest_func(void *data)
 		/* map with DMA_BIDIRECTIONAL to force writeback/invalidate */
 		for (i = 0; i < dst_cnt; i++) {
 			dma_dsts[i] = dma_map_single(dev->dev, thread->dsts[i],
-						     info->buf_size,
+						     params->buf_size,
 						     DMA_BIDIRECTIONAL);
 			ret = dma_mapping_error(dev->dev, dma_dsts[i]);
 			if (ret) {
 				unmap_src(dev->dev, dma_srcs, len, src_cnt);
-				unmap_dst(dev->dev, dma_dsts, info->buf_size, i);
+				unmap_dst(dev->dev, dma_dsts, params->buf_size,
+					  i);
 				pr_warn("%s: #%u: mapping error %d with "
 					"dst_off=0x%x len=0x%x\n",
 					thread_name, total_tests - 1, ret,
-					dst_off, info->buf_size);
+					dst_off, params->buf_size);
 				failed_tests++;
 				continue;
 			}
@@ -466,7 +477,8 @@ static int dmatest_func(void *data)
 
 		if (!tx) {
 			unmap_src(dev->dev, dma_srcs, len, src_cnt);
-			unmap_dst(dev->dev, dma_dsts, info->buf_size, dst_cnt);
+			unmap_dst(dev->dev, dma_dsts, params->buf_size,
+				  dst_cnt);
 			pr_warning("%s: #%u: prep error with src_off=0x%x "
 					"dst_off=0x%x len=0x%x\n",
 					thread_name, total_tests - 1,
@@ -494,7 +506,7 @@ static int dmatest_func(void *data)
 
 		wait_event_freezable_timeout(done_wait,
 					     done.done || kthread_should_stop(),
-					     msecs_to_jiffies(info->timeout));
+					     msecs_to_jiffies(params->timeout));
 
 		status = dma_async_is_tx_complete(chan, cookie, NULL, NULL);
 
@@ -521,7 +533,7 @@ static int dmatest_func(void *data)
 		}
 
 		/* Unmap by myself (see DMA_COMPL_SKIP_DEST_UNMAP above) */
-		unmap_dst(dev->dev, dma_dsts, info->buf_size, dst_cnt);
+		unmap_dst(dev->dev, dma_dsts, params->buf_size, dst_cnt);
 
 		error_count = 0;
 
@@ -532,7 +544,7 @@ static int dmatest_func(void *data)
 				src_off + len, src_off,
 				PATTERN_SRC | PATTERN_COPY, true);
 		error_count += dmatest_verify(thread->srcs, src_off + len,
-				info->buf_size, src_off + len,
+				params->buf_size, src_off + len,
 				PATTERN_SRC, true);
 
 		pr_debug("%s: verifying dest buffer...\n",
@@ -543,7 +555,7 @@ static int dmatest_func(void *data)
 				dst_off + len, src_off,
 				PATTERN_SRC | PATTERN_COPY, false);
 		error_count += dmatest_verify(thread->dsts, dst_off + len,
-				info->buf_size, dst_off + len,
+				params->buf_size, dst_off + len,
 				PATTERN_DST, false);
 
 		if (error_count) {
@@ -580,7 +592,7 @@ err_thread_type:
 	if (ret)
 		dmaengine_terminate_all(chan);
 
-	if (info->iterations > 0)
+	if (params->iterations > 0)
 		while (!kthread_should_stop()) {
 			DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait_dmatest_exit);
 			interruptible_sleep_on(&wait_dmatest_exit);
@@ -612,6 +624,7 @@ static void dmatest_cleanup_channel(struct dmatest_chan *dtc)
 static int dmatest_add_threads(struct dmatest_info *info,
 		struct dmatest_chan *dtc, enum dma_transaction_type type)
 {
+	struct dmatest_params *params = &info->params;
 	struct dmatest_thread *thread;
 	struct dma_chan *chan = dtc->chan;
 	char *op;
@@ -626,7 +639,7 @@ static int dmatest_add_threads(struct dmatest_info *info,
 	else
 		return -EINVAL;
 
-	for (i = 0; i < info->threads_per_chan; i++) {
+	for (i = 0; i < params->threads_per_chan; i++) {
 		thread = kzalloc(sizeof(struct dmatest_thread), GFP_KERNEL);
 		if (!thread) {
 			pr_warning("dmatest: No memory for %s-%s%u\n",
@@ -696,10 +709,10 @@ static int dmatest_add_channel(struct dmatest_info *info,
 
 static bool filter(struct dma_chan *chan, void *param)
 {
-	struct dmatest_info *info = param;
+	struct dmatest_params *params = param;
 
-	if (!dmatest_match_channel(info, chan) ||
-	    !dmatest_match_device(info, chan->device))
+	if (!dmatest_match_channel(params, chan) ||
+	    !dmatest_match_device(params, chan->device))
 		return false;
 	else
 		return true;
@@ -709,12 +722,13 @@ static int run_threaded_test(struct dmatest_info *info)
 {
 	dma_cap_mask_t mask;
 	struct dma_chan *chan;
+	struct dmatest_params *params = &info->params;
 	int err = 0;
 
 	dma_cap_zero(mask);
 	dma_cap_set(DMA_MEMCPY, mask);
 	for (;;) {
-		chan = dma_request_channel(mask, filter, info);
+		chan = dma_request_channel(mask, filter, params);
 		if (chan) {
 			err = dmatest_add_channel(info, chan);
 			if (err) {
@@ -723,8 +737,8 @@ static int run_threaded_test(struct dmatest_info *info)
 			}
 		} else
 			break; /* no more channels available */
-		if (info->max_channels &&
-		    info->nr_channels >= info->max_channels)
+		if (params->max_channels &&
+		    info->nr_channels >= params->max_channels)
 			break; /* we have all we need */
 	}
 	return err;
@@ -749,21 +763,22 @@ static void stop_threaded_test(struct dmatest_info *info)
 static int __init dmatest_init(void)
 {
 	struct dmatest_info *info = &test_info;
+	struct dmatest_params *params = &info->params;
 
 	memset(info, 0, sizeof(*info));
 
 	INIT_LIST_HEAD(&info->channels);
 
 	/* Set default parameters */
-	info->buf_size = test_buf_size;
-	strlcpy(info->channel, test_channel, sizeof(info->channel));
-	strlcpy(info->device, test_device, sizeof(info->device));
-	info->threads_per_chan = threads_per_chan;
-	info->max_channels = max_channels;
-	info->iterations = iterations;
-	info->xor_sources = xor_sources;
-	info->pq_sources = pq_sources;
-	info->timeout = timeout;
+	params->buf_size = test_buf_size;
+	strlcpy(params->channel, test_channel, sizeof(params->channel));
+	strlcpy(params->device, test_device, sizeof(params->device));
+	params->threads_per_chan = threads_per_chan;
+	params->max_channels = max_channels;
+	params->iterations = iterations;
+	params->xor_sources = xor_sources;
+	params->pq_sources = pq_sources;
+	params->timeout = timeout;
 
 	return run_threaded_test(info);
 }
Signature · 1 line
1.8.2.rc0.22.gb3600c3
Acked-by on v1 5/10
#12 lore raw

Re: [PATCH 05/10] dmatest: split test parameters to separate structure

Quoted 6 lines · Andy Shevchenko

Better to keep test parameters separate from internal variables.

---
 drivers/dma/dmatest.c | 109 ++++++++++++++++++++++++++++----------------------
 1 file changed, 62 insertions(+), 47 deletions(-)

Though i don't feel a real need of keeping this in separate patches. We can have one for fixing these :)

#13 lore raw

Re: [PATCH 05/10] dmatest: split test parameters to separate structure

Quoted 9 lines · Viresh Kumar
Quoted 6 lines · Andy Shevchenko

Better to keep test parameters separate from internal variables.

---
 drivers/dma/dmatest.c | 109 ++++++++++++++++++++++++++++----------------------
 1 file changed, 62 insertions(+), 47 deletions(-)
Quoted 4 lines

Though i don't feel a real need of keeping this in separate patches. We can have one for fixing these :)

Do you mean to merge patche 3,4, and 5 into one?

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#14 lore raw

PATCH 6/10 dmatest: run test via debugfs

In reply to Andy Shevchenko

Instead of doing
modprobe dmatest ...
modprobe -r dmatest
we allow user to run tests interactively.

The dmatest could be built as module or inside kernel. Let's consider those cases.

1. When dmatest is built as a module...

After mounting debugfs and loading the module, the /sys/kernel/debug/dmatest folder with nodes will be created. They are the same as module parameters with addition of the 'run' node that controls run and stop phases of the test.

Note that in this case test will not run on load automatically.

Example of usage:
% echo dma0chan0 > /sys/kernel/debug/dmatest/channel % echo 2000 > /sys/kernel/debug/dmatest/timeout % echo 1 > /sys/kernel/debug/dmatest/iterations % echo 1 > /sys/kernel/debug/dmatest/run

After a while you will start to get messages about current status or error like in the original code.

Note that running a new test will stop any in progress test.

2. When built-in in the kernel...

The module parameters that is supplied to the kernel command line will be used for the first performed test. After user gets a control, the test could be interrupted or re-run with same or different parameters. For the details see the above section "1. When dmatest is built as a module..."

In both cases the module parameters are used as initial values for the test case. You always could check them at run-time by running
% grep -H . /sys/module/dmatest/parameters/*

---
 Documentation/dmatest.txt |  48 +++++++++
 drivers/dma/dmatest.c     | 257 +++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 303 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/dmatest.txt
Documentation/dmatest.txt new file +48 -0
new file mode 100644
index 0000000..9a90729
@@ -0,0 +1,48 @@
+				DMA Test Guide
+				==============
+
+		Andy Shevchenko <[email protected]>
+
+This small document introduces how to test DMA drivers using dmatest module.
+
+	Part 1 - How to build the test module
+
+The menuconfig contains an option that could be found by following path:
+	Device Drivers -> DMA Engine support -> DMA Test client
+
+In the configuration file the option called CONFIG_DMATEST. The dmatest could
+be built as module or inside kernel. Let's consider those cases.
+
+	Part 2 - When dmatest is built as a module...
+
+After mounting debugfs and loading the module, the /sys/kernel/debug/dmatest
+folder with nodes will be created. They are the same as module parameters with
+addition of the 'run' node that controls run and stop phases of the test.
+
+Note that in this case test will not run on load automatically.
+
+Example of usage:
+	% echo dma0chan0 > /sys/kernel/debug/dmatest/channel
+	% echo 2000 > /sys/kernel/debug/dmatest/timeout
+	% echo 1 > /sys/kernel/debug/dmatest/iterations
+	% echo 1 > /sys/kernel/debug/dmatest/run
+
+Hint: available channel list could be extracted by running the following
+command:
+	% ls -1 /sys/class/dma/
+
+After a while you will start to get messages about current status or error like
+in the original code.
+
+Note that running a new test will stop any in progress test.
+
+	Part 3 - When built-in in the kernel...
+
+The module parameters that is supplied to the kernel command line will be used
+for the first performed test. After user gets a control, the test could be
+interrupted or re-run with same or different parameters. For the details see
+the above section "Part 2 - When dmatest is built as a module..."
+
+In both cases the module parameters are used as initial values for the test case.
+You always could check them at run-time by running
+	% grep -H . /sys/module/dmatest/parameters/*
drivers/dma/dmatest.c +255 -2

319 lines not on this page · raw message

Signature · 1 line
1.8.2.rc0.22.gb3600c3
#15 lore raw

Re: [PATCH 06/10] dmatest: run test via debugfs

Quoted 19 lines · Andy Shevchenko
Documentation/dmatest.txt new file +18 -0
@@ -0,0 +1,48 @@
+				DMA Test Guide
+				==============
+
+		Andy Shevchenko <[email protected]>
+
+This small document introduces how to test DMA drivers using dmatest module.
+
+	Part 1 - How to build the test module
+
+The menuconfig contains an option that could be found by following path:
+	Device Drivers -> DMA Engine support -> DMA Test client
+
+In the configuration file the option called CONFIG_DMATEST. The dmatest could
+be built as module or inside kernel. Let's consider those cases.
+
+	Part 2 - When dmatest is built as a module...
+
+After mounting debugfs and loading the module, the /sys/kernel/debug/dmatest

Documentation/dmatest.txt line 28

Quoted 10 lines
Documentation/dmatest.txt new file +10 -0
+folder with nodes will be created. They are the same as module parameters with
+addition of the 'run' node that controls run and stop phases of the test.
+
+Note that in this case test will not run on load automatically.
+
+Example of usage:
+	% echo dma0chan0 > /sys/kernel/debug/dmatest/channel
+	% echo 2000 > /sys/kernel/debug/dmatest/timeout
+	% echo 1 > /sys/kernel/debug/dmatest/iterations
+	% echo 1 > /sys/kernel/debug/dmatest/run

How do you terminate a test? Esp if you have started bunch of concurent tests and want to terminate one of them...

Quoted 46 lines
drivers/dma/dmatest.c +24 -2
 static struct dmatest_info test_info;
@@ -718,7 +729,7 @@ static bool filter(struct dma_chan *chan, void *param)
 		return true;
 }
 
-static int run_threaded_test(struct dmatest_info *info)
+static int __run_threaded_test(struct dmatest_info *info)
 {
 	dma_cap_mask_t mask;
 	struct dma_chan *chan;
@@ -744,7 +755,19 @@ static int run_threaded_test(struct dmatest_info *info)
 	return err;
 }
 
-static void stop_threaded_test(struct dmatest_info *info)
+#ifndef MODULE
+static int run_threaded_test(struct dmatest_info *info)
+{
+	int ret;
+
+	mutex_lock(&info->lock);
+	ret = __run_threaded_test(info);
+	mutex_unlock(&info->lock);
+	return ret;
+}
+#endif
+
+static void __stop_threaded_test(struct dmatest_info *info)
 {
 	struct dmatest_chan *dtc, *_dtc;
 	struct dma_chan *chan;
@@ -760,13 +783,234 @@ static void stop_threaded_test(struct dmatest_info *info)
 	info->nr_channels = 0;
 }
 
+static void stop_threaded_test(struct dmatest_info *info)
+{
+	mutex_lock(&info->lock);
+	__stop_threaded_test(info);
+	mutex_unlock(&info->lock);
+}
+
+static int __restart_threaded_test(struct dmatest_info *info, bool run)
+{
+	struct dmatest_params *params = &info->params;

drivers/dma/dmatest.c static void stop_threaded_test(struct dmatest_info *info) · line 805

Quoted 10 lines
drivers/dma/dmatest.c +10 -0
+	int ret;
+
+	/* Stop any running test first */
+	__stop_threaded_test(info);
+
+	if (run == false)
+		return 0;
+
+	/* Copy test parameters */
+	memcpy(params, &info->dbgfs_params, sizeof(*params));

what if the params are not yet filled by user... for module case?

--
~Vinod

#16 lore raw

Re: [PATCH 06/10] dmatest: run test via debugfs

Quoted 24 lines · Vinod Koul
Quoted 23 lines · Andy Shevchenko
Documentation/dmatest.txt new file +22 -0
@@ -0,0 +1,48 @@
+				DMA Test Guide
+				==============
+
+		Andy Shevchenko <[email protected]>
+
+This small document introduces how to test DMA drivers using dmatest module.
+
+	Part 1 - How to build the test module
+
+The menuconfig contains an option that could be found by following path:
+	Device Drivers -> DMA Engine support -> DMA Test client
+
+In the configuration file the option called CONFIG_DMATEST. The dmatest could
+be built as module or inside kernel. Let's consider those cases.
+
+	Part 2 - When dmatest is built as a module...
+
+After mounting debugfs and loading the module, the /sys/kernel/debug/dmatest
+folder with nodes will be created. They are the same as module parameters with
+addition of the 'run' node that controls run and stop phases of the test.
+
+Note that in this case test will not run on load automatically.
Quoted 8 lines

Documentation/dmatest.txt line 28

Quoted 6 lines
Documentation/dmatest.txt new file +6 -0
+
+Example of usage:
+	% echo dma0chan0 > /sys/kernel/debug/dmatest/channel
+	% echo 2000 > /sys/kernel/debug/dmatest/timeout
+	% echo 1 > /sys/kernel/debug/dmatest/iterations
+	% echo 1 > /sys/kernel/debug/dmatest/run

How do you terminate a test? Esp if you have started bunch of concurent tests and want to terminate one of them...

There is only one test in progress is possible.

To stop the test simple echo 0 > run (Probable that should be in documentation as well)

Quoted 48 lines
Quoted 48 lines
drivers/dma/dmatest.c +27 -2
 static struct dmatest_info test_info;
@@ -718,7 +729,7 @@ static bool filter(struct dma_chan *chan, void *param)
 		return true;
 }
 
-static int run_threaded_test(struct dmatest_info *info)
+static int __run_threaded_test(struct dmatest_info *info)
 {
 	dma_cap_mask_t mask;
 	struct dma_chan *chan;
@@ -744,7 +755,19 @@ static int run_threaded_test(struct dmatest_info *info)
 	return err;
 }
 
-static void stop_threaded_test(struct dmatest_info *info)
+#ifndef MODULE
+static int run_threaded_test(struct dmatest_info *info)
+{
+	int ret;
+
+	mutex_lock(&info->lock);
+	ret = __run_threaded_test(info);
+	mutex_unlock(&info->lock);
+	return ret;
+}
+#endif
+
+static void __stop_threaded_test(struct dmatest_info *info)
 {
 	struct dmatest_chan *dtc, *_dtc;
 	struct dma_chan *chan;
@@ -760,13 +783,234 @@ static void stop_threaded_test(struct dmatest_info *info)
 	info->nr_channels = 0;
 }
 
+static void stop_threaded_test(struct dmatest_info *info)
+{
+	mutex_lock(&info->lock);
+	__stop_threaded_test(info);
+	mutex_unlock(&info->lock);
+}
+
+static int __restart_threaded_test(struct dmatest_info *info, bool run)
+{
+	struct dmatest_params *params = &info->params;
+	int ret;
+
+	/* Stop any running test first */
Quoted 8 lines

drivers/dma/dmatest.c static void stop_threaded_test(struct dmatest_info *info) · line 805

Quoted 7 lines
drivers/dma/dmatest.c +7 -0
+	__stop_threaded_test(info);
+
+	if (run == false)
+		return 0;
+
+	/* Copy test parameters */
+	memcpy(params, &info->dbgfs_params, sizeof(*params));

what if the params are not yet filled by user... for module case?

Defaults are provided by constants in the top of file. They are copied when module_init is called.

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#17 lore raw

Re: [PATCH 06/10] dmatest: run test via debugfs

Quoted 34 lines · Andy Shevchenko
Quoted 24 lines · Vinod Koul
Quoted 23 lines · Andy Shevchenko
Documentation/dmatest.txt new file +22 -0
@@ -0,0 +1,48 @@
+				DMA Test Guide
+				==============
+
+		Andy Shevchenko <[email protected]>
+
+This small document introduces how to test DMA drivers using dmatest module.
+
+	Part 1 - How to build the test module
+
+The menuconfig contains an option that could be found by following path:
+	Device Drivers -> DMA Engine support -> DMA Test client
+
+In the configuration file the option called CONFIG_DMATEST. The dmatest could
+be built as module or inside kernel. Let's consider those cases.
+
+	Part 2 - When dmatest is built as a module...
+
+After mounting debugfs and loading the module, the /sys/kernel/debug/dmatest
+folder with nodes will be created. They are the same as module parameters with
+addition of the 'run' node that controls run and stop phases of the test.
+
+Note that in this case test will not run on load automatically.
Quoted 8 lines

Documentation/dmatest.txt line 28

Quoted 6 lines
Documentation/dmatest.txt new file +6 -0
+
+Example of usage:
+	% echo dma0chan0 > /sys/kernel/debug/dmatest/channel
+	% echo 2000 > /sys/kernel/debug/dmatest/timeout
+	% echo 1 > /sys/kernel/debug/dmatest/iterations
+	% echo 1 > /sys/kernel/debug/dmatest/run

How do you terminate a test? Esp if you have started bunch of concurent tests and want to terminate one of them...

Quoted 1 line

There is only one test in progress is possible.

Wasnt the idea to run concurrent tests, or I read wrongly...

--
~Vinod

A message that is not in the archive (sent off-list or not yet received): CAHp75Vc6KmPQYjSx5m+gEBCe4g2tRgEPKyg4hZx9ytk99pB7Qw@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#20 lore raw

Re: [PATCH 06/10] dmatest: run test via debugfs

Oh, missed Cc list in the middle. Return it back and thus leave a full message below.

Quoted 12 lines · Vinod Koul
Quoted 11 lines · Andy Shevchenko
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

How do you terminate a test? Esp if you have started bunch of concurent tests and want to terminate one of them...

There is only one test in progress is possible.

Wasnt the idea to run concurrent tests, or I read wrongly...

No, the idea was to run different tests sequentially from userspace withou loading/unloading
module each time and with storage support for the results that could be parsed automatically.

Quoted 8 lines
Quoted 1 line

Running concurrent tests is a good feature to be in TODO list.

I dont think anything in code prevents you from doing so. Only issue woud triggering bunch of tests together and killing them

What we could build on this is
- configuringa test but running later (so that we configure bunch of tests and then start them later, when ready)
- killing a specific task

As it's not our main goal, I prefer leave in TODO this for now. debugfs approach opens
a wide directions to get nice QA tool for DMA drivers.

Quoted 2 lines

Both of these would need some 'cookie' for tests or some otehr scheme to identify a test

True. It could be just a idr mapping like integer # <-> test case parameters. I think most important feature is to add the timestamps to the results.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#21 lore raw

PATCH 7/10 dmatest: return actual state in 'run' file

In reply to Andy Shevchenko

The following command should return actual state of the test.
% cat /sys/kernel/debug/dmatest/run

To wait for test done the user may perform a busy loop that checks the state.

	% while [ $(cat /sys/kernel/debug/dmatest/run) = "Y" ]
	> do
	> 	echo -n "."
	> 	sleep 1
	> done
	> echo
---
 Documentation/dmatest.txt | 12 ++++++++++++
 drivers/dma/dmatest.c     | 23 +++++++++++++++++++++--
 2 files changed, 33 insertions(+), 2 deletions(-)
Documentation/dmatest.txt +12 -0
index 9a90729..3e17b55 100644
@@ -36,6 +36,18 @@ in the original code.
 
 Note that running a new test will stop any in progress test.
 
+The following command should return actual state of the test.
+	% cat /sys/kernel/debug/dmatest/run
+
+To wait for test done the user may perform a busy loop that checks the state.
+
+	% while [ $(cat /sys/kernel/debug/dmatest/run) = "Y" ]
+	> do
+	> 	echo -n "."
+	> 	sleep 1
+	> done
+	> echo
+
 	Part 3 - When built-in in the kernel...
 
 The module parameters that is supplied to the kernel command line will be used
drivers/dma/dmatest.c +21 -2
index fc31542..d19234b 100644
@@ -93,6 +93,7 @@ struct dmatest_thread {
 	u8			**srcs;
 	u8			**dsts;
 	enum dma_transaction_type type;
+	bool			done;
 };
 
 struct dmatest_chan {
@@ -603,6 +604,8 @@ err_thread_type:
 	if (ret)
 		dmaengine_terminate_all(chan);
 
+	thread->done = true;
+
 	if (params->iterations > 0)
 		while (!kthread_should_stop()) {
 			DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait_dmatest_exit);
@@ -884,12 +887,28 @@ static ssize_t dtf_read_run(struct file *file, char __user *user_buf,
 {
 	struct dmatest_info *info = file->private_data;
 	char buf[3];
+	struct dmatest_chan *dtc;
+	bool alive = false;
 
 	mutex_lock(&info->lock);
-	if (info->nr_channels)
+	list_for_each_entry(dtc, &info->channels, node) {
+		struct dmatest_thread *thread;
+
+		list_for_each_entry(thread, &dtc->threads, node) {
+			if (!thread->done) {
+				alive = true;
+				break;
+			}
+		}
+	}
+
+	if (alive) {
 		buf[0] = 'Y';
-	else
+	} else {
+		__stop_threaded_test(info);
 		buf[0] = 'N';
+	}
+
 	mutex_unlock(&info->lock);
 	buf[1] = '\n';
 	buf[2] = 0x00;
Signature · 1 line
1.8.2.rc0.22.gb3600c3
#22 lore raw

PATCH 8/10 dmatest: define MAX_ERROR_COUNT constant

In reply to Andy Shevchenko

Its meaning is to limit amount of error messages to be printed out when buffer mismatch is occured.

---
 drivers/dma/dmatest.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/dma/dmatest.c +6 -3
index d19234b..4225a29 100644
@@ -66,6 +66,9 @@ module_param(timeout, uint, S_IRUGO);
 MODULE_PARM_DESC(timeout, "Transfer Timeout in msec (default: 3000), "
 		 "Pass -1 for infinite timeout");
 
+/* Maximum amount of mismatched bytes in buffer to print */
+#define MAX_ERROR_COUNT		32
+
 /*
  * Initialization patterns. All bytes in the source buffer has bit 7
  * set, all bytes in the destination buffer has bit 7 cleared.
@@ -249,7 +252,7 @@ static unsigned int dmatest_verify(u8 **bufs, unsigned int start,
 			actual = buf[i];
 			expected = pattern | (~counter & PATTERN_COUNT_MASK);
 			if (actual != expected) {
-				if (error_count < 32)
+				if (error_count < MAX_ERROR_COUNT)
 					dmatest_mismatch(actual, pattern, i,
 							 counter, is_srcbuf);
 				error_count++;
@@ -258,9 +261,9 @@ static unsigned int dmatest_verify(u8 **bufs, unsigned int start,
 		}
 	}
 
-	if (error_count > 32)
+	if (error_count > MAX_ERROR_COUNT)
 		pr_warning("%s: %u errors suppressed\n",
-			current->comm, error_count - 32);
+			current->comm, error_count - MAX_ERROR_COUNT);
 
 	return error_count;
 }
Signature · 1 line
1.8.2.rc0.22.gb3600c3
#23 lore raw

PATCH 9/10 dmatest: gather test results in the linked list

In reply to Andy Shevchenko

The patch provides a storage for the test results in the linked list. The gathered data could be used after test is done.

The new file 'results' represents gathered data of the in progress test. The messages collected are printed to the kernel log as well.

Example of output:

	% cat /sys/kernel/debug/dmatest/results
	dma0chan0-copy0: #1: No errors with src_off=0x7bf dst_off=0x8ad len=0x3fea (0)

The message format is unified across the different types of errors. A number in the parens represents additional information, e.g. error code, error counter, or status.

Note that the buffer comparison is done in the old way, i.e. data is not collected and just printed out.

---
 Documentation/dmatest.txt |  19 ++++
 drivers/dma/dmatest.c     | 234 ++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 223 insertions(+), 30 deletions(-)
Documentation/dmatest.txt +19 -0
index 3e17b55..d05782b 100644
@@ -58,3 +58,22 @@ the above section "Part 2 - When dmatest is built as a module..."
 In both cases the module parameters are used as initial values for the test case.
 You always could check them at run-time by running
 	% grep -H . /sys/module/dmatest/parameters/*
+
+	Part 4 - Gathering the test results
+
+The module provides a storage for the test results in the memory. The gathered
+data could be used after test is done.
+
+The special file 'results' in the debugfs represents gathered data of the in
+progress test. The messages collected are printed to the kernel log as well.
+
+Example of output:
+	% cat /sys/kernel/debug/dmatest/results
+	dma0chan0-copy0: #1: No errors with src_off=0x7bf dst_off=0x8ad len=0x3fea (0)
+
+The message format is unified across the different types of errors. A number in
+the parens represents additional information, e.g. error code, error counter,
+or status.
+
+Note that the buffer comparison is done in the old way, i.e. data is not
+collected and just printed out.
drivers/dma/dmatest.c +204 -30

335 lines not on this page · raw message

Signature · 1 line
1.8.2.rc0.22.gb3600c3
#24 lore raw

Re: [PATCH 09/10] dmatest: gather test results in the linked list

Quoted 10 lines · Andy Shevchenko

The patch provides a storage for the test results in the linked list. The gathered data could be used after test is done.

The new file 'results' represents gathered data of the in progress test. The messages collected are printed to the kernel log as well.

Example of output:
% cat /sys/kernel/debug/dmatest/results
dma0chan0-copy0: #1: No errors with src_off=0x7bf dst_off=0x8ad len=0x3fea (0)

Quoted 7 lines

The message format is unified across the different types of errors. A number in the parens represents additional information, e.g. error code, error counter, or status.

Note that the buffer comparison is done in the old way, i.e. data is not collected and just printed out.

I need to revert this to get my testing done as it just leaks memory for no real benefit that I can see. Outside of making the log messages have a uniform format I'm not seeing the case for this? I'll revert and add a pr_fmt to make dmatest messages readily parseable.

--
Dan

#25 lore raw

Re: [PATCH 09/10] dmatest: gather test results in the linked list

Quoted 16 lines · Dan Williams
Quoted 14 lines · Andy Shevchenko

The patch provides a storage for the test results in the linked list. The gathered data could be used after test is done.

The new file 'results' represents gathered data of the in progress test. The messages collected are printed to the kernel log as well.

Example of output:
% cat /sys/kernel/debug/dmatest/results
dma0chan0-copy0: #1: No errors with src_off=0x7bf dst_off=0x8ad len=0x3fea (0)

The message format is unified across the different types of errors. A number in the parens represents additional information, e.g. error code, error counter, or status.

Quoted 8 lines
Quoted 3 lines

Note that the buffer comparison is done in the old way, i.e. data is not collected and just printed out.

I need to revert this to get my testing done as it just leaks memory for no real benefit that I can see. Outside of making the log messages have a uniform format I'm not seeing the case for this? I'll revert and add a pr_fmt to make dmatest messages readily parseable.

The benefit of it is to access to the results asynchronously as many times as tester wants to.

Actually I wonder where you found memory leak. It keeps the result only for the last test run.

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#26 lore raw

Re: [PATCH 09/10] dmatest: gather test results in the linked list

[ excuse the resend, always forget that mobile-gmail sends html by default ]

Quoted 21 lines · Andy Shevchenko
Quoted 20 lines · Dan Williams
Quoted 17 lines · Andy Shevchenko

The patch provides a storage for the test results in the linked list. The gathered data could be used after test is done.

The new file 'results' represents gathered data of the in progress test. The messages collected are printed to the kernel log as well.

Example of output:
% cat /sys/kernel/debug/dmatest/results
dma0chan0-copy0: #1: No errors with src_off=0x7bf dst_off=0x8ad len=0x3fea (0)

The message format is unified across the different types of errors. A number in the parens represents additional information, e.g. error code, error counter, or status.

Note that the buffer comparison is done in the old way, i.e. data is not collected and just printed out.

Quoted 9 lines
Quoted 4 lines

I need to revert this to get my testing done as it just leaks memory for no real benefit that I can see. Outside of making the log messages have a uniform format I'm not seeing the case for this? I'll revert and add a pr_fmt to make dmatest messages readily parseable.

The benefit of it is to access to the results asynchronously as many times as tester wants to.

tail -f /var/log/messages is also asynchronous.

Quoted 2 lines

Actually I wonder where you found memory leak. It keeps the result only for the last test run.

In my test I hit the oom killer allocating the "OK" results.

#27 lore raw

Re: [PATCH 09/10] dmatest: gather test results in the linked list

Quoted 31 lines · Dan Williams

[ excuse the resend, always forget that mobile-gmail sends html by default ]

Quoted 27 lines · Andy Shevchenko
Quoted 24 lines · Dan Williams
Quoted 10 lines · Andy Shevchenko

The patch provides a storage for the test results in the linked list. The gathered data could be used after test is done.

The new file 'results' represents gathered data of the in progress test. The messages collected are printed to the kernel log as well.

Example of output:
% cat /sys/kernel/debug/dmatest/results
dma0chan0-copy0: #1: No errors with src_off=0x7bf dst_off=0x8ad len=0x3fea (0)

Quoted 7 lines

The message format is unified across the different types of errors. A number in the parens represents additional information, e.g. error code, error counter, or status.

Note that the buffer comparison is done in the old way, i.e. data is not collected and just printed out.

I need to revert this to get my testing done as it just leaks memory for no real benefit that I can see. Outside of making the log messages have a uniform format I'm not seeing the case for this? I'll revert and add a pr_fmt to make dmatest messages readily parseable.

Quoted 5 lines
Quoted 3 lines

The benefit of it is to access to the results asynchronously as many times as tester wants to.

tail -f /var/log/messages is also asynchronous.

It's harder to collect them by the script.

Quoted 5 lines
Quoted 3 lines

Actually I wonder where you found memory leak. It keeps the result only for the last test run.

In my test I hit the oom killer allocating the "OK" results.

Any description and steps you can share to reproduce your test?

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#28 lore raw

PATCH 10/10 dmatest: append verify result to results

In reply to Andy Shevchenko

Comparison between buffers is stored to the dedicated structure.

Note that the verify result is now accessible only via file 'results' in the debugfs.

---
 Documentation/dmatest.txt |   6 +-
 drivers/dma/dmatest.c     | 182 ++++++++++++++++++++++++++++++++--------------
 2 files changed, 132 insertions(+), 56 deletions(-)
Documentation/dmatest.txt +4 -2
index d05782b..279ac0a 100644
@@ -75,5 +75,7 @@ The message format is unified across the different types of errors. A number in
 the parens represents additional information, e.g. error code, error counter,
 or status.
 
-Note that the buffer comparison is done in the old way, i.e. data is not
-collected and just printed out.
+Comparison between buffers is stored to the dedicated structure.
+
+Note that the verify result is now accessible only via file 'results' in the
+debugfs.
drivers/dma/dmatest.c +128 -54

255 lines not on this page · raw message

Signature · 1 line
1.8.2.rc0.22.gb3600c3
#29 lore raw
In reply to Andy Shevchenko
Quoted 8 lines · Andy Shevchenko

The first approach to get dmatest module more flexible and easier to play with. The amount of patches could be reduced, but I would like to get a comments first on smaller pieces. The entire series creates dmatest.txt file in the Documentation folder. Similar description is scattered through the commit messages.

Module was tested on Intel Medfield and Lynxpoint systems with dw_dmac DMA controller embedded.

Overall the series looks good. I think it can applied in this form as well.

Quoted 21 lines

Andy Shevchenko (10):
dmatest: cancel thread immediately when asked for
dmatest: allocate memory for pq_coefs from heap
dmatest: create dmatest_info to keep test parameters
dmatest: move dmatest_channels and nr_channels to dmatest_info
dmatest: split test parameters to separate structure
dmatest: run test via debugfs
dmatest: return actual state in 'run' file
dmatest: define MAX_ERROR_COUNT constant
dmatest: gather test results in the linked list
dmatest: append verify result to results

 Documentation/dmatest.txt |  81 +++++
 drivers/dma/dmatest.c     | 887 +++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 832 insertions(+), 136 deletions(-)
 create mode 100644 Documentation/dmatest.txt
Signature · 1 line
1.8.2.rc0.22.gb3600c3
#30 lore raw
Quoted 10 lines · Vinod Koul
Quoted 8 lines · Andy Shevchenko

The first approach to get dmatest module more flexible and easier to play with. The amount of patches could be reduced, but I would like to get a comments first on smaller pieces. The entire series creates dmatest.txt file in the Documentation folder. Similar description is scattered through the commit messages.

Module was tested on Intel Medfield and Lynxpoint systems with dw_dmac DMA controller embedded.

Overall the series looks good. I think it can applied in this form as well.

Viresh, so, you are the only one who speaks about reducing amount of patches. Do you think is better to either reduce, or leave as is? In case of go with smaller amount, could you provide simple scheme which patch should be merged with which?

Quoted 17 lines
Quoted 17 lines

Andy Shevchenko (10):
dmatest: cancel thread immediately when asked for
dmatest: allocate memory for pq_coefs from heap
dmatest: create dmatest_info to keep test parameters
dmatest: move dmatest_channels and nr_channels to dmatest_info
dmatest: split test parameters to separate structure
dmatest: run test via debugfs
dmatest: return actual state in 'run' file
dmatest: define MAX_ERROR_COUNT constant
dmatest: gather test results in the linked list
dmatest: append verify result to results

 Documentation/dmatest.txt |  81 +++++
 drivers/dma/dmatest.c     | 887 +++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 832 insertions(+), 136 deletions(-)
 create mode 100644 Documentation/dmatest.txt
Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#31 lore raw
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Vinod Koul
Quoted 6 lines · Andy Shevchenko

The first approach to get dmatest module more flexible and easier to play with. The amount of patches could be reduced, but I would like to get a comments first on smaller pieces. The entire series creates dmatest.txt file in the Documentation folder. Similar description is scattered through the commit messages.

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

Module was tested on Intel Medfield and Lynxpoint systems with dw_dmac DMA controller embedded.

Overall the series looks good. I think it can applied in this form as well.

Viresh, so, you are the only one who speaks about reducing amount of patches. Do you think is better to either reduce, or leave as is? In case of go with smaller amount, could you provide simple scheme which patch should be merged with which?

Hi Andy,

I have been damn busy with Linaro Connect last week and couldn't review all patches too. Probably you can just go ahead with this patchset only as Vinod is okay with it.

--
viresh

#32 lore raw
Quoted 14 lines · Viresh Kumar
Quoted 12 lines · Andy Shevchenko
Quoted 10 lines · Vinod Koul
Quoted 8 lines · Andy Shevchenko

The first approach to get dmatest module more flexible and easier to play with. The amount of patches could be reduced, but I would like to get a comments first on smaller pieces. The entire series creates dmatest.txt file in the Documentation folder. Similar description is scattered through the commit messages.

Module was tested on Intel Medfield and Lynxpoint systems with dw_dmac DMA controller embedded.

Overall the series looks good. I think it can applied in this form as well.

Quoted 8 lines
Quoted 4 lines

Viresh, so, you are the only one who speaks about reducing amount of patches. Do you think is better to either reduce, or leave as is? In case of go with smaller amount, could you provide simple scheme which patch should be merged with which?

I have been damn busy with Linaro Connect last week and couldn't review all patches too. Probably you can just go ahead with this patchset only as Vinod is okay with it.

It seems Vinod is on vacation. So, take your time to finish review. I appreciate it.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#33 lore raw
In reply to Andy Shevchenko
Quoted 8 lines · Andy Shevchenko

The first approach to get dmatest module more flexible and easier to play with. The amount of patches could be reduced, but I would like to get a comments first on smaller pieces. The entire series creates dmatest.txt file in the Documentation folder. Similar description is scattered through the commit messages.

Module was tested on Intel Medfield and Lynxpoint systems with dw_dmac DMA controller embedded.

Applied thanks...

Quoted 21 lines

Andy Shevchenko (10):
dmatest: cancel thread immediately when asked for
dmatest: allocate memory for pq_coefs from heap
dmatest: create dmatest_info to keep test parameters
dmatest: move dmatest_channels and nr_channels to dmatest_info
dmatest: split test parameters to separate structure
dmatest: run test via debugfs
dmatest: return actual state in 'run' file
dmatest: define MAX_ERROR_COUNT constant
dmatest: gather test results in the linked list
dmatest: append verify result to results

 Documentation/dmatest.txt |  81 +++++
 drivers/dma/dmatest.c     | 887 +++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 832 insertions(+), 136 deletions(-)
 create mode 100644 Documentation/dmatest.txt
Signature · 1 line
1.8.2.rc0.22.gb3600c3