AnsweredAssumed Answered

sdma_test failed on imx6q

Question asked by Gang Li on Jun 30, 2013
Branched to a new discussion

I have recently downloaded imx-test-3.0.35-4.0.0.tar.gz from Index of /buildsources/i/imx-test,

my kernel is 3.0.35-05524-g8513494-dirty from Android 13.4.1 for imx6.

 

I build the mxc_sdma_memcopy_test.c as a kernel modules and mxc_sdma_test.c as an app,

However when i run the mxc_sdma_test, i got error like this:

 

Unable to handle kernel NULL pointer dereference at virtual address 00000010

pgd = d2370000

[00000010] *pgd=26163831, *pte=00000000, *ppte=00000000

Internal error: Oops: 17 [#1] PREEMPT SMP

Modules linked in: sdma_test

CPU: 0    Not tainted  (3.0.35-05524-g8513494-dirty #4)

PC is at sdma_write+0x27c/0x2e0 [sdma_test]

LR is at sdma_write+0x278/0x2e0 [sdma_test]

pc : [<bf00035c>]    lr : [<bf000358>]    psr: 60000013

sp : d236ff20  ip : c0267240  fp : 00000000

r10: 00000000  r9 : d236e000  r8 : 00000000

r7 : c07f4ce0  r6 : bf000b68  r5 : 00000000  r4 : 00000400

r3 : 00000000  r2 : 00000003  r1 : bf0003c0  r0 : 00000000

Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user

Control: 10c53c7d  Table: 2237004a  DAC: 00000015

 

 

SP: 0xd236fea0:

fea0  00000000 c004ead4 00100100 00200200 c06cf710 00000c00 2234ec00 2234f000

fec0  0000040f 00000007 bf000b68 c07f4ce0 00000000 c0044b50 00000000 bf0003c0

fee0  00000003 00000000 00000400 00000000 bf000b68 c07f4ce0 00000000 d236e000

ff00  00000000 00000000 c0267240 d236ff20 bf000358 bf00035c 60000013 ffffffff

ff20  00000000 00000000 00000001 00000000 00000000 00040028 00000003 00000002

ff40  00000000 d2322ea0 00000000 d2322ea0 00000000 be99fcbc d236ff88 c00fdc04

ff60  d2322ea0 d235a000 00000000 00000000 d2322ea0 be99fcbc 00000000 c00fde8c

ff80  00000026 00000000 00000000 00000000 00000000 be99fd18 00008411 00000004

 

 

IP: 0xc02671c0:

71c0  e517203c e59d101c e5070044 e2870030 e79a3003 e7832201 eaffffed e3a00000

71e0  eaffffeb e59a0000 e59d201c e58d3000 e59f1040 e59d3014 eb0067c5 eaffffe7

7200  e59a0000 e59d201c e58d3000 e1a03008 e59f1024 eb0067be eaffffe0 c06cf730

7220  c06b5a68 c05986a0 c06cf7d8 c06b6cbc c06cf728 c06cf740 c06cf764 c06cf7a0

7240  e92d4ff0 e1a05001 e5901050 e24dd014 e1a04000 e1a08002 e1a07003 e2406078

7260  e3510001 e510a078 e5109074 0a00002a e3a03001 e3a02002 e5803050 e1a03008

7280  e5002028 e59f2210 e59a1000 e59f020c e58d9000 eb0067f7 e5047070 e1a00006

72a0  ebfffee1 e2503000 1a00006e e3001155 e1580001 8a000065 e3580000 e5843054

 

 

R7: 0xc07f4c60:

4c60  c07f1660 c07f1660 c10d90a0 bfe07000 c07f1de0 c07f1de0 c10d6780 bfe06000

4c80  c07f2480 c07f2480 c10d6dc0 bfe05000 c07f2200 c07f2200 c10d6a00 bfe04000

4ca0  c07f1d20 c07f1d20 c10d6020 bfe03000 c07f1720 c07f1720 c10d67a0 bfe02000

4cc0  c07f2100 c07f2100 c10d6000 bfe01000 c07f1ac0 c07f1ac0 00000000 00000000

4ce0  c0916000 00000000 00000000 00000000 d9000000 00032400 00040000 00000000

4d00  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

4d20  00000000 00000000 000000ab 00000000 c07adb00 c0789930 c0041030 00000000

4d40  d6000ea0 d6000f00 00000000 00000000 00000000 d6298aa0 d2338b2c bf000000

 

 

R9: 0xd236df80:

df80  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

dfa0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

dfc0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

dfe0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

e000  00000000 00000002 00000000 d67ba060 c07a5520 00000000 00000015 c11200e0

e020  d236e000 c003e0e0 d67ba060 d6c73ba0 00000000 c07911a0 d236fe54 d236fdb0

e040  c0570eac 00000000 00000000 00000000 00000000 00000000 01000000 00000000

e060  40028820 00000000 00000000 00000000 00000000 00000000 00000000 00000000

Process test (pid: 1393, stack limit = 0xd236e2f0)

Stack: (0xd236ff20 to 0xd2370000)

ff20: 00000000 00000000 00000001 00000000 00000000 00040028 00000003 00000002

ff40: 00000000 d2322ea0 00000000 d2322ea0 00000000 be99fcbc d236ff88 c00fdc04

ff60: d2322ea0 d235a000 00000000 00000000 d2322ea0 be99fcbc 00000000 c00fde8c

ff80: 00000026 00000000 00000000 00000000 00000000 be99fd18 00008411 00000004

ffa0: c0045304 c0045180 00000000 be99fd18 00000003 be99fcbc 00000000 be99fcbc

ffc0: 00000000 be99fd18 00008411 00000004 00000000 00000000 400ca000 00000000

ffe0: 00000000 be99fcb4 00008525 4017425c 40000010 00000003 28e04021 28ad0401

[<bf00035c>] (sdma_write+0x27c/0x2e0 [sdma_test]) from [<c00fdc04>] (vfs_write+0x9c/0x140)

[<c00fdc04>] (vfs_write+0x9c/0x140) from [<c00fde8c>] (sys_write+0x38/0x70)

[<c00fde8c>] (sys_write+0x38/0x70) from [<c0045180>] (ret_fast_syscall+0x0/0x30)

Code: e58d5000 e59cc054 e12fff3c e59f1058 (e5902010)

---[ end trace 2d5f4b7560270f24 ]---

Segmentation fault

 

 

After i learn the source code and imx-sdma.c from kernel, it looks like

when dma_channel.peripheral_type is set to IMX_DMATYPE_MEMORY,

the filed sdmac->word_size is left unconfiged(default zero) so sdma_prep_slave_sg return NULL

 

Is there anyone who has met this problem or anyother examples on using of dmaengine(sdma)?

 

 

Original Attachment has been moved to: imx-sdma.c.zip

Original Attachment has been moved to: mxc_sdma_memcopy_test.c.zip

Original Attachment has been moved to: mxc_sdma_test.c.zip

Outcomes