dma_alloc_coherent bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Gupta, Ramesh
> Sent: Saturday, March 14, 2009 6:26 AM
> To: Kevin Hilman
> Cc: Menon, Nishanth; linux-omap@xxxxxxxxxxxxxxx
> Subject: RE: Bridge issue #3! dma_alloc_coherent causing crash - pm branch
> > >
> > > I enabled all the above options, do I need to add some boot
> > options to
> > > enable Debug messages? I am not seeing any debug
> > information displayed in the cosole by default.
> > > Looks like I am mising some thing :( . Any comments?
> > >
> >
> > You'll only see extra messages when the kerel hits a BUG() or
> > a WARN().  If you don't see anything more verbose with all
> > these options enabled, then the kernel is not detecting any problems.
> 
> Thank you.
> 

Back to the dummy driver. Ramesh noted that even the dummy driver crashes on the pm branch and the master branch with larger number of iterations.

This issue can be duplicated in the linux-omap master branch as follows: apply the attached patch and build with the defconfig attached,

The following test script:
for i in 0 1 2 3 4 5 6 7 8 9
do
for j in 0 1 2 3 4 5 6 7 8 9
do
for k in 0 1 2 3 4 5 6 7 8 9
do
for l in 0 1 2 3 4 5 6 7 8 9
do
        echo "insmod $i$j$k$l"
        insmod ./dummy.ko try=3 || exit 1
        echo "rmmod"
        rmmod dummy.ko || exit 1
done
done
done
done

will cause a crashes as follows:

insmod 0279
alloc[0] - virt=0xFF027000 phy=0x82C00000 size=0x00400000
alloc[1] - virt=0xFF427000 phy=0x80BEC000 size=0x00001000
alloc[2] - virt=0xFF428000 phy=0x817C0000 size=0x00011800
rmmod
free[0] - virt=0xff027000 phy=0x82c00000 size=0x00400000
free[1] - virt=0xff427000 phy=0x80bec000 size=0x00001000
free[2] - virt=0xff428000 phy=0x817c0000 size=0x00011800
insmod 0280
insmod: page allocation failure. order:10, mode:0xd0
[<c0031e14>] [<c0031e14>] (dump_stack+0x0/0x14) (dump_stack+0x0/0x14) from [<c008194c>] from [<c008194c>] (__alloc_pages_internal+0x384/0x39c)
(__alloc_pages_internal+0x384/0x39c)
[<c00815c8>] [<c00815c8>] (__alloc_pages_internal+0x0/0x39c) (__alloc_pages_internal+0x0/0x39c) from [<c003394c>] from [<c003394c>] (__dma_alloc+0x170/0x3c8)
(__dma_alloc+0x170/0x3c8)
[<c00337dc>] [<c00337dc>] (__dma_alloc+0x0/0x3c8) (__dma_alloc+0x0/0x3c8) from [<c0033c30>] from [<c0033c30>] (dma_alloc_coherent+0x58/0x64)
(dma_alloc_coherent+0x58/0x64)
[<c0033bd8>] [<c0033bd8>] (dma_alloc_coherent+0x0/0x64) (dma_alloc_coherent+0x0/0x64) from [<bf693050>] from [<bf693050>] (dummy_init+0x50/0x10c [dummy])
(dummy_init+0x50/0x10c [dummy])
 r7:bf690718 r7:bf690718 r6:00000000 r6:00000000 r5:00000000 r5:00000000 r4:bf690720 r4:bf690720

[<bf693000>] [<bf693000>] (dummy_init+0x0/0x10c [dummy]) (dummy_init+0x0/0x10c [dummy]) from [<c002d2f8>] from [<c002d2f8>] (__exception_text_end+0x60/0x198)
(__exception_text_end+0x60/0x198)
 r7:00000000 r7:00000000 r6:c03ae4c0 r6:c03ae4c0 r5:bf69073c r5:bf69073c r4:00006d4d r4:00006d4d

[<c002d298>] [<c002d298>] (__exception_text_end+0x0/0x198) (__exception_text_end+0x0/0x198) from [<c00761c8>] from [<c00761c8>] (sys_init_module+0x98/0x198)
(sys_init_module+0x98/0x198)
[<c0076130>] [<c0076130>] (sys_init_module+0x0/0x198) (sys_init_module+0x0/0x198) from [<c002dda0>] from [<c002dda0>] (ret_fast_syscall+0x0/0x2c)
(ret_fast_syscall+0x0/0x2c)
 r7:00000080 r7:00000080 r6:00000000 r6:00000000 r5:0000000b r5:0000000b r4:00000000 r4:00000000

Mem-info:
Mem-info:
Normal per-cpu:
Normal per-cpu:
CPU    0: hi:   42, btch:   7 usd:   1
CPU    0: hi:   42, btch:   7 usd:   1
Active_anon:0 active_file:0 inactive_anon:182
 inactive_file:38 unevictable:0 dirty:0 writeback:0 unstable:0
 free:30546 slab:493 mapped:1 pagetables:31 bounce:0
Active_anon:0 active_file:0 inactive_anon:182
 inactive_file:38 unevictable:0 dirty:0 writeback:0 unstable:0
 free:30546 slab:493 mapped:1 pagetables:31 bounce:0
Normal free:122184kB min:1440kB low:1800kB high:2160kB active_anon:0kB inactive_anon:728kB active_file:0kB inactive_file:152kB unevictable:0kB present:130048kB pages_scanned:0 ao
Normal free:122184kB min:1440kB low:1800kB high:2160kB active_anon:0kB inactive_anon:728kB active_file:0kB inactive_file:152kB unevictable:0kB present:130048kB pages_scanned:0 ao
lowmem_reserve[]:lowmem_reserve[]: 0 0 0 0

Normal: Normal: 124*4kB 124*4kB 105*8kB 105*8kB 71*16kB 71*16kB 53*32kB 53*32kB 40*64kB 40*64kB 28*128kB 28*128kB 31*256kB 31*256kB 29*512kB 29*512kB 29*1024kB 29*1024kB 29*2048B
= 122184kB
40 total pagecache pages
40 total pagecache pages
0 pages in swap cache
0 pages in swap cache
Swap cache stats: add 0, delete 0, find 0/0
Swap cache stats: add 0, delete 0, find 0/0
Free swap  = 0kB
Free swap  = 0kB
Total swap = 0kB
Total swap = 0kB
32768 pages of RAM
32768 pages of RAM
30599 free pages
30599 free pages
1256 reserved pages
1256 reserved pages
493 slab pages
493 slab pages
40 pages shared
40 pages shared
0 pages swap cached
0 pages swap cached
<6>alloc[0] - virt=0x00000000 phy=0xFFFFFFFF size=0x00400000
alloc[0] - virt=0x00000000 phy=0xFFFFFFFF size=0x00400000
<3>Allocation failed idx=0
Allocation failed idx=0
insmod: cannot insert `./dummy.ko': Cannot allocate memory (-1): Cannot allocate memory

Regards,
Nishanth Menon

Attachment: 0001-MASTER-Dummy-Add-Dummy-driver-for-alloc_coherent-test.patch
Description: 0001-MASTER-Dummy-Add-Dummy-driver-for-alloc_coherent-test.patch

Attachment: kern.master.defconfig
Description: kern.master.defconfig


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux