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