kernel panic while doing dma_alloc_coherent() function
sandeep kumar
coolsandyforyou at gmail.com
Mon Jul 22 07:44:48 EDT 2013
Hi guys
I am trying to port opensource kernel 3.0.11 onto MSM chipset.
While porting the SD card controller driver, i am seeing a kernel panic.
While tracing with printk, i am struck at
in arch/arm/mm/dma_mapping.c ,
Function,
static struct page *__dma_alloc_buffer(struct device *dev, size_t size,
gfp_t gfp)
{
<snip>
.....
ptr = page_address(page);
memset(ptr, 0, size);
dmac_flush_range(ptr, ptr + size); --> struck here
<snip>
}
And i am seeing the following call stack,
1>Unable to handle kernel paging request at virtual address 60600000
<1>pgd = c0004000
<1>[60600000] *pgd=00000000
<0>Internal error: Oops: 5 [#1] PREEMPT
CPU: 0 Not tainted (3.0.31-00022-gb0c6bf3-dirty #2)
PC is at copy_page+0x10/0x60
LR is at v6_copy_user_highpage_nonaliasing+0x8c/0xec
pc : [<c010fb30>] lr : [<c002b5e8>] psr: 30000013
sp : ef82de28 ip : 00000000 fp : c029b19c
r10: c029ace8 r9 : c0d02000 r8 : 000000d0
r7 : 00017fff r6 : 60600000 r5 : c030af34 r4 : 5fa00000
r3 : c0314000 r2 : 0000003f r1 : 60600000 r0 : 5fa00000
Flags: nzCV IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
Control: 10c57c7d Table: 00404059 DAC: 00000015
<0>Process swapper (pid: 1, stack limit = 0xef82c268)
<0>Stack: (0xef82de28 to 0xef82e000)
[<c010fb30>] (copy_page+0x10/0x60) from [<c002b5e8>]
(v6_copy_user_highpage_nonaliasing+0x8c/0xec)
[<c002b5e8>] (v6_copy_user_highpage_nonaliasing+0x8c/0xec) from
[<c0028578>] (__dma_alloc+0x114/0x2e8)
[<c0028578>] (__dma_alloc+0x114/0x2e8) from [<c00287cc>]
(dma_alloc_coherent+0x54/0x60)
[<c00287cc>] (dma_alloc_coherent+0x54/0x60) from [<c0194da8>]
(msmsdcc_probe+0x534/0x1100)
[<c0194da8>] (msmsdcc_probe+0x534/0x1100) from [<c01606d0>]
(platform_drv_probe+0x18/0x1c)
[<c01606d0>] (platform_drv_probe+0x18/0x1c) from [<c015f4a0>]
(driver_probe_device+0xf8/0x184)
[<c015f4a0>] (driver_probe_device+0xf8/0x184) from [<c015f5b8>]
(__driver_attach+0x8c/0x90)
[<c015f5b8>] (__driver_attach+0x8c/0x90) from [<c015ec7c>]
(bus_for_each_dev+0x60/0x8c)
[<c015ec7c>] (bus_for_each_dev+0x60/0x8c) from [<c015e558>]
(bus_add_driver+0xa0/0x228)
[<c015e558>] (bus_add_driver+0xa0/0x228) from [<c015fb8c>]
(driver_register+0x78/0x144)
[<c015fb8c>] (driver_register+0x78/0x144) from [<c00083d0>]
(do_one_initcall+0x94/0x164)
[<c00083d0>] (do_one_initcall+0x94/0x164) from [<c0008560>]
(kernel_init+0x8c/0x278)
[<c0008560>] (kernel_init+0x8c/0x278) from [<c002467c>]
(kernel_thread_exit+0x0/0x8)
<0>Code: e92d4010 f5d1f000 f5d1f020 e3a0203f (e8b15018)
<4>---[ end trace ce4f1a328aa6a271 ]---
<6>note: swapper[1] exited with preempt_count 2
<0>Kernel panic - not syncing: Attempted to kill init!
[<c0027ab4>] (unwind_backtrace+0x0/0xfc) from [<c0213054>]
(panic+0x64/0x188)
[<c0213054>] (panic+0x64/0x188) from [<c0045204>] (do_exit+0x664/0x6c8)
[<c0045204>] (do_exit+0x664/0x6c8) from [<c0026e78>] (die+0x238/0x2b4)
[<c0026e78>] (die+0x238/0x2b4) from [<c0028b10>]
(__do_kernel_fault+0x64/0x84)
[<c0028b10>] (__do_kernel_fault+0x64/0x84) from [<c0028c70>]
(do_page_fault+0x140/0x1f4)
[<c0028c70>] (do_page_fault+0x140/0x1f4) from [<c0023234>]
(do_DataAbort+0x34/0x98)
[<c0023234>] (do_DataAbort+0x34/0x98) from [<c002392c>]
(__dabt_svc+0x4c/0x60)
Exception stack(0xef82dde0 to 0xef82de28)
dde0: 5fa00000 60600000 0000003f c0314000 5fa00000 c030af34 60600000
00017fff
de00: 000000d0 c0d02000 c029ace8 c029b19c 00000000 ef82de28 c002b5e8
c010fb30
de20: 30000013 ffffffff
[<c002392c>] (__dabt_svc+0x4c/0x60) from [<c010fb30>] (copy_page+0x10/0x60)
[<c010fb30>] (copy_page+0x10/0x60) from [<c002b5e8>]
(v6_copy_user_highpage_nonaliasing+0x8c/0xec)
[<c002b5e8>] (v6_copy_user_highpage_nonaliasing+0x8c/0xec) from
[<c0028578>] (__dma_alloc+0x114/0x2e8)
[<c0028578>] (__dma_alloc+0x114/0x2e8) from [<c00287cc>]
(dma_alloc_coherent+0x54/0x60)
[<c00287cc>] (dma_alloc_coherent+0x54/0x60) from [<c0194da8>]
(msmsdcc_probe+0x534/0x1100)
[<c0194da8>] (msmsdcc_probe+0x534/0x1100) from [<c01606d0>]
(platform_drv_probe+0x18/0x1c)
[<c01606d0>] (platform_drv_probe+0x18/0x1c) from [<c015f4a0>]
(driver_probe_device+0xf8/0x184)
[<c015f4a0>] (driver_probe_device+0xf8/0x184) from [<c015f5b8>]
(__driver_attach+0x8c/0x90)
[<c015f5b8>] (__driver_attach+0x8c/0x90) from [<c015ec7c>]
(bus_for_each_dev+0x60/0x8c)
[<c015ec7c>] (bus_for_each_dev+0x60/0x8c) from [<c015e558>]
(bus_add_driver+0xa0/0x228)
[<c015e558>] (bus_add_driver+0xa0/0x228) from [<c015fb8c>]
(driver_register+0x78/0x144)
[<c015fb8c>] (driver_register+0x78/0x144) from [<c00083d0>]
(do_one_initcall+0x94/0x164)
[<c00083d0>] (do_one_initcall+0x94/0x164) from [<c0008560>]
(kernel_init+0x8c/0x278)
[<c0008560>] (kernel_init+0x8c/0x278) from [<c002467c>]
(kernel_thread_exit+0x0/0x8)
I had verified the following things from my side,
--> There is enough virtual addresses available for dma_alloc() (14MB given)
Is there any other possibility why dma_alloc() function fails???
With regards,
Sandeep Kumar Anantapalli,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130722/5585744d/attachment.html
More information about the Kernelnewbies
mailing list