blob: c6e5d8331c66c3ae1dc42e38130a92484287b14e [file] [log] [blame]
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -07001/*
2 * DMA Engine test module
3 *
4 * Copyright (C) 2007 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/delay.h>
Alexey Dobriyanb7f080c2011-06-16 11:01:34 +000011#include <linux/dma-mapping.h>
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -070012#include <linux/dmaengine.h>
Guennadi Liakhovetski981ed702011-08-18 16:50:51 +020013#include <linux/freezer.h>
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -070014#include <linux/init.h>
15#include <linux/kthread.h>
16#include <linux/module.h>
17#include <linux/moduleparam.h>
18#include <linux/random.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090019#include <linux/slab.h>
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -070020#include <linux/wait.h>
21
22static unsigned int test_buf_size = 16384;
23module_param(test_buf_size, uint, S_IRUGO);
24MODULE_PARM_DESC(test_buf_size, "Size of the memcpy test buffer");
25
Kay Sievers06190d82008-11-11 13:12:33 -070026static char test_channel[20];
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -070027module_param_string(channel, test_channel, sizeof(test_channel), S_IRUGO);
28MODULE_PARM_DESC(channel, "Bus ID of the channel to test (default: any)");
29
Kay Sievers06190d82008-11-11 13:12:33 -070030static char test_device[20];
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -070031module_param_string(device, test_device, sizeof(test_device), S_IRUGO);
32MODULE_PARM_DESC(device, "Bus ID of the DMA Engine to test (default: any)");
33
34static unsigned int threads_per_chan = 1;
35module_param(threads_per_chan, uint, S_IRUGO);
36MODULE_PARM_DESC(threads_per_chan,
37 "Number of threads to start per channel (default: 1)");
38
39static unsigned int max_channels;
40module_param(max_channels, uint, S_IRUGO);
Dan Williams33df8ca2009-01-06 11:38:15 -070041MODULE_PARM_DESC(max_channels,
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -070042 "Maximum number of channels to use (default: all)");
43
Nicolas Ferre0a2ff57d2009-07-03 19:26:51 +020044static unsigned int iterations;
45module_param(iterations, uint, S_IRUGO);
46MODULE_PARM_DESC(iterations,
47 "Iterations before stopping test (default: infinite)");
48
Dan Williamsb54d5cb2009-03-25 09:13:25 -070049static unsigned int xor_sources = 3;
50module_param(xor_sources, uint, S_IRUGO);
51MODULE_PARM_DESC(xor_sources,
52 "Number of xor source buffers (default: 3)");
53
Dan Williams58691d62009-08-29 19:09:27 -070054static unsigned int pq_sources = 3;
55module_param(pq_sources, uint, S_IRUGO);
56MODULE_PARM_DESC(pq_sources,
57 "Number of p+q source buffers (default: 3)");
58
Viresh Kumard42efe62011-03-22 17:27:25 +053059static int timeout = 3000;
60module_param(timeout, uint, S_IRUGO);
Joe Perches85ee7a12011-04-23 20:38:19 -070061MODULE_PARM_DESC(timeout, "Transfer Timeout in msec (default: 3000), "
62 "Pass -1 for infinite timeout");
Viresh Kumard42efe62011-03-22 17:27:25 +053063
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -070064/*
65 * Initialization patterns. All bytes in the source buffer has bit 7
66 * set, all bytes in the destination buffer has bit 7 cleared.
67 *
68 * Bit 6 is set for all bytes which are to be copied by the DMA
69 * engine. Bit 5 is set for all bytes which are to be overwritten by
70 * the DMA engine.
71 *
72 * The remaining bits are the inverse of a counter which increments by
73 * one for each byte address.
74 */
75#define PATTERN_SRC 0x80
76#define PATTERN_DST 0x00
77#define PATTERN_COPY 0x40
78#define PATTERN_OVERWRITE 0x20
79#define PATTERN_COUNT_MASK 0x1f
80
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +020081struct dmatest_info;
82
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -070083struct dmatest_thread {
84 struct list_head node;
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +020085 struct dmatest_info *info;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -070086 struct task_struct *task;
87 struct dma_chan *chan;
Dan Williamsb54d5cb2009-03-25 09:13:25 -070088 u8 **srcs;
89 u8 **dsts;
90 enum dma_transaction_type type;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -070091};
92
93struct dmatest_chan {
94 struct list_head node;
95 struct dma_chan *chan;
96 struct list_head threads;
97};
98
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +020099/**
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200100 * struct dmatest_params - test parameters.
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200101 * @buf_size: size of the memcpy test buffer
102 * @channel: bus ID of the channel to test
103 * @device: bus ID of the DMA Engine to test
104 * @threads_per_chan: number of threads to start per channel
105 * @max_channels: maximum number of channels to use
106 * @iterations: iterations before stopping test
107 * @xor_sources: number of xor source buffers
108 * @pq_sources: number of p+q source buffers
109 * @timeout: transfer timeout in msec, -1 for infinite timeout
110 */
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200111struct dmatest_params {
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200112 unsigned int buf_size;
113 char channel[20];
114 char device[20];
115 unsigned int threads_per_chan;
116 unsigned int max_channels;
117 unsigned int iterations;
118 unsigned int xor_sources;
119 unsigned int pq_sources;
120 int timeout;
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200121};
122
123/**
124 * struct dmatest_info - test information.
125 * @params: test parameters
126 */
127struct dmatest_info {
128 /* Test parameters */
129 struct dmatest_params params;
Andy Shevchenko838cc702013-03-04 11:09:28 +0200130
131 /* Internal state */
132 struct list_head channels;
133 unsigned int nr_channels;
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200134};
135
136static struct dmatest_info test_info;
137
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200138static bool dmatest_match_channel(struct dmatest_params *params,
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200139 struct dma_chan *chan)
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700140{
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200141 if (params->channel[0] == '\0')
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700142 return true;
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200143 return strcmp(dma_chan_name(chan), params->channel) == 0;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700144}
145
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200146static bool dmatest_match_device(struct dmatest_params *params,
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200147 struct dma_device *device)
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700148{
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200149 if (params->device[0] == '\0')
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700150 return true;
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200151 return strcmp(dev_name(device->dev), params->device) == 0;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700152}
153
154static unsigned long dmatest_random(void)
155{
156 unsigned long buf;
157
158 get_random_bytes(&buf, sizeof(buf));
159 return buf;
160}
161
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200162static void dmatest_init_srcs(u8 **bufs, unsigned int start, unsigned int len,
163 unsigned int buf_size)
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700164{
165 unsigned int i;
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700166 u8 *buf;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700167
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700168 for (; (buf = *bufs); bufs++) {
169 for (i = 0; i < start; i++)
170 buf[i] = PATTERN_SRC | (~i & PATTERN_COUNT_MASK);
171 for ( ; i < start + len; i++)
172 buf[i] = PATTERN_SRC | PATTERN_COPY
Joe Perchesc0198942009-06-28 09:26:21 -0700173 | (~i & PATTERN_COUNT_MASK);
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200174 for ( ; i < buf_size; i++)
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700175 buf[i] = PATTERN_SRC | (~i & PATTERN_COUNT_MASK);
176 buf++;
177 }
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700178}
179
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200180static void dmatest_init_dsts(u8 **bufs, unsigned int start, unsigned int len,
181 unsigned int buf_size)
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700182{
183 unsigned int i;
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700184 u8 *buf;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700185
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700186 for (; (buf = *bufs); bufs++) {
187 for (i = 0; i < start; i++)
188 buf[i] = PATTERN_DST | (~i & PATTERN_COUNT_MASK);
189 for ( ; i < start + len; i++)
190 buf[i] = PATTERN_DST | PATTERN_OVERWRITE
191 | (~i & PATTERN_COUNT_MASK);
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200192 for ( ; i < buf_size; i++)
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700193 buf[i] = PATTERN_DST | (~i & PATTERN_COUNT_MASK);
194 }
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700195}
196
197static void dmatest_mismatch(u8 actual, u8 pattern, unsigned int index,
198 unsigned int counter, bool is_srcbuf)
199{
200 u8 diff = actual ^ pattern;
201 u8 expected = pattern | (~counter & PATTERN_COUNT_MASK);
202 const char *thread_name = current->comm;
203
204 if (is_srcbuf)
205 pr_warning("%s: srcbuf[0x%x] overwritten!"
206 " Expected %02x, got %02x\n",
207 thread_name, index, expected, actual);
208 else if ((pattern & PATTERN_COPY)
209 && (diff & (PATTERN_COPY | PATTERN_OVERWRITE)))
210 pr_warning("%s: dstbuf[0x%x] not copied!"
211 " Expected %02x, got %02x\n",
212 thread_name, index, expected, actual);
213 else if (diff & PATTERN_SRC)
214 pr_warning("%s: dstbuf[0x%x] was copied!"
215 " Expected %02x, got %02x\n",
216 thread_name, index, expected, actual);
217 else
218 pr_warning("%s: dstbuf[0x%x] mismatch!"
219 " Expected %02x, got %02x\n",
220 thread_name, index, expected, actual);
221}
222
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700223static unsigned int dmatest_verify(u8 **bufs, unsigned int start,
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700224 unsigned int end, unsigned int counter, u8 pattern,
225 bool is_srcbuf)
226{
227 unsigned int i;
228 unsigned int error_count = 0;
229 u8 actual;
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700230 u8 expected;
231 u8 *buf;
232 unsigned int counter_orig = counter;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700233
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700234 for (; (buf = *bufs); bufs++) {
235 counter = counter_orig;
236 for (i = start; i < end; i++) {
237 actual = buf[i];
238 expected = pattern | (~counter & PATTERN_COUNT_MASK);
239 if (actual != expected) {
240 if (error_count < 32)
241 dmatest_mismatch(actual, pattern, i,
242 counter, is_srcbuf);
243 error_count++;
244 }
245 counter++;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700246 }
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700247 }
248
249 if (error_count > 32)
250 pr_warning("%s: %u errors suppressed\n",
251 current->comm, error_count - 32);
252
253 return error_count;
254}
255
Tejun Heoadfa5432011-11-23 09:28:16 -0800256/* poor man's completion - we want to use wait_event_freezable() on it */
257struct dmatest_done {
258 bool done;
259 wait_queue_head_t *wait;
260};
261
262static void dmatest_callback(void *arg)
Dan Williamse44e0aa2009-03-25 09:13:25 -0700263{
Tejun Heoadfa5432011-11-23 09:28:16 -0800264 struct dmatest_done *done = arg;
265
266 done->done = true;
267 wake_up_all(done->wait);
Dan Williamse44e0aa2009-03-25 09:13:25 -0700268}
269
Andy Shevchenko632fd282012-12-17 15:59:52 -0800270static inline void unmap_src(struct device *dev, dma_addr_t *addr, size_t len,
271 unsigned int count)
272{
273 while (count--)
274 dma_unmap_single(dev, addr[count], len, DMA_TO_DEVICE);
275}
276
277static inline void unmap_dst(struct device *dev, dma_addr_t *addr, size_t len,
278 unsigned int count)
279{
280 while (count--)
281 dma_unmap_single(dev, addr[count], len, DMA_BIDIRECTIONAL);
282}
283
Akinobu Mita8be9e32b2012-10-28 00:49:32 +0900284static unsigned int min_odd(unsigned int x, unsigned int y)
285{
286 unsigned int val = min(x, y);
287
288 return val % 2 ? val : val - 1;
289}
290
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700291/*
292 * This function repeatedly tests DMA transfers of various lengths and
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700293 * offsets for a given operation type until it is told to exit by
294 * kthread_stop(). There may be multiple threads running this function
295 * in parallel for a single channel, and there may be multiple channels
296 * being tested in parallel.
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700297 *
298 * Before each test, the source and destination buffer is initialized
299 * with a known pattern. This pattern is different depending on
300 * whether it's in an area which is supposed to be copied or
301 * overwritten, and different in the source and destination buffers.
302 * So if the DMA engine doesn't copy exactly what we tell it to copy,
303 * we'll notice.
304 */
305static int dmatest_func(void *data)
306{
Tejun Heoadfa5432011-11-23 09:28:16 -0800307 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(done_wait);
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700308 struct dmatest_thread *thread = data;
Tejun Heoadfa5432011-11-23 09:28:16 -0800309 struct dmatest_done done = { .wait = &done_wait };
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200310 struct dmatest_info *info;
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200311 struct dmatest_params *params;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700312 struct dma_chan *chan;
Akinobu Mita8be9e32b2012-10-28 00:49:32 +0900313 struct dma_device *dev;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700314 const char *thread_name;
315 unsigned int src_off, dst_off, len;
316 unsigned int error_count;
317 unsigned int failed_tests = 0;
318 unsigned int total_tests = 0;
319 dma_cookie_t cookie;
320 enum dma_status status;
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700321 enum dma_ctrl_flags flags;
Andy Shevchenko945b5af2013-03-04 11:09:26 +0200322 u8 *pq_coefs = NULL;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700323 int ret;
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700324 int src_cnt;
325 int dst_cnt;
326 int i;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700327
328 thread_name = current->comm;
Tejun Heoadfa5432011-11-23 09:28:16 -0800329 set_freezable();
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700330
331 ret = -ENOMEM;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700332
333 smp_rmb();
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200334 info = thread->info;
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200335 params = &info->params;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700336 chan = thread->chan;
Akinobu Mita8be9e32b2012-10-28 00:49:32 +0900337 dev = chan->device;
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700338 if (thread->type == DMA_MEMCPY)
339 src_cnt = dst_cnt = 1;
340 else if (thread->type == DMA_XOR) {
Akinobu Mita8be9e32b2012-10-28 00:49:32 +0900341 /* force odd to ensure dst = src */
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200342 src_cnt = min_odd(params->xor_sources | 1, dev->max_xor);
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700343 dst_cnt = 1;
Dan Williams58691d62009-08-29 19:09:27 -0700344 } else if (thread->type == DMA_PQ) {
Akinobu Mita8be9e32b2012-10-28 00:49:32 +0900345 /* force odd to ensure dst = src */
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200346 src_cnt = min_odd(params->pq_sources | 1, dma_maxpq(dev, 0));
Dan Williams58691d62009-08-29 19:09:27 -0700347 dst_cnt = 2;
Andy Shevchenko945b5af2013-03-04 11:09:26 +0200348
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200349 pq_coefs = kmalloc(params->pq_sources+1, GFP_KERNEL);
Andy Shevchenko945b5af2013-03-04 11:09:26 +0200350 if (!pq_coefs)
351 goto err_thread_type;
352
Anatolij Gustschin94de6482010-02-15 22:35:23 +0100353 for (i = 0; i < src_cnt; i++)
Dan Williams58691d62009-08-29 19:09:27 -0700354 pq_coefs[i] = 1;
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700355 } else
Andy Shevchenko945b5af2013-03-04 11:09:26 +0200356 goto err_thread_type;
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700357
358 thread->srcs = kcalloc(src_cnt+1, sizeof(u8 *), GFP_KERNEL);
359 if (!thread->srcs)
360 goto err_srcs;
361 for (i = 0; i < src_cnt; i++) {
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200362 thread->srcs[i] = kmalloc(params->buf_size, GFP_KERNEL);
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700363 if (!thread->srcs[i])
364 goto err_srcbuf;
365 }
366 thread->srcs[i] = NULL;
367
368 thread->dsts = kcalloc(dst_cnt+1, sizeof(u8 *), GFP_KERNEL);
369 if (!thread->dsts)
370 goto err_dsts;
371 for (i = 0; i < dst_cnt; i++) {
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200372 thread->dsts[i] = kmalloc(params->buf_size, GFP_KERNEL);
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700373 if (!thread->dsts[i])
374 goto err_dstbuf;
375 }
376 thread->dsts[i] = NULL;
377
Dan Williamse44e0aa2009-03-25 09:13:25 -0700378 set_user_nice(current, 10);
379
Ira Snyderb203bd32011-03-03 07:54:53 +0000380 /*
381 * src buffers are freed by the DMAEngine code with dma_unmap_single()
382 * dst buffers are freed by ourselves below
383 */
384 flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT
385 | DMA_COMPL_SKIP_DEST_UNMAP | DMA_COMPL_SRC_UNMAP_SINGLE;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700386
Nicolas Ferre0a2ff57d2009-07-03 19:26:51 +0200387 while (!kthread_should_stop()
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200388 && !(params->iterations && total_tests >= params->iterations)) {
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700389 struct dma_async_tx_descriptor *tx = NULL;
390 dma_addr_t dma_srcs[src_cnt];
391 dma_addr_t dma_dsts[dst_cnt];
Dan Williams83544ae2009-09-08 17:42:53 -0700392 u8 align = 0;
Atsushi Nemotod86be862009-01-13 09:22:20 -0700393
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700394 total_tests++;
395
Dan Williams83544ae2009-09-08 17:42:53 -0700396 /* honor alignment restrictions */
397 if (thread->type == DMA_MEMCPY)
398 align = dev->copy_align;
399 else if (thread->type == DMA_XOR)
400 align = dev->xor_align;
401 else if (thread->type == DMA_PQ)
402 align = dev->pq_align;
403
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200404 if (1 << align > params->buf_size) {
Guennadi Liakhovetskicfe4f272009-12-04 19:44:48 +0100405 pr_err("%u-byte buffer too small for %d-byte alignment\n",
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200406 params->buf_size, 1 << align);
Guennadi Liakhovetskicfe4f272009-12-04 19:44:48 +0100407 break;
408 }
409
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200410 len = dmatest_random() % params->buf_size + 1;
Dan Williams83544ae2009-09-08 17:42:53 -0700411 len = (len >> align) << align;
Guennadi Liakhovetskicfe4f272009-12-04 19:44:48 +0100412 if (!len)
413 len = 1 << align;
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200414 src_off = dmatest_random() % (params->buf_size - len + 1);
415 dst_off = dmatest_random() % (params->buf_size - len + 1);
Guennadi Liakhovetskicfe4f272009-12-04 19:44:48 +0100416
Dan Williams83544ae2009-09-08 17:42:53 -0700417 src_off = (src_off >> align) << align;
418 dst_off = (dst_off >> align) << align;
419
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200420 dmatest_init_srcs(thread->srcs, src_off, len, params->buf_size);
421 dmatest_init_dsts(thread->dsts, dst_off, len, params->buf_size);
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700422
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700423 for (i = 0; i < src_cnt; i++) {
424 u8 *buf = thread->srcs[i] + src_off;
425
426 dma_srcs[i] = dma_map_single(dev->dev, buf, len,
427 DMA_TO_DEVICE);
Andy Shevchenkoafde3be2012-12-17 15:59:53 -0800428 ret = dma_mapping_error(dev->dev, dma_srcs[i]);
429 if (ret) {
430 unmap_src(dev->dev, dma_srcs, len, i);
431 pr_warn("%s: #%u: mapping error %d with "
432 "src_off=0x%x len=0x%x\n",
433 thread_name, total_tests - 1, ret,
434 src_off, len);
435 failed_tests++;
436 continue;
437 }
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700438 }
Atsushi Nemotod86be862009-01-13 09:22:20 -0700439 /* map with DMA_BIDIRECTIONAL to force writeback/invalidate */
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700440 for (i = 0; i < dst_cnt; i++) {
441 dma_dsts[i] = dma_map_single(dev->dev, thread->dsts[i],
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200442 params->buf_size,
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700443 DMA_BIDIRECTIONAL);
Andy Shevchenkoafde3be2012-12-17 15:59:53 -0800444 ret = dma_mapping_error(dev->dev, dma_dsts[i]);
445 if (ret) {
446 unmap_src(dev->dev, dma_srcs, len, src_cnt);
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200447 unmap_dst(dev->dev, dma_dsts, params->buf_size,
448 i);
Andy Shevchenkoafde3be2012-12-17 15:59:53 -0800449 pr_warn("%s: #%u: mapping error %d with "
450 "dst_off=0x%x len=0x%x\n",
451 thread_name, total_tests - 1, ret,
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200452 dst_off, params->buf_size);
Andy Shevchenkoafde3be2012-12-17 15:59:53 -0800453 failed_tests++;
454 continue;
455 }
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700456 }
Atsushi Nemotod86be862009-01-13 09:22:20 -0700457
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700458 if (thread->type == DMA_MEMCPY)
459 tx = dev->device_prep_dma_memcpy(chan,
460 dma_dsts[0] + dst_off,
461 dma_srcs[0], len,
462 flags);
463 else if (thread->type == DMA_XOR)
464 tx = dev->device_prep_dma_xor(chan,
465 dma_dsts[0] + dst_off,
Dan Williams67b91242010-02-28 22:20:18 -0700466 dma_srcs, src_cnt,
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700467 len, flags);
Dan Williams58691d62009-08-29 19:09:27 -0700468 else if (thread->type == DMA_PQ) {
469 dma_addr_t dma_pq[dst_cnt];
470
471 for (i = 0; i < dst_cnt; i++)
472 dma_pq[i] = dma_dsts[i] + dst_off;
473 tx = dev->device_prep_dma_pq(chan, dma_pq, dma_srcs,
Anatolij Gustschin94de6482010-02-15 22:35:23 +0100474 src_cnt, pq_coefs,
Dan Williams58691d62009-08-29 19:09:27 -0700475 len, flags);
476 }
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700477
Atsushi Nemotod86be862009-01-13 09:22:20 -0700478 if (!tx) {
Andy Shevchenko632fd282012-12-17 15:59:52 -0800479 unmap_src(dev->dev, dma_srcs, len, src_cnt);
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200480 unmap_dst(dev->dev, dma_dsts, params->buf_size,
481 dst_cnt);
Atsushi Nemotod86be862009-01-13 09:22:20 -0700482 pr_warning("%s: #%u: prep error with src_off=0x%x "
483 "dst_off=0x%x len=0x%x\n",
484 thread_name, total_tests - 1,
485 src_off, dst_off, len);
486 msleep(100);
487 failed_tests++;
488 continue;
489 }
Dan Williamse44e0aa2009-03-25 09:13:25 -0700490
Tejun Heoadfa5432011-11-23 09:28:16 -0800491 done.done = false;
Dan Williamse44e0aa2009-03-25 09:13:25 -0700492 tx->callback = dmatest_callback;
Tejun Heoadfa5432011-11-23 09:28:16 -0800493 tx->callback_param = &done;
Atsushi Nemotod86be862009-01-13 09:22:20 -0700494 cookie = tx->tx_submit(tx);
495
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700496 if (dma_submit_error(cookie)) {
497 pr_warning("%s: #%u: submit error %d with src_off=0x%x "
498 "dst_off=0x%x len=0x%x\n",
499 thread_name, total_tests - 1, cookie,
500 src_off, dst_off, len);
501 msleep(100);
502 failed_tests++;
503 continue;
504 }
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700505 dma_async_issue_pending(chan);
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700506
Andy Shevchenko77101ce2013-03-04 11:09:25 +0200507 wait_event_freezable_timeout(done_wait,
508 done.done || kthread_should_stop(),
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200509 msecs_to_jiffies(params->timeout));
Guennadi Liakhovetski981ed702011-08-18 16:50:51 +0200510
Dan Williamse44e0aa2009-03-25 09:13:25 -0700511 status = dma_async_is_tx_complete(chan, cookie, NULL, NULL);
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700512
Tejun Heoadfa5432011-11-23 09:28:16 -0800513 if (!done.done) {
514 /*
515 * We're leaving the timed out dma operation with
516 * dangling pointer to done_wait. To make this
517 * correct, we'll need to allocate wait_done for
518 * each test iteration and perform "who's gonna
519 * free it this time?" dancing. For now, just
520 * leave it dangling.
521 */
Dan Williamse44e0aa2009-03-25 09:13:25 -0700522 pr_warning("%s: #%u: test timed out\n",
523 thread_name, total_tests - 1);
524 failed_tests++;
525 continue;
526 } else if (status != DMA_SUCCESS) {
527 pr_warning("%s: #%u: got completion callback,"
528 " but status is \'%s\'\n",
529 thread_name, total_tests - 1,
530 status == DMA_ERROR ? "error" : "in progress");
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700531 failed_tests++;
532 continue;
533 }
Dan Williamse44e0aa2009-03-25 09:13:25 -0700534
Atsushi Nemotod86be862009-01-13 09:22:20 -0700535 /* Unmap by myself (see DMA_COMPL_SKIP_DEST_UNMAP above) */
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200536 unmap_dst(dev->dev, dma_dsts, params->buf_size, dst_cnt);
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700537
538 error_count = 0;
539
540 pr_debug("%s: verifying source buffer...\n", thread_name);
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700541 error_count += dmatest_verify(thread->srcs, 0, src_off,
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700542 0, PATTERN_SRC, true);
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700543 error_count += dmatest_verify(thread->srcs, src_off,
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700544 src_off + len, src_off,
545 PATTERN_SRC | PATTERN_COPY, true);
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700546 error_count += dmatest_verify(thread->srcs, src_off + len,
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200547 params->buf_size, src_off + len,
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700548 PATTERN_SRC, true);
549
550 pr_debug("%s: verifying dest buffer...\n",
551 thread->task->comm);
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700552 error_count += dmatest_verify(thread->dsts, 0, dst_off,
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700553 0, PATTERN_DST, false);
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700554 error_count += dmatest_verify(thread->dsts, dst_off,
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700555 dst_off + len, src_off,
556 PATTERN_SRC | PATTERN_COPY, false);
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700557 error_count += dmatest_verify(thread->dsts, dst_off + len,
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200558 params->buf_size, dst_off + len,
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700559 PATTERN_DST, false);
560
561 if (error_count) {
562 pr_warning("%s: #%u: %u errors with "
563 "src_off=0x%x dst_off=0x%x len=0x%x\n",
564 thread_name, total_tests - 1, error_count,
565 src_off, dst_off, len);
566 failed_tests++;
567 } else {
568 pr_debug("%s: #%u: No errors with "
569 "src_off=0x%x dst_off=0x%x len=0x%x\n",
570 thread_name, total_tests - 1,
571 src_off, dst_off, len);
572 }
573 }
574
575 ret = 0;
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700576 for (i = 0; thread->dsts[i]; i++)
577 kfree(thread->dsts[i]);
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700578err_dstbuf:
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700579 kfree(thread->dsts);
580err_dsts:
581 for (i = 0; thread->srcs[i]; i++)
582 kfree(thread->srcs[i]);
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700583err_srcbuf:
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700584 kfree(thread->srcs);
585err_srcs:
Andy Shevchenko945b5af2013-03-04 11:09:26 +0200586 kfree(pq_coefs);
587err_thread_type:
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700588 pr_notice("%s: terminating after %u tests, %u failures (status %d)\n",
589 thread_name, total_tests, failed_tests, ret);
Nicolas Ferre0a2ff57d2009-07-03 19:26:51 +0200590
Viresh Kumar9704efa2011-07-29 16:21:57 +0530591 /* terminate all transfers on specified channels */
Shiraz Hashim5e034f72012-11-09 15:26:29 +0000592 if (ret)
593 dmaengine_terminate_all(chan);
594
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200595 if (params->iterations > 0)
Nicolas Ferre0a2ff57d2009-07-03 19:26:51 +0200596 while (!kthread_should_stop()) {
Yong Zhangb953df72010-02-05 21:52:37 +0800597 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait_dmatest_exit);
Nicolas Ferre0a2ff57d2009-07-03 19:26:51 +0200598 interruptible_sleep_on(&wait_dmatest_exit);
599 }
600
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700601 return ret;
602}
603
604static void dmatest_cleanup_channel(struct dmatest_chan *dtc)
605{
606 struct dmatest_thread *thread;
607 struct dmatest_thread *_thread;
608 int ret;
609
610 list_for_each_entry_safe(thread, _thread, &dtc->threads, node) {
611 ret = kthread_stop(thread->task);
612 pr_debug("dmatest: thread %s exited with status %d\n",
613 thread->task->comm, ret);
614 list_del(&thread->node);
615 kfree(thread);
616 }
Viresh Kumar9704efa2011-07-29 16:21:57 +0530617
618 /* terminate all transfers on specified channels */
Jon Mason944ea4d2012-11-11 23:03:20 +0000619 dmaengine_terminate_all(dtc->chan);
Viresh Kumar9704efa2011-07-29 16:21:57 +0530620
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700621 kfree(dtc);
622}
623
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200624static int dmatest_add_threads(struct dmatest_info *info,
625 struct dmatest_chan *dtc, enum dma_transaction_type type)
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700626{
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200627 struct dmatest_params *params = &info->params;
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700628 struct dmatest_thread *thread;
629 struct dma_chan *chan = dtc->chan;
630 char *op;
631 unsigned int i;
632
633 if (type == DMA_MEMCPY)
634 op = "copy";
635 else if (type == DMA_XOR)
636 op = "xor";
Dan Williams58691d62009-08-29 19:09:27 -0700637 else if (type == DMA_PQ)
638 op = "pq";
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700639 else
640 return -EINVAL;
641
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200642 for (i = 0; i < params->threads_per_chan; i++) {
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700643 thread = kzalloc(sizeof(struct dmatest_thread), GFP_KERNEL);
644 if (!thread) {
645 pr_warning("dmatest: No memory for %s-%s%u\n",
646 dma_chan_name(chan), op, i);
647
648 break;
649 }
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200650 thread->info = info;
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700651 thread->chan = dtc->chan;
652 thread->type = type;
653 smp_wmb();
654 thread->task = kthread_run(dmatest_func, thread, "%s-%s%u",
655 dma_chan_name(chan), op, i);
656 if (IS_ERR(thread->task)) {
657 pr_warning("dmatest: Failed to run thread %s-%s%u\n",
658 dma_chan_name(chan), op, i);
659 kfree(thread);
660 break;
661 }
662
663 /* srcbuf and dstbuf are allocated by the thread itself */
664
665 list_add_tail(&thread->node, &dtc->threads);
666 }
667
668 return i;
669}
670
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200671static int dmatest_add_channel(struct dmatest_info *info,
672 struct dma_chan *chan)
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700673{
674 struct dmatest_chan *dtc;
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700675 struct dma_device *dma_dev = chan->device;
676 unsigned int thread_count = 0;
Kulikov Vasiliyb9033e62010-07-17 19:19:48 +0400677 int cnt;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700678
Andrew Morton6fdb8bd2008-09-19 04:16:23 -0700679 dtc = kmalloc(sizeof(struct dmatest_chan), GFP_KERNEL);
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700680 if (!dtc) {
Dan Williams41d5e592009-01-06 11:38:21 -0700681 pr_warning("dmatest: No memory for %s\n", dma_chan_name(chan));
Dan Williams33df8ca2009-01-06 11:38:15 -0700682 return -ENOMEM;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700683 }
684
685 dtc->chan = chan;
686 INIT_LIST_HEAD(&dtc->threads);
687
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700688 if (dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask)) {
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200689 cnt = dmatest_add_threads(info, dtc, DMA_MEMCPY);
Nicolas Ferref1aef8b2009-07-06 18:19:44 +0200690 thread_count += cnt > 0 ? cnt : 0;
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700691 }
692 if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) {
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200693 cnt = dmatest_add_threads(info, dtc, DMA_XOR);
Nicolas Ferref1aef8b2009-07-06 18:19:44 +0200694 thread_count += cnt > 0 ? cnt : 0;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700695 }
Dan Williams58691d62009-08-29 19:09:27 -0700696 if (dma_has_cap(DMA_PQ, dma_dev->cap_mask)) {
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200697 cnt = dmatest_add_threads(info, dtc, DMA_PQ);
Dr. David Alan Gilbertd07a74a2011-08-25 16:13:55 -0700698 thread_count += cnt > 0 ? cnt : 0;
Dan Williams58691d62009-08-29 19:09:27 -0700699 }
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700700
Dan Williamsb54d5cb2009-03-25 09:13:25 -0700701 pr_info("dmatest: Started %u threads using %s\n",
702 thread_count, dma_chan_name(chan));
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700703
Andy Shevchenko838cc702013-03-04 11:09:28 +0200704 list_add_tail(&dtc->node, &info->channels);
705 info->nr_channels++;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700706
Dan Williams33df8ca2009-01-06 11:38:15 -0700707 return 0;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700708}
709
Dan Williams7dd60252009-01-06 11:38:19 -0700710static bool filter(struct dma_chan *chan, void *param)
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700711{
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200712 struct dmatest_params *params = param;
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200713
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200714 if (!dmatest_match_channel(params, chan) ||
715 !dmatest_match_device(params, chan->device))
Dan Williams7dd60252009-01-06 11:38:19 -0700716 return false;
Dan Williams33df8ca2009-01-06 11:38:15 -0700717 else
Dan Williams7dd60252009-01-06 11:38:19 -0700718 return true;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700719}
720
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200721static int run_threaded_test(struct dmatest_info *info)
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700722{
Dan Williams33df8ca2009-01-06 11:38:15 -0700723 dma_cap_mask_t mask;
724 struct dma_chan *chan;
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200725 struct dmatest_params *params = &info->params;
Dan Williams33df8ca2009-01-06 11:38:15 -0700726 int err = 0;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700727
Dan Williams33df8ca2009-01-06 11:38:15 -0700728 dma_cap_zero(mask);
729 dma_cap_set(DMA_MEMCPY, mask);
730 for (;;) {
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200731 chan = dma_request_channel(mask, filter, params);
Dan Williams33df8ca2009-01-06 11:38:15 -0700732 if (chan) {
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200733 err = dmatest_add_channel(info, chan);
Dan Williamsc56c81a2009-04-08 15:08:23 -0700734 if (err) {
Dan Williams33df8ca2009-01-06 11:38:15 -0700735 dma_release_channel(chan);
736 break; /* add_channel failed, punt */
737 }
738 } else
739 break; /* no more channels available */
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200740 if (params->max_channels &&
741 info->nr_channels >= params->max_channels)
Dan Williams33df8ca2009-01-06 11:38:15 -0700742 break; /* we have all we need */
743 }
Dan Williams33df8ca2009-01-06 11:38:15 -0700744 return err;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700745}
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700746
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200747static void stop_threaded_test(struct dmatest_info *info)
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700748{
Dan Williams33df8ca2009-01-06 11:38:15 -0700749 struct dmatest_chan *dtc, *_dtc;
Dan Williams7cbd4872009-03-04 16:06:03 -0700750 struct dma_chan *chan;
Dan Williams33df8ca2009-01-06 11:38:15 -0700751
Andy Shevchenko838cc702013-03-04 11:09:28 +0200752 list_for_each_entry_safe(dtc, _dtc, &info->channels, node) {
Dan Williams33df8ca2009-01-06 11:38:15 -0700753 list_del(&dtc->node);
Dan Williams7cbd4872009-03-04 16:06:03 -0700754 chan = dtc->chan;
Dan Williams33df8ca2009-01-06 11:38:15 -0700755 dmatest_cleanup_channel(dtc);
Andy Shevchenko838cc702013-03-04 11:09:28 +0200756 pr_debug("dmatest: dropped channel %s\n", dma_chan_name(chan));
Dan Williams7cbd4872009-03-04 16:06:03 -0700757 dma_release_channel(chan);
Dan Williams33df8ca2009-01-06 11:38:15 -0700758 }
Andy Shevchenko838cc702013-03-04 11:09:28 +0200759
760 info->nr_channels = 0;
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700761}
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200762
763static int __init dmatest_init(void)
764{
765 struct dmatest_info *info = &test_info;
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200766 struct dmatest_params *params = &info->params;
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200767
768 memset(info, 0, sizeof(*info));
769
Andy Shevchenko838cc702013-03-04 11:09:28 +0200770 INIT_LIST_HEAD(&info->channels);
771
772 /* Set default parameters */
Andy Shevchenko15b8a8e2013-03-04 11:09:29 +0200773 params->buf_size = test_buf_size;
774 strlcpy(params->channel, test_channel, sizeof(params->channel));
775 strlcpy(params->device, test_device, sizeof(params->device));
776 params->threads_per_chan = threads_per_chan;
777 params->max_channels = max_channels;
778 params->iterations = iterations;
779 params->xor_sources = xor_sources;
780 params->pq_sources = pq_sources;
781 params->timeout = timeout;
Andy Shevchenkoe03e93a2013-03-04 11:09:27 +0200782
783 return run_threaded_test(info);
784}
785/* when compiled-in wait for drivers to load first */
786late_initcall(dmatest_init);
787
788static void __exit dmatest_exit(void)
789{
790 struct dmatest_info *info = &test_info;
791
792 stop_threaded_test(info);
793}
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700794module_exit(dmatest_exit);
795
Jean Delvaree05503e2011-05-18 16:49:24 +0200796MODULE_AUTHOR("Haavard Skinnemoen (Atmel)");
Haavard Skinnemoen4a776f02008-07-08 11:58:45 -0700797MODULE_LICENSE("GPL v2");