dmatest: gather test results in the linked list
[deliverable/linux.git] / drivers / dma / dmatest.c
CommitLineData
4a776f0a
HS
1/*
2 * DMA Engine test module
3 *
4 * Copyright (C) 2007 Atmel Corporation
851b7e16 5 * Copyright (C) 2013 Intel Corporation
4a776f0a
HS
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/delay.h>
b7f080cf 12#include <linux/dma-mapping.h>
4a776f0a 13#include <linux/dmaengine.h>
981ed70d 14#include <linux/freezer.h>
4a776f0a
HS
15#include <linux/init.h>
16#include <linux/kthread.h>
17#include <linux/module.h>
18#include <linux/moduleparam.h>
19#include <linux/random.h>
5a0e3ad6 20#include <linux/slab.h>
4a776f0a 21#include <linux/wait.h>
851b7e16
AS
22#include <linux/ctype.h>
23#include <linux/debugfs.h>
24#include <linux/uaccess.h>
25#include <linux/seq_file.h>
4a776f0a
HS
26
27static unsigned int test_buf_size = 16384;
28module_param(test_buf_size, uint, S_IRUGO);
29MODULE_PARM_DESC(test_buf_size, "Size of the memcpy test buffer");
30
06190d84 31static char test_channel[20];
4a776f0a
HS
32module_param_string(channel, test_channel, sizeof(test_channel), S_IRUGO);
33MODULE_PARM_DESC(channel, "Bus ID of the channel to test (default: any)");
34
06190d84 35static char test_device[20];
4a776f0a
HS
36module_param_string(device, test_device, sizeof(test_device), S_IRUGO);
37MODULE_PARM_DESC(device, "Bus ID of the DMA Engine to test (default: any)");
38
39static unsigned int threads_per_chan = 1;
40module_param(threads_per_chan, uint, S_IRUGO);
41MODULE_PARM_DESC(threads_per_chan,
42 "Number of threads to start per channel (default: 1)");
43
44static unsigned int max_channels;
45module_param(max_channels, uint, S_IRUGO);
33df8ca0 46MODULE_PARM_DESC(max_channels,
4a776f0a
HS
47 "Maximum number of channels to use (default: all)");
48
0a2ff57d
NF
49static unsigned int iterations;
50module_param(iterations, uint, S_IRUGO);
51MODULE_PARM_DESC(iterations,
52 "Iterations before stopping test (default: infinite)");
53
b54d5cb9
DW
54static unsigned int xor_sources = 3;
55module_param(xor_sources, uint, S_IRUGO);
56MODULE_PARM_DESC(xor_sources,
57 "Number of xor source buffers (default: 3)");
58
58691d64
DW
59static unsigned int pq_sources = 3;
60module_param(pq_sources, uint, S_IRUGO);
61MODULE_PARM_DESC(pq_sources,
62 "Number of p+q source buffers (default: 3)");
63
d42efe6b
VK
64static int timeout = 3000;
65module_param(timeout, uint, S_IRUGO);
85ee7a1d
JP
66MODULE_PARM_DESC(timeout, "Transfer Timeout in msec (default: 3000), "
67 "Pass -1 for infinite timeout");
d42efe6b 68
74b5c07a
AS
69/* Maximum amount of mismatched bytes in buffer to print */
70#define MAX_ERROR_COUNT 32
71
4a776f0a
HS
72/*
73 * Initialization patterns. All bytes in the source buffer has bit 7
74 * set, all bytes in the destination buffer has bit 7 cleared.
75 *
76 * Bit 6 is set for all bytes which are to be copied by the DMA
77 * engine. Bit 5 is set for all bytes which are to be overwritten by
78 * the DMA engine.
79 *
80 * The remaining bits are the inverse of a counter which increments by
81 * one for each byte address.
82 */
83#define PATTERN_SRC 0x80
84#define PATTERN_DST 0x00
85#define PATTERN_COPY 0x40
86#define PATTERN_OVERWRITE 0x20
87#define PATTERN_COUNT_MASK 0x1f
88
95019c8c
AS
89enum dmatest_error_type {
90 DMATEST_ET_OK,
91 DMATEST_ET_MAP_SRC,
92 DMATEST_ET_MAP_DST,
93 DMATEST_ET_PREP,
94 DMATEST_ET_SUBMIT,
95 DMATEST_ET_TIMEOUT,
96 DMATEST_ET_DMA_ERROR,
97 DMATEST_ET_DMA_IN_PROGRESS,
98 DMATEST_ET_VERIFY,
99};
100
101struct dmatest_thread_result {
102 struct list_head node;
103 unsigned int n;
104 unsigned int src_off;
105 unsigned int dst_off;
106 unsigned int len;
107 enum dmatest_error_type type;
108 union {
109 unsigned long data;
110 dma_cookie_t cookie;
111 enum dma_status status;
112 int error;
113 };
114};
115
116struct dmatest_result {
117 struct list_head node;
118 char *name;
119 struct list_head results;
120};
121
e03e93a9
AS
122struct dmatest_info;
123
4a776f0a
HS
124struct dmatest_thread {
125 struct list_head node;
e03e93a9 126 struct dmatest_info *info;
4a776f0a
HS
127 struct task_struct *task;
128 struct dma_chan *chan;
b54d5cb9
DW
129 u8 **srcs;
130 u8 **dsts;
131 enum dma_transaction_type type;
3e5ccd86 132 bool done;
4a776f0a
HS
133};
134
135struct dmatest_chan {
136 struct list_head node;
137 struct dma_chan *chan;
138 struct list_head threads;
139};
140
e03e93a9 141/**
15b8a8ea 142 * struct dmatest_params - test parameters.
e03e93a9
AS
143 * @buf_size: size of the memcpy test buffer
144 * @channel: bus ID of the channel to test
145 * @device: bus ID of the DMA Engine to test
146 * @threads_per_chan: number of threads to start per channel
147 * @max_channels: maximum number of channels to use
148 * @iterations: iterations before stopping test
149 * @xor_sources: number of xor source buffers
150 * @pq_sources: number of p+q source buffers
151 * @timeout: transfer timeout in msec, -1 for infinite timeout
152 */
15b8a8ea 153struct dmatest_params {
e03e93a9
AS
154 unsigned int buf_size;
155 char channel[20];
156 char device[20];
157 unsigned int threads_per_chan;
158 unsigned int max_channels;
159 unsigned int iterations;
160 unsigned int xor_sources;
161 unsigned int pq_sources;
162 int timeout;
15b8a8ea
AS
163};
164
165/**
166 * struct dmatest_info - test information.
167 * @params: test parameters
851b7e16 168 * @lock: access protection to the fields of this structure
15b8a8ea
AS
169 */
170struct dmatest_info {
171 /* Test parameters */
172 struct dmatest_params params;
838cc704
AS
173
174 /* Internal state */
175 struct list_head channels;
176 unsigned int nr_channels;
851b7e16
AS
177 struct mutex lock;
178
179 /* debugfs related stuff */
180 struct dentry *root;
181 struct dmatest_params dbgfs_params;
95019c8c
AS
182
183 /* Test results */
184 struct list_head results;
185 struct mutex results_lock;
e03e93a9
AS
186};
187
188static struct dmatest_info test_info;
189
15b8a8ea 190static bool dmatest_match_channel(struct dmatest_params *params,
e03e93a9 191 struct dma_chan *chan)
4a776f0a 192{
15b8a8ea 193 if (params->channel[0] == '\0')
4a776f0a 194 return true;
15b8a8ea 195 return strcmp(dma_chan_name(chan), params->channel) == 0;
4a776f0a
HS
196}
197
15b8a8ea 198static bool dmatest_match_device(struct dmatest_params *params,
e03e93a9 199 struct dma_device *device)
4a776f0a 200{
15b8a8ea 201 if (params->device[0] == '\0')
4a776f0a 202 return true;
15b8a8ea 203 return strcmp(dev_name(device->dev), params->device) == 0;
4a776f0a
HS
204}
205
206static unsigned long dmatest_random(void)
207{
208 unsigned long buf;
209
210 get_random_bytes(&buf, sizeof(buf));
211 return buf;
212}
213
e03e93a9
AS
214static void dmatest_init_srcs(u8 **bufs, unsigned int start, unsigned int len,
215 unsigned int buf_size)
4a776f0a
HS
216{
217 unsigned int i;
b54d5cb9
DW
218 u8 *buf;
219
220 for (; (buf = *bufs); bufs++) {
221 for (i = 0; i < start; i++)
222 buf[i] = PATTERN_SRC | (~i & PATTERN_COUNT_MASK);
223 for ( ; i < start + len; i++)
224 buf[i] = PATTERN_SRC | PATTERN_COPY
c019894e 225 | (~i & PATTERN_COUNT_MASK);
e03e93a9 226 for ( ; i < buf_size; i++)
b54d5cb9
DW
227 buf[i] = PATTERN_SRC | (~i & PATTERN_COUNT_MASK);
228 buf++;
229 }
4a776f0a
HS
230}
231
e03e93a9
AS
232static void dmatest_init_dsts(u8 **bufs, unsigned int start, unsigned int len,
233 unsigned int buf_size)
4a776f0a
HS
234{
235 unsigned int i;
b54d5cb9
DW
236 u8 *buf;
237
238 for (; (buf = *bufs); bufs++) {
239 for (i = 0; i < start; i++)
240 buf[i] = PATTERN_DST | (~i & PATTERN_COUNT_MASK);
241 for ( ; i < start + len; i++)
242 buf[i] = PATTERN_DST | PATTERN_OVERWRITE
243 | (~i & PATTERN_COUNT_MASK);
e03e93a9 244 for ( ; i < buf_size; i++)
b54d5cb9
DW
245 buf[i] = PATTERN_DST | (~i & PATTERN_COUNT_MASK);
246 }
4a776f0a
HS
247}
248
249static void dmatest_mismatch(u8 actual, u8 pattern, unsigned int index,
250 unsigned int counter, bool is_srcbuf)
251{
252 u8 diff = actual ^ pattern;
253 u8 expected = pattern | (~counter & PATTERN_COUNT_MASK);
254 const char *thread_name = current->comm;
255
256 if (is_srcbuf)
257 pr_warning("%s: srcbuf[0x%x] overwritten!"
258 " Expected %02x, got %02x\n",
259 thread_name, index, expected, actual);
260 else if ((pattern & PATTERN_COPY)
261 && (diff & (PATTERN_COPY | PATTERN_OVERWRITE)))
262 pr_warning("%s: dstbuf[0x%x] not copied!"
263 " Expected %02x, got %02x\n",
264 thread_name, index, expected, actual);
265 else if (diff & PATTERN_SRC)
266 pr_warning("%s: dstbuf[0x%x] was copied!"
267 " Expected %02x, got %02x\n",
268 thread_name, index, expected, actual);
269 else
270 pr_warning("%s: dstbuf[0x%x] mismatch!"
271 " Expected %02x, got %02x\n",
272 thread_name, index, expected, actual);
273}
274
b54d5cb9 275static unsigned int dmatest_verify(u8 **bufs, unsigned int start,
4a776f0a
HS
276 unsigned int end, unsigned int counter, u8 pattern,
277 bool is_srcbuf)
278{
279 unsigned int i;
280 unsigned int error_count = 0;
281 u8 actual;
b54d5cb9
DW
282 u8 expected;
283 u8 *buf;
284 unsigned int counter_orig = counter;
285
286 for (; (buf = *bufs); bufs++) {
287 counter = counter_orig;
288 for (i = start; i < end; i++) {
289 actual = buf[i];
290 expected = pattern | (~counter & PATTERN_COUNT_MASK);
291 if (actual != expected) {
74b5c07a 292 if (error_count < MAX_ERROR_COUNT)
b54d5cb9
DW
293 dmatest_mismatch(actual, pattern, i,
294 counter, is_srcbuf);
295 error_count++;
296 }
297 counter++;
4a776f0a 298 }
4a776f0a
HS
299 }
300
74b5c07a 301 if (error_count > MAX_ERROR_COUNT)
4a776f0a 302 pr_warning("%s: %u errors suppressed\n",
74b5c07a 303 current->comm, error_count - MAX_ERROR_COUNT);
4a776f0a
HS
304
305 return error_count;
306}
307
adfa543e
TH
308/* poor man's completion - we want to use wait_event_freezable() on it */
309struct dmatest_done {
310 bool done;
311 wait_queue_head_t *wait;
312};
313
314static void dmatest_callback(void *arg)
e44e0aa3 315{
adfa543e
TH
316 struct dmatest_done *done = arg;
317
318 done->done = true;
319 wake_up_all(done->wait);
e44e0aa3
DW
320}
321
632fd283
AS
322static inline void unmap_src(struct device *dev, dma_addr_t *addr, size_t len,
323 unsigned int count)
324{
325 while (count--)
326 dma_unmap_single(dev, addr[count], len, DMA_TO_DEVICE);
327}
328
329static inline void unmap_dst(struct device *dev, dma_addr_t *addr, size_t len,
330 unsigned int count)
331{
332 while (count--)
333 dma_unmap_single(dev, addr[count], len, DMA_BIDIRECTIONAL);
334}
335
8be9e32b
AM
336static unsigned int min_odd(unsigned int x, unsigned int y)
337{
338 unsigned int val = min(x, y);
339
340 return val % 2 ? val : val - 1;
341}
342
95019c8c
AS
343static char *thread_result_get(const char *name,
344 struct dmatest_thread_result *tr)
345{
346 static const char * const messages[] = {
347 [DMATEST_ET_OK] = "No errors",
348 [DMATEST_ET_MAP_SRC] = "src mapping error",
349 [DMATEST_ET_MAP_DST] = "dst mapping error",
350 [DMATEST_ET_PREP] = "prep error",
351 [DMATEST_ET_SUBMIT] = "submit error",
352 [DMATEST_ET_TIMEOUT] = "test timed out",
353 [DMATEST_ET_DMA_ERROR] =
354 "got completion callback (DMA_ERROR)",
355 [DMATEST_ET_DMA_IN_PROGRESS] =
356 "got completion callback (DMA_IN_PROGRESS)",
357 [DMATEST_ET_VERIFY] = "errors",
358 };
359 static char buf[512];
360
361 snprintf(buf, sizeof(buf) - 1,
362 "%s: #%u: %s with src_off=0x%x ""dst_off=0x%x len=0x%x (%lu)",
363 name, tr->n, messages[tr->type], tr->src_off, tr->dst_off,
364 tr->len, tr->data);
365
366 return buf;
367}
368
369static int thread_result_add(struct dmatest_info *info,
370 struct dmatest_result *r, enum dmatest_error_type type,
371 unsigned int n, unsigned int src_off, unsigned int dst_off,
372 unsigned int len, unsigned long data)
373{
374 struct dmatest_thread_result *tr;
375
376 tr = kzalloc(sizeof(*tr), GFP_KERNEL);
377 if (!tr)
378 return -ENOMEM;
379
380 tr->type = type;
381 tr->n = n;
382 tr->src_off = src_off;
383 tr->dst_off = dst_off;
384 tr->len = len;
385 tr->data = data;
386
387 mutex_lock(&info->results_lock);
388 list_add_tail(&tr->node, &r->results);
389 mutex_unlock(&info->results_lock);
390
391 pr_warn("%s\n", thread_result_get(r->name, tr));
392 return 0;
393}
394
395static void result_free(struct dmatest_info *info, const char *name)
396{
397 struct dmatest_result *r, *_r;
398
399 mutex_lock(&info->results_lock);
400 list_for_each_entry_safe(r, _r, &info->results, node) {
401 struct dmatest_thread_result *tr, *_tr;
402
403 if (name && strcmp(r->name, name))
404 continue;
405
406 list_for_each_entry_safe(tr, _tr, &r->results, node) {
407 list_del(&tr->node);
408 kfree(tr);
409 }
410
411 kfree(r->name);
412 list_del(&r->node);
413 kfree(r);
414 }
415
416 mutex_unlock(&info->results_lock);
417}
418
419static struct dmatest_result *result_init(struct dmatest_info *info,
420 const char *name)
421{
422 struct dmatest_result *r;
423
424 r = kzalloc(sizeof(*r), GFP_KERNEL);
425 if (r) {
426 r->name = kstrdup(name, GFP_KERNEL);
427 INIT_LIST_HEAD(&r->results);
428 mutex_lock(&info->results_lock);
429 list_add_tail(&r->node, &info->results);
430 mutex_unlock(&info->results_lock);
431 }
432 return r;
433}
434
4a776f0a
HS
435/*
436 * This function repeatedly tests DMA transfers of various lengths and
b54d5cb9
DW
437 * offsets for a given operation type until it is told to exit by
438 * kthread_stop(). There may be multiple threads running this function
439 * in parallel for a single channel, and there may be multiple channels
440 * being tested in parallel.
4a776f0a
HS
441 *
442 * Before each test, the source and destination buffer is initialized
443 * with a known pattern. This pattern is different depending on
444 * whether it's in an area which is supposed to be copied or
445 * overwritten, and different in the source and destination buffers.
446 * So if the DMA engine doesn't copy exactly what we tell it to copy,
447 * we'll notice.
448 */
449static int dmatest_func(void *data)
450{
adfa543e 451 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(done_wait);
4a776f0a 452 struct dmatest_thread *thread = data;
adfa543e 453 struct dmatest_done done = { .wait = &done_wait };
e03e93a9 454 struct dmatest_info *info;
15b8a8ea 455 struct dmatest_params *params;
4a776f0a 456 struct dma_chan *chan;
8be9e32b 457 struct dma_device *dev;
4a776f0a
HS
458 const char *thread_name;
459 unsigned int src_off, dst_off, len;
460 unsigned int error_count;
461 unsigned int failed_tests = 0;
462 unsigned int total_tests = 0;
463 dma_cookie_t cookie;
464 enum dma_status status;
b54d5cb9 465 enum dma_ctrl_flags flags;
945b5af3 466 u8 *pq_coefs = NULL;
4a776f0a 467 int ret;
b54d5cb9
DW
468 int src_cnt;
469 int dst_cnt;
470 int i;
95019c8c 471 struct dmatest_result *result;
4a776f0a
HS
472
473 thread_name = current->comm;
adfa543e 474 set_freezable();
4a776f0a
HS
475
476 ret = -ENOMEM;
4a776f0a
HS
477
478 smp_rmb();
e03e93a9 479 info = thread->info;
15b8a8ea 480 params = &info->params;
4a776f0a 481 chan = thread->chan;
8be9e32b 482 dev = chan->device;
b54d5cb9
DW
483 if (thread->type == DMA_MEMCPY)
484 src_cnt = dst_cnt = 1;
485 else if (thread->type == DMA_XOR) {
8be9e32b 486 /* force odd to ensure dst = src */
15b8a8ea 487 src_cnt = min_odd(params->xor_sources | 1, dev->max_xor);
b54d5cb9 488 dst_cnt = 1;
58691d64 489 } else if (thread->type == DMA_PQ) {
8be9e32b 490 /* force odd to ensure dst = src */
15b8a8ea 491 src_cnt = min_odd(params->pq_sources | 1, dma_maxpq(dev, 0));
58691d64 492 dst_cnt = 2;
945b5af3 493
15b8a8ea 494 pq_coefs = kmalloc(params->pq_sources+1, GFP_KERNEL);
945b5af3
AS
495 if (!pq_coefs)
496 goto err_thread_type;
497
94de648d 498 for (i = 0; i < src_cnt; i++)
58691d64 499 pq_coefs[i] = 1;
b54d5cb9 500 } else
945b5af3 501 goto err_thread_type;
b54d5cb9 502
95019c8c
AS
503 result = result_init(info, thread_name);
504 if (!result)
505 goto err_srcs;
506
b54d5cb9
DW
507 thread->srcs = kcalloc(src_cnt+1, sizeof(u8 *), GFP_KERNEL);
508 if (!thread->srcs)
509 goto err_srcs;
510 for (i = 0; i < src_cnt; i++) {
15b8a8ea 511 thread->srcs[i] = kmalloc(params->buf_size, GFP_KERNEL);
b54d5cb9
DW
512 if (!thread->srcs[i])
513 goto err_srcbuf;
514 }
515 thread->srcs[i] = NULL;
516
517 thread->dsts = kcalloc(dst_cnt+1, sizeof(u8 *), GFP_KERNEL);
518 if (!thread->dsts)
519 goto err_dsts;
520 for (i = 0; i < dst_cnt; i++) {
15b8a8ea 521 thread->dsts[i] = kmalloc(params->buf_size, GFP_KERNEL);
b54d5cb9
DW
522 if (!thread->dsts[i])
523 goto err_dstbuf;
524 }
525 thread->dsts[i] = NULL;
526
e44e0aa3
DW
527 set_user_nice(current, 10);
528
b203bd3f
IS
529 /*
530 * src buffers are freed by the DMAEngine code with dma_unmap_single()
531 * dst buffers are freed by ourselves below
532 */
533 flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT
534 | DMA_COMPL_SKIP_DEST_UNMAP | DMA_COMPL_SRC_UNMAP_SINGLE;
4a776f0a 535
0a2ff57d 536 while (!kthread_should_stop()
15b8a8ea 537 && !(params->iterations && total_tests >= params->iterations)) {
b54d5cb9
DW
538 struct dma_async_tx_descriptor *tx = NULL;
539 dma_addr_t dma_srcs[src_cnt];
540 dma_addr_t dma_dsts[dst_cnt];
83544ae9 541 u8 align = 0;
d86be86e 542
4a776f0a
HS
543 total_tests++;
544
83544ae9
DW
545 /* honor alignment restrictions */
546 if (thread->type == DMA_MEMCPY)
547 align = dev->copy_align;
548 else if (thread->type == DMA_XOR)
549 align = dev->xor_align;
550 else if (thread->type == DMA_PQ)
551 align = dev->pq_align;
552
15b8a8ea 553 if (1 << align > params->buf_size) {
cfe4f275 554 pr_err("%u-byte buffer too small for %d-byte alignment\n",
15b8a8ea 555 params->buf_size, 1 << align);
cfe4f275
GL
556 break;
557 }
558
15b8a8ea 559 len = dmatest_random() % params->buf_size + 1;
83544ae9 560 len = (len >> align) << align;
cfe4f275
GL
561 if (!len)
562 len = 1 << align;
15b8a8ea
AS
563 src_off = dmatest_random() % (params->buf_size - len + 1);
564 dst_off = dmatest_random() % (params->buf_size - len + 1);
cfe4f275 565
83544ae9
DW
566 src_off = (src_off >> align) << align;
567 dst_off = (dst_off >> align) << align;
568
15b8a8ea
AS
569 dmatest_init_srcs(thread->srcs, src_off, len, params->buf_size);
570 dmatest_init_dsts(thread->dsts, dst_off, len, params->buf_size);
4a776f0a 571
b54d5cb9
DW
572 for (i = 0; i < src_cnt; i++) {
573 u8 *buf = thread->srcs[i] + src_off;
574
575 dma_srcs[i] = dma_map_single(dev->dev, buf, len,
576 DMA_TO_DEVICE);
afde3be1
AS
577 ret = dma_mapping_error(dev->dev, dma_srcs[i]);
578 if (ret) {
579 unmap_src(dev->dev, dma_srcs, len, i);
95019c8c
AS
580 thread_result_add(info, result,
581 DMATEST_ET_MAP_SRC,
582 total_tests, src_off, dst_off,
583 len, ret);
afde3be1
AS
584 failed_tests++;
585 continue;
586 }
b54d5cb9 587 }
d86be86e 588 /* map with DMA_BIDIRECTIONAL to force writeback/invalidate */
b54d5cb9
DW
589 for (i = 0; i < dst_cnt; i++) {
590 dma_dsts[i] = dma_map_single(dev->dev, thread->dsts[i],
15b8a8ea 591 params->buf_size,
b54d5cb9 592 DMA_BIDIRECTIONAL);
afde3be1
AS
593 ret = dma_mapping_error(dev->dev, dma_dsts[i]);
594 if (ret) {
595 unmap_src(dev->dev, dma_srcs, len, src_cnt);
15b8a8ea
AS
596 unmap_dst(dev->dev, dma_dsts, params->buf_size,
597 i);
95019c8c
AS
598 thread_result_add(info, result,
599 DMATEST_ET_MAP_DST,
600 total_tests, src_off, dst_off,
601 len, ret);
afde3be1
AS
602 failed_tests++;
603 continue;
604 }
b54d5cb9
DW
605 }
606
607 if (thread->type == DMA_MEMCPY)
608 tx = dev->device_prep_dma_memcpy(chan,
609 dma_dsts[0] + dst_off,
610 dma_srcs[0], len,
611 flags);
612 else if (thread->type == DMA_XOR)
613 tx = dev->device_prep_dma_xor(chan,
614 dma_dsts[0] + dst_off,
67b9124f 615 dma_srcs, src_cnt,
b54d5cb9 616 len, flags);
58691d64
DW
617 else if (thread->type == DMA_PQ) {
618 dma_addr_t dma_pq[dst_cnt];
619
620 for (i = 0; i < dst_cnt; i++)
621 dma_pq[i] = dma_dsts[i] + dst_off;
622 tx = dev->device_prep_dma_pq(chan, dma_pq, dma_srcs,
94de648d 623 src_cnt, pq_coefs,
58691d64
DW
624 len, flags);
625 }
d86be86e 626
d86be86e 627 if (!tx) {
632fd283 628 unmap_src(dev->dev, dma_srcs, len, src_cnt);
15b8a8ea
AS
629 unmap_dst(dev->dev, dma_dsts, params->buf_size,
630 dst_cnt);
95019c8c
AS
631 thread_result_add(info, result, DMATEST_ET_PREP,
632 total_tests, src_off, dst_off,
633 len, 0);
d86be86e
AN
634 msleep(100);
635 failed_tests++;
636 continue;
637 }
e44e0aa3 638
adfa543e 639 done.done = false;
e44e0aa3 640 tx->callback = dmatest_callback;
adfa543e 641 tx->callback_param = &done;
d86be86e
AN
642 cookie = tx->tx_submit(tx);
643
4a776f0a 644 if (dma_submit_error(cookie)) {
95019c8c
AS
645 thread_result_add(info, result, DMATEST_ET_SUBMIT,
646 total_tests, src_off, dst_off,
647 len, cookie);
4a776f0a
HS
648 msleep(100);
649 failed_tests++;
650 continue;
651 }
b54d5cb9 652 dma_async_issue_pending(chan);
4a776f0a 653
77101ce5
AS
654 wait_event_freezable_timeout(done_wait,
655 done.done || kthread_should_stop(),
15b8a8ea 656 msecs_to_jiffies(params->timeout));
981ed70d 657
e44e0aa3 658 status = dma_async_is_tx_complete(chan, cookie, NULL, NULL);
4a776f0a 659
adfa543e
TH
660 if (!done.done) {
661 /*
662 * We're leaving the timed out dma operation with
663 * dangling pointer to done_wait. To make this
664 * correct, we'll need to allocate wait_done for
665 * each test iteration and perform "who's gonna
666 * free it this time?" dancing. For now, just
667 * leave it dangling.
668 */
95019c8c
AS
669 thread_result_add(info, result, DMATEST_ET_TIMEOUT,
670 total_tests, src_off, dst_off,
671 len, 0);
e44e0aa3
DW
672 failed_tests++;
673 continue;
674 } else if (status != DMA_SUCCESS) {
95019c8c
AS
675 enum dmatest_error_type type = (status == DMA_ERROR) ?
676 DMATEST_ET_DMA_ERROR : DMATEST_ET_DMA_IN_PROGRESS;
677 thread_result_add(info, result, type,
678 total_tests, src_off, dst_off,
679 len, status);
4a776f0a
HS
680 failed_tests++;
681 continue;
682 }
e44e0aa3 683
d86be86e 684 /* Unmap by myself (see DMA_COMPL_SKIP_DEST_UNMAP above) */
15b8a8ea 685 unmap_dst(dev->dev, dma_dsts, params->buf_size, dst_cnt);
4a776f0a
HS
686
687 error_count = 0;
688
689 pr_debug("%s: verifying source buffer...\n", thread_name);
b54d5cb9 690 error_count += dmatest_verify(thread->srcs, 0, src_off,
4a776f0a 691 0, PATTERN_SRC, true);
b54d5cb9 692 error_count += dmatest_verify(thread->srcs, src_off,
4a776f0a
HS
693 src_off + len, src_off,
694 PATTERN_SRC | PATTERN_COPY, true);
b54d5cb9 695 error_count += dmatest_verify(thread->srcs, src_off + len,
15b8a8ea 696 params->buf_size, src_off + len,
4a776f0a
HS
697 PATTERN_SRC, true);
698
699 pr_debug("%s: verifying dest buffer...\n",
700 thread->task->comm);
b54d5cb9 701 error_count += dmatest_verify(thread->dsts, 0, dst_off,
4a776f0a 702 0, PATTERN_DST, false);
b54d5cb9 703 error_count += dmatest_verify(thread->dsts, dst_off,
4a776f0a
HS
704 dst_off + len, src_off,
705 PATTERN_SRC | PATTERN_COPY, false);
b54d5cb9 706 error_count += dmatest_verify(thread->dsts, dst_off + len,
15b8a8ea 707 params->buf_size, dst_off + len,
4a776f0a
HS
708 PATTERN_DST, false);
709
710 if (error_count) {
95019c8c
AS
711 thread_result_add(info, result, DMATEST_ET_VERIFY,
712 total_tests, src_off, dst_off,
713 len, error_count);
4a776f0a
HS
714 failed_tests++;
715 } else {
95019c8c
AS
716 thread_result_add(info, result, DMATEST_ET_OK,
717 total_tests, src_off, dst_off,
718 len, 0);
4a776f0a
HS
719 }
720 }
721
722 ret = 0;
b54d5cb9
DW
723 for (i = 0; thread->dsts[i]; i++)
724 kfree(thread->dsts[i]);
4a776f0a 725err_dstbuf:
b54d5cb9
DW
726 kfree(thread->dsts);
727err_dsts:
728 for (i = 0; thread->srcs[i]; i++)
729 kfree(thread->srcs[i]);
4a776f0a 730err_srcbuf:
b54d5cb9
DW
731 kfree(thread->srcs);
732err_srcs:
945b5af3
AS
733 kfree(pq_coefs);
734err_thread_type:
4a776f0a
HS
735 pr_notice("%s: terminating after %u tests, %u failures (status %d)\n",
736 thread_name, total_tests, failed_tests, ret);
0a2ff57d 737
9704efaa 738 /* terminate all transfers on specified channels */
5e034f7b
SH
739 if (ret)
740 dmaengine_terminate_all(chan);
741
3e5ccd86
AS
742 thread->done = true;
743
15b8a8ea 744 if (params->iterations > 0)
0a2ff57d 745 while (!kthread_should_stop()) {
b953df7c 746 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait_dmatest_exit);
0a2ff57d
NF
747 interruptible_sleep_on(&wait_dmatest_exit);
748 }
749
4a776f0a
HS
750 return ret;
751}
752
753static void dmatest_cleanup_channel(struct dmatest_chan *dtc)
754{
755 struct dmatest_thread *thread;
756 struct dmatest_thread *_thread;
757 int ret;
758
759 list_for_each_entry_safe(thread, _thread, &dtc->threads, node) {
760 ret = kthread_stop(thread->task);
761 pr_debug("dmatest: thread %s exited with status %d\n",
762 thread->task->comm, ret);
763 list_del(&thread->node);
764 kfree(thread);
765 }
9704efaa
VK
766
767 /* terminate all transfers on specified channels */
944ea4dd 768 dmaengine_terminate_all(dtc->chan);
9704efaa 769
4a776f0a
HS
770 kfree(dtc);
771}
772
e03e93a9
AS
773static int dmatest_add_threads(struct dmatest_info *info,
774 struct dmatest_chan *dtc, enum dma_transaction_type type)
4a776f0a 775{
15b8a8ea 776 struct dmatest_params *params = &info->params;
b54d5cb9
DW
777 struct dmatest_thread *thread;
778 struct dma_chan *chan = dtc->chan;
779 char *op;
780 unsigned int i;
4a776f0a 781
b54d5cb9
DW
782 if (type == DMA_MEMCPY)
783 op = "copy";
784 else if (type == DMA_XOR)
785 op = "xor";
58691d64
DW
786 else if (type == DMA_PQ)
787 op = "pq";
b54d5cb9
DW
788 else
789 return -EINVAL;
4a776f0a 790
15b8a8ea 791 for (i = 0; i < params->threads_per_chan; i++) {
4a776f0a
HS
792 thread = kzalloc(sizeof(struct dmatest_thread), GFP_KERNEL);
793 if (!thread) {
b54d5cb9
DW
794 pr_warning("dmatest: No memory for %s-%s%u\n",
795 dma_chan_name(chan), op, i);
796
4a776f0a
HS
797 break;
798 }
e03e93a9 799 thread->info = info;
4a776f0a 800 thread->chan = dtc->chan;
b54d5cb9 801 thread->type = type;
4a776f0a 802 smp_wmb();
b54d5cb9
DW
803 thread->task = kthread_run(dmatest_func, thread, "%s-%s%u",
804 dma_chan_name(chan), op, i);
4a776f0a 805 if (IS_ERR(thread->task)) {
b54d5cb9
DW
806 pr_warning("dmatest: Failed to run thread %s-%s%u\n",
807 dma_chan_name(chan), op, i);
4a776f0a
HS
808 kfree(thread);
809 break;
810 }
811
812 /* srcbuf and dstbuf are allocated by the thread itself */
813
814 list_add_tail(&thread->node, &dtc->threads);
815 }
816
b54d5cb9
DW
817 return i;
818}
819
e03e93a9
AS
820static int dmatest_add_channel(struct dmatest_info *info,
821 struct dma_chan *chan)
b54d5cb9
DW
822{
823 struct dmatest_chan *dtc;
824 struct dma_device *dma_dev = chan->device;
825 unsigned int thread_count = 0;
b9033e68 826 int cnt;
b54d5cb9
DW
827
828 dtc = kmalloc(sizeof(struct dmatest_chan), GFP_KERNEL);
829 if (!dtc) {
830 pr_warning("dmatest: No memory for %s\n", dma_chan_name(chan));
831 return -ENOMEM;
832 }
833
834 dtc->chan = chan;
835 INIT_LIST_HEAD(&dtc->threads);
836
837 if (dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask)) {
e03e93a9 838 cnt = dmatest_add_threads(info, dtc, DMA_MEMCPY);
f1aef8b6 839 thread_count += cnt > 0 ? cnt : 0;
b54d5cb9
DW
840 }
841 if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) {
e03e93a9 842 cnt = dmatest_add_threads(info, dtc, DMA_XOR);
f1aef8b6 843 thread_count += cnt > 0 ? cnt : 0;
b54d5cb9 844 }
58691d64 845 if (dma_has_cap(DMA_PQ, dma_dev->cap_mask)) {
e03e93a9 846 cnt = dmatest_add_threads(info, dtc, DMA_PQ);
d07a74a5 847 thread_count += cnt > 0 ? cnt : 0;
58691d64 848 }
b54d5cb9
DW
849
850 pr_info("dmatest: Started %u threads using %s\n",
851 thread_count, dma_chan_name(chan));
4a776f0a 852
838cc704
AS
853 list_add_tail(&dtc->node, &info->channels);
854 info->nr_channels++;
4a776f0a 855
33df8ca0 856 return 0;
4a776f0a
HS
857}
858
7dd60251 859static bool filter(struct dma_chan *chan, void *param)
4a776f0a 860{
15b8a8ea 861 struct dmatest_params *params = param;
e03e93a9 862
15b8a8ea
AS
863 if (!dmatest_match_channel(params, chan) ||
864 !dmatest_match_device(params, chan->device))
7dd60251 865 return false;
33df8ca0 866 else
7dd60251 867 return true;
4a776f0a
HS
868}
869
851b7e16 870static int __run_threaded_test(struct dmatest_info *info)
4a776f0a 871{
33df8ca0
DW
872 dma_cap_mask_t mask;
873 struct dma_chan *chan;
15b8a8ea 874 struct dmatest_params *params = &info->params;
33df8ca0
DW
875 int err = 0;
876
877 dma_cap_zero(mask);
878 dma_cap_set(DMA_MEMCPY, mask);
879 for (;;) {
15b8a8ea 880 chan = dma_request_channel(mask, filter, params);
33df8ca0 881 if (chan) {
e03e93a9 882 err = dmatest_add_channel(info, chan);
c56c81ab 883 if (err) {
33df8ca0
DW
884 dma_release_channel(chan);
885 break; /* add_channel failed, punt */
886 }
887 } else
888 break; /* no more channels available */
15b8a8ea
AS
889 if (params->max_channels &&
890 info->nr_channels >= params->max_channels)
33df8ca0
DW
891 break; /* we have all we need */
892 }
33df8ca0 893 return err;
4a776f0a 894}
4a776f0a 895
851b7e16
AS
896#ifndef MODULE
897static int run_threaded_test(struct dmatest_info *info)
898{
899 int ret;
900
901 mutex_lock(&info->lock);
902 ret = __run_threaded_test(info);
903 mutex_unlock(&info->lock);
904 return ret;
905}
906#endif
907
908static void __stop_threaded_test(struct dmatest_info *info)
4a776f0a 909{
33df8ca0 910 struct dmatest_chan *dtc, *_dtc;
7cbd4877 911 struct dma_chan *chan;
33df8ca0 912
838cc704 913 list_for_each_entry_safe(dtc, _dtc, &info->channels, node) {
33df8ca0 914 list_del(&dtc->node);
7cbd4877 915 chan = dtc->chan;
33df8ca0 916 dmatest_cleanup_channel(dtc);
838cc704 917 pr_debug("dmatest: dropped channel %s\n", dma_chan_name(chan));
7cbd4877 918 dma_release_channel(chan);
33df8ca0 919 }
838cc704
AS
920
921 info->nr_channels = 0;
4a776f0a 922}
e03e93a9 923
851b7e16
AS
924static void stop_threaded_test(struct dmatest_info *info)
925{
926 mutex_lock(&info->lock);
927 __stop_threaded_test(info);
928 mutex_unlock(&info->lock);
929}
930
931static int __restart_threaded_test(struct dmatest_info *info, bool run)
932{
933 struct dmatest_params *params = &info->params;
934 int ret;
935
936 /* Stop any running test first */
937 __stop_threaded_test(info);
938
939 if (run == false)
940 return 0;
941
95019c8c
AS
942 /* Clear results from previous run */
943 result_free(info, NULL);
944
851b7e16
AS
945 /* Copy test parameters */
946 memcpy(params, &info->dbgfs_params, sizeof(*params));
947
948 /* Run test with new parameters */
949 ret = __run_threaded_test(info);
950 if (ret) {
951 __stop_threaded_test(info);
952 pr_err("dmatest: Can't run test\n");
953 }
954
955 return ret;
956}
957
958static ssize_t dtf_write_string(void *to, size_t available, loff_t *ppos,
959 const void __user *from, size_t count)
960{
961 char tmp[20];
962 ssize_t len;
963
964 len = simple_write_to_buffer(tmp, sizeof(tmp) - 1, ppos, from, count);
965 if (len >= 0) {
966 tmp[len] = '\0';
967 strlcpy(to, strim(tmp), available);
968 }
969
970 return len;
971}
972
973static ssize_t dtf_read_channel(struct file *file, char __user *buf,
974 size_t count, loff_t *ppos)
975{
976 struct dmatest_info *info = file->private_data;
977 return simple_read_from_buffer(buf, count, ppos,
978 info->dbgfs_params.channel,
979 strlen(info->dbgfs_params.channel));
980}
981
982static ssize_t dtf_write_channel(struct file *file, const char __user *buf,
983 size_t size, loff_t *ppos)
984{
985 struct dmatest_info *info = file->private_data;
986 return dtf_write_string(info->dbgfs_params.channel,
987 sizeof(info->dbgfs_params.channel),
988 ppos, buf, size);
989}
990
991static const struct file_operations dtf_channel_fops = {
992 .read = dtf_read_channel,
993 .write = dtf_write_channel,
994 .open = simple_open,
995 .llseek = default_llseek,
996};
997
998static ssize_t dtf_read_device(struct file *file, char __user *buf,
999 size_t count, loff_t *ppos)
1000{
1001 struct dmatest_info *info = file->private_data;
1002 return simple_read_from_buffer(buf, count, ppos,
1003 info->dbgfs_params.device,
1004 strlen(info->dbgfs_params.device));
1005}
1006
1007static ssize_t dtf_write_device(struct file *file, const char __user *buf,
1008 size_t size, loff_t *ppos)
1009{
1010 struct dmatest_info *info = file->private_data;
1011 return dtf_write_string(info->dbgfs_params.device,
1012 sizeof(info->dbgfs_params.device),
1013 ppos, buf, size);
1014}
1015
1016static const struct file_operations dtf_device_fops = {
1017 .read = dtf_read_device,
1018 .write = dtf_write_device,
1019 .open = simple_open,
1020 .llseek = default_llseek,
1021};
1022
1023static ssize_t dtf_read_run(struct file *file, char __user *user_buf,
1024 size_t count, loff_t *ppos)
1025{
1026 struct dmatest_info *info = file->private_data;
1027 char buf[3];
3e5ccd86
AS
1028 struct dmatest_chan *dtc;
1029 bool alive = false;
851b7e16
AS
1030
1031 mutex_lock(&info->lock);
3e5ccd86
AS
1032 list_for_each_entry(dtc, &info->channels, node) {
1033 struct dmatest_thread *thread;
1034
1035 list_for_each_entry(thread, &dtc->threads, node) {
1036 if (!thread->done) {
1037 alive = true;
1038 break;
1039 }
1040 }
1041 }
1042
1043 if (alive) {
851b7e16 1044 buf[0] = 'Y';
3e5ccd86
AS
1045 } else {
1046 __stop_threaded_test(info);
851b7e16 1047 buf[0] = 'N';
3e5ccd86
AS
1048 }
1049
851b7e16
AS
1050 mutex_unlock(&info->lock);
1051 buf[1] = '\n';
1052 buf[2] = 0x00;
1053 return simple_read_from_buffer(user_buf, count, ppos, buf, 2);
1054}
1055
1056static ssize_t dtf_write_run(struct file *file, const char __user *user_buf,
1057 size_t count, loff_t *ppos)
1058{
1059 struct dmatest_info *info = file->private_data;
1060 char buf[16];
1061 bool bv;
1062 int ret = 0;
1063
1064 if (copy_from_user(buf, user_buf, min(count, (sizeof(buf) - 1))))
1065 return -EFAULT;
1066
1067 if (strtobool(buf, &bv) == 0) {
1068 mutex_lock(&info->lock);
1069 ret = __restart_threaded_test(info, bv);
1070 mutex_unlock(&info->lock);
1071 }
1072
1073 return ret ? ret : count;
1074}
1075
1076static const struct file_operations dtf_run_fops = {
1077 .read = dtf_read_run,
1078 .write = dtf_write_run,
1079 .open = simple_open,
1080 .llseek = default_llseek,
1081};
1082
95019c8c
AS
1083static int dtf_results_show(struct seq_file *sf, void *data)
1084{
1085 struct dmatest_info *info = sf->private;
1086 struct dmatest_result *result;
1087 struct dmatest_thread_result *tr;
1088
1089 mutex_lock(&info->results_lock);
1090 list_for_each_entry(result, &info->results, node) {
1091 list_for_each_entry(tr, &result->results, node)
1092 seq_printf(sf, "%s\n",
1093 thread_result_get(result->name, tr));
1094 }
1095
1096 mutex_unlock(&info->results_lock);
1097 return 0;
1098}
1099
1100static int dtf_results_open(struct inode *inode, struct file *file)
1101{
1102 return single_open(file, dtf_results_show, inode->i_private);
1103}
1104
1105static const struct file_operations dtf_results_fops = {
1106 .open = dtf_results_open,
1107 .read = seq_read,
1108 .llseek = seq_lseek,
1109 .release = single_release,
1110};
1111
851b7e16
AS
1112static int dmatest_register_dbgfs(struct dmatest_info *info)
1113{
1114 struct dentry *d;
1115 struct dmatest_params *params = &info->dbgfs_params;
1116 int ret = -ENOMEM;
1117
1118 d = debugfs_create_dir("dmatest", NULL);
1119 if (IS_ERR(d))
1120 return PTR_ERR(d);
1121 if (!d)
1122 goto err_root;
1123
1124 info->root = d;
1125
1126 /* Copy initial values */
1127 memcpy(params, &info->params, sizeof(*params));
1128
1129 /* Test parameters */
1130
1131 d = debugfs_create_u32("test_buf_size", S_IWUSR | S_IRUGO, info->root,
1132 (u32 *)&params->buf_size);
1133 if (IS_ERR_OR_NULL(d))
1134 goto err_node;
1135
1136 d = debugfs_create_file("channel", S_IRUGO | S_IWUSR, info->root,
1137 info, &dtf_channel_fops);
1138 if (IS_ERR_OR_NULL(d))
1139 goto err_node;
1140
1141 d = debugfs_create_file("device", S_IRUGO | S_IWUSR, info->root,
1142 info, &dtf_device_fops);
1143 if (IS_ERR_OR_NULL(d))
1144 goto err_node;
1145
1146 d = debugfs_create_u32("threads_per_chan", S_IWUSR | S_IRUGO, info->root,
1147 (u32 *)&params->threads_per_chan);
1148 if (IS_ERR_OR_NULL(d))
1149 goto err_node;
1150
1151 d = debugfs_create_u32("max_channels", S_IWUSR | S_IRUGO, info->root,
1152 (u32 *)&params->max_channels);
1153 if (IS_ERR_OR_NULL(d))
1154 goto err_node;
1155
1156 d = debugfs_create_u32("iterations", S_IWUSR | S_IRUGO, info->root,
1157 (u32 *)&params->iterations);
1158 if (IS_ERR_OR_NULL(d))
1159 goto err_node;
1160
1161 d = debugfs_create_u32("xor_sources", S_IWUSR | S_IRUGO, info->root,
1162 (u32 *)&params->xor_sources);
1163 if (IS_ERR_OR_NULL(d))
1164 goto err_node;
1165
1166 d = debugfs_create_u32("pq_sources", S_IWUSR | S_IRUGO, info->root,
1167 (u32 *)&params->pq_sources);
1168 if (IS_ERR_OR_NULL(d))
1169 goto err_node;
1170
1171 d = debugfs_create_u32("timeout", S_IWUSR | S_IRUGO, info->root,
1172 (u32 *)&params->timeout);
1173 if (IS_ERR_OR_NULL(d))
1174 goto err_node;
1175
1176 /* Run or stop threaded test */
1177 d = debugfs_create_file("run", S_IWUSR | S_IRUGO, info->root,
1178 info, &dtf_run_fops);
1179 if (IS_ERR_OR_NULL(d))
1180 goto err_node;
1181
95019c8c
AS
1182 /* Results of test in progress */
1183 d = debugfs_create_file("results", S_IRUGO, info->root, info,
1184 &dtf_results_fops);
1185 if (IS_ERR_OR_NULL(d))
1186 goto err_node;
1187
851b7e16
AS
1188 return 0;
1189
1190err_node:
1191 debugfs_remove_recursive(info->root);
1192err_root:
1193 pr_err("dmatest: Failed to initialize debugfs\n");
1194 return ret;
1195}
1196
e03e93a9
AS
1197static int __init dmatest_init(void)
1198{
1199 struct dmatest_info *info = &test_info;
15b8a8ea 1200 struct dmatest_params *params = &info->params;
851b7e16 1201 int ret;
e03e93a9
AS
1202
1203 memset(info, 0, sizeof(*info));
1204
851b7e16 1205 mutex_init(&info->lock);
838cc704
AS
1206 INIT_LIST_HEAD(&info->channels);
1207
95019c8c
AS
1208 mutex_init(&info->results_lock);
1209 INIT_LIST_HEAD(&info->results);
1210
838cc704 1211 /* Set default parameters */
15b8a8ea
AS
1212 params->buf_size = test_buf_size;
1213 strlcpy(params->channel, test_channel, sizeof(params->channel));
1214 strlcpy(params->device, test_device, sizeof(params->device));
1215 params->threads_per_chan = threads_per_chan;
1216 params->max_channels = max_channels;
1217 params->iterations = iterations;
1218 params->xor_sources = xor_sources;
1219 params->pq_sources = pq_sources;
1220 params->timeout = timeout;
e03e93a9 1221
851b7e16
AS
1222 ret = dmatest_register_dbgfs(info);
1223 if (ret)
1224 return ret;
1225
1226#ifdef MODULE
1227 return 0;
1228#else
e03e93a9 1229 return run_threaded_test(info);
851b7e16 1230#endif
e03e93a9
AS
1231}
1232/* when compiled-in wait for drivers to load first */
1233late_initcall(dmatest_init);
1234
1235static void __exit dmatest_exit(void)
1236{
1237 struct dmatest_info *info = &test_info;
1238
851b7e16 1239 debugfs_remove_recursive(info->root);
e03e93a9 1240 stop_threaded_test(info);
95019c8c 1241 result_free(info, NULL);
e03e93a9 1242}
4a776f0a
HS
1243module_exit(dmatest_exit);
1244
e05503ef 1245MODULE_AUTHOR("Haavard Skinnemoen (Atmel)");
4a776f0a 1246MODULE_LICENSE("GPL v2");
This page took 0.435802 seconds and 5 git commands to generate.