This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

KERNEL crash when insmod cmemk.ko module

Hi,

 

I am using dm355 and  MontaVista 3.4.3-25.0.104.0600975 2006-07-06, I want to run the linux using mem=128M memory and boot it in ramboot  in the prompt i try to insmod the module, it crash the board, the log is bellow. but for nfsboot it is working fine without any problem.

( total memory I am having is 256 MB)

 

~ # insmod /opt/ipnc/cmemk.ko phys_start=0x89E00000 phys_end=0x8D600000 pools=1x
2097152,1x1658880,1x1600000,6x829440,8x61440,1x10240,20x4096,1x1843200,2x3686400
,1x5767168,1x28573696,2x691200,1x724752,2x2120
ioremap_nocache(0x89e00000, 58720256)=0xc8900000
Entring 1st Loop
Entring 2nd Loop
Unable to handle kernel NULL pointer dereference at virtual address 00000004
pgd = c635c000
[00000004] *pgd=87936031, *pte=00000000, *ppte=00000000
Internal error: Oops: 817 [#1]
Modules linked in: cmemk sbull
CPU: 0
PC is at cache_alloc_refill+0x148/0x57c
LR is at 0xc02f70ac
pc : [<c007433c>] lr : [<c02f70ac>] Not tainted
sp : c427beb0 ip : ffffffff fp : c427bee4
r10: 00195000 r9 : 00000001 r8 : c427a000
r7 : bf007528 r6 : c02f70a0 r5 : c043d840 r4 : c043f5a0
r3 : 00000000 r2 : c02f70ac r1 : c45c2018 r0 : c45c2000
Flags: Nzcv IRQs off FIQs on Mode SVC_32 Segment user
Control: 5317F Table: 8635C000 DAC: 00000015
Process insmod (pid: 829, stack limit = 0xc427a1a0)
Stack: (0xc427beb0 to 0xc427c000)
bea0: c004d170 000000d0 0000001c c043d850
bec0: 80000013 00195000 bf007528 bf00753c 00000001 00195000 c427befc c427bee8
bee0: c0073ff8 c0074204 0000001c bf007520 c427bf44 c427bf00 bf0036b4 c0073fbc
bf00: 00200000 03800000 89e00000 00000000 00000000 00000001 c427bf34 00000001
bf20: 00195000 89e00000 bf00832c 00000001 bf008524 8d600000 c427bf74 c427bf48
bf40: bf00a29c bf00362c c00296f8 bf007420 c0270070 c427a000 c0270060 00000000
bf60: c427a000 00000002 c427bfa4 c427bf78 c00688b4 bf00a010 c427bfa4 0005c52c
bf80: 00005b97 befffdd4 00000080 c00302f4 c427a000 00900071 00000000 c427bfa8
bfa0: c002fb60 c00686f4 00005b97 befffdd4 00900080 000720c0 00005b97 00072008
bfc0: 0005c52c 00005b97 befffdd4 0006f5c8 00000031 00000000 0005c7d4 00000000
bfe0: befffc50 befffc44 00010dbc 40101e60 20000010 00900080 ffffffff ffffbfff
Backtrace:
[<c00741f4>] (cache_alloc_refill+0x0/0x57c) from [<c0073ff8>] (kmem_cache_alloc+0x4c/0x54)
[<c0073fac>] (kmem_cache_alloc+0x0/0x54) from [<bf0036b4>] (alloc_pool+0x98/0x1e8 [cmemk])
r5 = BF007520 r4 = 0000001C
[<bf00361c>] (alloc_pool+0x0/0x1e8 [cmemk]) from [<bf00a29c>] (init_module+0x29c/0x498 [cmemk])
[<bf00a000>] (init_module+0x0/0x498 [cmemk]) from [<c00688b4>] (sys_init_module+0x1d0/0x3e0)
[<c00686e4>] (sys_init_module+0x0/0x3e0) from [<c002fb60>] (ret_fast_syscall+0x0/0x2c)
Code: 3affffea e5903000 e5902004 e5823000 (e5832004)
<6>note: insmod[829] exited with preempt_count 1
BUG: scheduling while atomic: insmod/0x00000001/829
caller is do_exit+0xd3c/0xda0
bad magic number for tty struct (4:65) in tty_write
bad magic number for tty struct (5:0) in tty_ioctl
bad magic number for tty struct (4:65) in tty_write
bad magic number for tty struct (4:65) in tty_write
bad magic number for tty struct (4:65) in tty_write
bad magic number for tty struct (4:65) in tty_write
bad magic number for tty struct (4:65) in tty_write
bad magic number for tty struct (4:65) in tty_ioctl
bad magic number for tty struct (4:65) in tty_write
bad magic number for tty struct (4:65) in tty_ioctl
bad magic number for tty struct (4:65) in tty_read
bad magic number for tty struct (5:0) in tty_ioctl
bad magic number for tty struct (5:0) in release_dev
bad magic number for tty struct (4:65) in release_dev
Warning: dev (ttyS1) tty->count(3) != #fd's(1) in do_tty_hangup
bad magic number for tty struct (5:1) in tty_write
bad magic number for tty struct (5:1) in tty_ioctl
bad magic number for tty struct (5:1) in tty_ioctl
bad magic number for tty struct (5:1) in tty_ioctl
bad magic number for tty struct (5:1) in tty_write
request_module: runaway loop modprobe binfmt-0000
request_module: runaway loop modprobe binfmt-0000
request_module: runaway loop modprobe binfmt-0000
request_module: runaway loop modprobe binfmt-0000
request_module: runaway loop modprobe binfmt-0000
Unable to handle kernel NULL pointer dereference at virtual address 00000004
pgd = c0004000
[00000004] *pgd=00000000
Internal error: Oops: 817 [#2]
Modules linked in: cmemk sbull
CPU: 0
PC is at free_block+0x60/0x124
LR is at drain_array_locked+0x88/0xa8
pc : [<c007495c>] lr : [<c0074aa8>] Not tainted
sp : c47c1ed0 ip : c47c1ef8 fp : c47c1ef4
r10: c02d536c r9 : c02d537c r8 : c47f94b0
r7 : 00000000 r6 : 00000004 r5 : c043bf40 r4 : c47e5000
r3 : 00000000 r2 : c043bf4c r1 : c47f94b0 r0 : c47e5d60
Flags: Nzcv IRQs off FIQs on Mode SVC_32 Segment kernel
Control: 5317F Table: 80584000 DAC: 00000017
Process events/0 (pid: 4, stack limit = 0xc47c01a0)
Stack: (0xc47c1ed0 to 0xc47c2000)
1ec0: c02cd530 00000004 c47f94a0 00000008
1ee0: c47f94b0 c043bf40 c47c1f1c c47c1ef8 c0074aa8 c007490c 00000000 00000000
1f00: c043bf40 c47c0000 c043bfb0 00000001 c47c1f54 c47c1f20 c00758b8 c0074a30
1f20: c47bb000 c044a248 c47c1f54 c02d538c c02d5388 c47c0000 00000000 c044a240
1f40: 00000000 c044a248 c47c1fc4 c47c1f58 c005e1a4 c007581c c0459f2c c007580c
1f60: ffffffff ffffffff 00000001 00000000 c004847c 00010000 00000000 c47c0000
1f80: 00000000 c042f540 c004847c 00100100 00200200 00000000 c47c1fc4 c044a240
1fa0: c47c0000 c0459f28 c005dfa0 fffffffc 00000000 00000000 c47c1ff4 c47c1fc8
1fc0: c00638c4 c005dfb0 ffffffff ffffffff 00000000 00000000 00000000 00000000
1fe0: 00000000 00000000 00000000 c47c1ff8 c004ea88 c00637ec fffffdff fffffff7
Backtrace:
[<c00748fc>] (free_block+0x0/0x124) from [<c0074aa8>] (drain_array_locked+0x88/0xa8)
r8 = C043BF40 r7 = C47F94B0 r6 = 00000008 r5 = C47F94A0
r4 = 00000004
[<c0074a20>] (drain_array_locked+0x0/0xa8) from [<c00758b8>] (cache_reap+0xac/0x248)
r8 = 00000001 r7 = C043BFB0 r6 = C47C0000 r5 = C043BF40
r4 = 00000000
[<c007580c>] (cache_reap+0x0/0x248) from [<c005e1a4>] (worker_thread+0x204/0x2c0)
[<c005dfa0>] (worker_thread+0x0/0x2c0) from [<c00638c4>] (kthread+0xe8/0x11c)
[<c00637dc>] (kthread+0x0/0x11c) from [<c004ea88>] (do_exit+0x0/0xda0)
r8 = 00000000 r7 = 00000000 r6 = 00000000 r5 = 00000000
r4 = 00000000
Code: e592401c e5942004 e5943000 e5823000 (e5832004)
<6>note: events/0[4] exited with preempt_count 1
BUG: scheduling while atomic: events/0/0x00000001/4
caller is do_exit+0xd3c/0xda0
Unable to handle kernel NULL pointer dereference at virtual address 00000015
pgd = c0004000
[00000015] *pgd=00000000
Internal error: Oops: 17 [#3]
Modules linked in: cmemk sbull
CPU: 0
PC is at sync_supers+0x30/0x120
LR is at wb_kupdate+0x50/0x138
pc : [<c008faa8>] lr : [<c007178c>] Not tainted
sp : c473df00 ip : c473df18 fp : c473df14
r10: 00000000 r9 : 00000000 r8 : c473df20
r7 : c0270744 r6 : c026d2a8 r5 : 00000001 r4 : 00000000
r3 : 00000000 r2 : c0270d64 r1 : c473c000 r0 : c473df50
Flags: nzcv IRQs on FIQs on Mode SVC_32 Segment kernel
Control: 5317F Table: 80584000 DAC: 00000017
Process pdflush (pid: 80, stack limit = 0xc473c1a0)
Stack: (0xc473df00 to 0xc473e000)
df00: c473c000 00000001 c473df84 c473df18 c007178c c008fa88 ffff93e4 c47ed7e0
df20: 00000000 00000000 c473df18 00000000 00000000 00000000 00000000 00000000
df40: 00000000 00000000 00000005 00000000 00000000 00000000 c473df84 c473df68
df60: c022db68 c473c000 00000001 c02707a0 c473df88 c026d2a8 c473dfc4 c473df88
df80: c0072618 c007174c c47ed7e0 c007173c 00000000 c473df94 c473df94 ffff9f9c
dfa0: c022db68 00000000 c473c000 c0459f68 c0072464 fffffffc c473dff4 c473dfc8
dfc0: c00638c4 c0072474 ffffffff ffffffff 00000000 00000000 00000000 00000000
dfe0: 00000000 00000000 00000000 c473dff8 c004ea88 c00637ec efffffff ffffffff
Backtrace:
[<c008fa78>] (sync_supers+0x0/0x120) from [<c007178c>] (wb_kupdate+0x50/0x138)
r5 = 00000001 r4 = C473C000
[<c007173c>] (wb_kupdate+0x0/0x138) from [<c0072618>] (pdflush+0x1b4/0x2b0)
r8 = C026D2A8 r7 = C473DF88 r6 = C02707A0 r5 = 00000001
r4 = C473C000
[<c0072464>] (pdflush+0x0/0x2b0) from [<c00638c4>] (kthread+0xe8/0x11c)
r8 = FFFFFFFC r7 = C0072464 r6 = C0459F68 r5 = C473C000
r4 = 00000000
[<c00637dc>] (kthread+0x0/0x11c) from [<c004ea88>] (do_exit+0x0/0xda0)
r8 = 00000000 r7 = 00000000 r6 = 00000000 r5 = 00000000
r4 = 00000000
Code: e59f20f4 e5924000 e1540002 0a000032 (e5d43015)
<6>note: pdflush[80] exited with preempt_count 1
BUG: scheduling while atomic: pdflush/0x00000001/80
caller is do_exit+0xd3c/0xda0

  • Hello,

    This is likely because CMEM overlaps the memory you have given to the Linux kernel. When you insmod cmem there is a physical start and stop address, you have to make sure it doesn't overlap the memory you have given to Linux to manage using the mem= kernel boot parameter.

    Regards, Niclas

  • Hi Niclas,

    I am using mem=128M in kernel parameter, hence the memory map layout is below.

    Kernel region - 0x8000'0000 to 0x87FF'FFFF
    unused - 0x8800'0000 to 0x89DF'FFFF
    Cmem - 0x89E0'0000 to 0x8D5F'FFFF
    unused - 0x8D60'0000 to 0x8FFF'FFFF

    So it is not overlapping the kernel, If the mem region overlaps the cmemk module will not get insmod

  • This was due to configuration issue at ubl level. where some DRAM parameters were missing . Once we found and corrected it started to work fine without issues.

     

    Thanks for the support.