kernel crash when using build-in kernel driver

I have write a camera drvier ar0144, when using insmod load the driver, everything is ok. But using build-in kernel driver, kernel boot crash. How to fix it?

[   10.246892] Key type dns_resolver registered
[   10.251346] Unable to handle kernel read from unreadable memory at virtual address ffffff80094aec78
[   10.260313] Mem abort info:
[   10.263039]   ESR = 0x8600000f
[   10.265915]   Exception class = IABT (current EL), IL = 32 bits
[   10.272228]   SET = 0, FnV = 0
[   10.275358]   EA = 0, S1PTW = 0
[   10.278513] swapper pgtable: 4k pages, 39-bit VAs, pgd = ffffff800a1c5000
[   10.285341] [ffffff80094aec78] *pgd=000000047fffe003, *pud=000000047fffe003, *pmd=000000047fffb003, *pte=00e80000814ae713
[   10.297150] Internal error: Oops: 8600000f [#1] PREEMPT SMP
[   10.302306] Modules linked in:
[   10.306126] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.9.140-tegra #4
[   10.311936] Hardware name: Jetson-AGX (DT)
[   10.315953] task: ffffffc3ee2f8000 task.stack: ffffffc3ee294000
[   10.321829] PC is at _fw_tigon_tg3_bin_name+0x3a130/0xc1a87
[   10.327507] LR is at parse_args+0x234/0x590
[   10.331616] pc : [<ffffff80094aec78>] lr : [<ffffff80080db404>] pstate: 60800045
[   10.339052] sp : ffffffc3ee297db0
[   10.342124] x29: ffffffc3ee297db0 x28: ffffffc3ffed8114 
[   10.348849] x27: ffffff80095e9778 x26: ffffff80094aec78 
[   10.354615] x25: ffffff80095e5678 x24: 00000000000001a0 
[   10.360115] x23: ffffffc3ffed8105 x22: 0000000000000000 
[   10.365603] x21: ffffff80095e9778 x20: ffffff8008fb6dc8 
[   10.371248] x19: ffffffc3ffed8100 x18: 0000000000000010 
[   10.376907] x17: 00000000bdebb6f7 x16: 00000000123abaa3 
[   10.382599] x15: 0000000000000001 x14: ffffff808a134a82 
[   10.388100] x13: ffffff8008fe1b48 x12: 0000000000000020 
[   10.394034] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f 
[   10.399630] x9 : 6a6b61626c6c2e75 x8 : 7f7f7f7f7f7f7f7f 
[   10.405393] x7 : 64632dff736e6e71 x6 : 0000000080000000 
[   10.410916] x5 : 0000008000000000 x4 : 0000000000000072 
[   10.416252] x3 : 0000000000000000 x2 : ffffff80093997c8 
[   10.421573] x1 : ffffffc3ffed8105 x0 : ffffffc3ffed8100 
[   10.426665] 
[   10.427600] Process swapper/0 (pid: 1, stack limit = 0xffffffc3ee294000)
[   10.434071] Call trace:
[   10.436184] [<ffffff80094aec78>] _fw_tigon_tg3_bin_name+0x3a130/0xc1a87
[   10.442829] [<ffffff80095f0d00>] kernel_init_freeable+0x188/0x244
[   10.448691] [<ffffff8008f47a30>] kernel_init+0x18/0x108
[   10.453240] [<ffffff8008083850>] ret_from_fork+0x10/0x40
[   10.458584] ---[ end trace 5db9a291227bb4be ]---
[   10.468406] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[   10.468406] 
[   10.471444] SMP: stopping secondary CPUs
[   10.475124] Kernel Offset: disabled
[   10.478087] Memory Limit: none
[   10.481321] trusty-log panic notifier - trusty version Built: 13:30:33 Nov  5 2019 [   10.491803] Rebooting in 5 seconds..

cutecom2.log (81.8 KB)

I would suggest to use on coming release r32.3 release that can support LKM if you really need the loadable module.

Hi, ShaneCCC

I don’t want to use loadable module. I want to use build-in kernel driver. But I have no idea why the kernel crashed.

I would suggest to compare the driver with the reference driver and also the device tree.