|
写了一个Android GPIO驱动的时候,insmod驱动的时候CB会自动重启。
通过串口导出日志,里面这么说:Unable to handle kernel NULL pointer dereference at virtual address 0000000c 问题。
CB刷的img是:android-tv-box relaese2.2.
uname查看内核版本:3.0.52+
有谁可以帮助分析一下?
驱动代码只有最基本的加载和卸载:
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/miscdevice.h>
#include <asm/uaccess.h>
static int gpio_init(void)
{
printk("start\n");
return 0;
}
static void gpio_exit(void)
{
printk("what's wrong\n");
}
module_init(gpio_init);
module_exit(gpio_exit);
串口导出的日志如下:
[ 118.140000] led1: module license 'unspecified' taints kernel.
[ 118.140000] Disabling lock debugging due to kernel taint
[ 118.150000] Unable to handle kernel NULL pointer dereference at virtual address 0000000c
[ 118.160000] pgd = e6bd8000
[ 118.160000] [0000000c] *pgd=66bc1831, *pte=00000000, *ppte=00000000
[ 118.170000] Internal error: Oops: 17 [#1] PREEMPT
[ 118.170000] Modules linked in: led1(P+) mali ump [last unloaded: 8192cu]
[ 118.170000] CPU: 0 Tainted: P (3.0.52+ #10)
[ 118.170000] PC is at mod_sysfs_setup+0x16c/0x558
[ 118.170000] LR is at mod_sysfs_setup+0x15c/0x558
[ 118.170000] pc : [<c0094f50>] lr : [<c0094f40>] psr: a0000013
[ 118.170000] sp : e6bcbea8 ip : 00000000 fp : 00000000
[ 118.170000] r10: 00000000 r9 : bf0e619c r8 : bf0e6084
[ 118.170000] r7 : e6bcbf04 r6 : fffffff8 r5 : bf0e60c0 r4 : bf0e6078
[ 118.170000] r3 : 00000001 r2 : 00000000 r1 : 00000001 r0 : c07b72e4
[ 118.170000] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 118.170000] Control: 10c5387d Table: 66bd8019 DAC: 00000015
[ 118.170000]
[ 118.170000] PC: 0xc0094ed0:
[ 118.170000] 4ed0 1a0000d9 e5993014 e1a00004 e3530000 0a000002 e12fff33 e250b000 0a00000a
[ 118.170000] 4ef0 e1a0c009 e1a0e00a e8bc000f e8ae000f e89c0007 e88e0007 e1a0100a e1a00005
[ 118.170000] 4f10 e28aa01c eb02e8bd e1a0b000 e5969004 e2866004 e3590000 1affffe7 e25ba000
[ 118.170000] 4f30 1a0000c1 e1a09004 e59f03e4 eb136217 e5b96124 e1590006 e2466008 0a000008
[ 118.170000] 4f50 e5963014 e1a01005 e1a02008 e5930084 eb02ef0f e5966008 e1590006 e2466008
[ 118.170000] 4f70 1afffff6 e59f03a8 eb1361b5 e5973000 e1d303b0 e3500000 03a00014 03a08010
[ 118.170000] 4f90 0a000011 e3a0c000 e5973008 e1a0200c e5931008 e3110002 0a000002 e5931014
[ 118.170000] 4fb0 e3510000 128cc001 e2822001 e2833028 e1500002 8afffff5 e08c818c e28c0001
[ 118.170000]
[ 118.170000] LR: 0xc0094ec0:
[ 118.170000] 4ec0 e59f6454 e59f9454 ea000001 e35b0000 1a0000d9 e5993014 e1a00004 e3530000
[ 118.170000] 4ee0 0a000002 e12fff33 e250b000 0a00000a e1a0c009 e1a0e00a e8bc000f e8ae000f
[ 118.170000] 4f00 e89c0007 e88e0007 e1a0100a e1a00005 e28aa01c eb02e8bd e1a0b000 e5969004
[ 118.170000] 4f20 e2866004 e3590000 1affffe7 e25ba000 1a0000c1 e1a09004 e59f03e4 eb136217
[ 118.170000] 4f40 e5b96124 e1590006 e2466008 0a000008 e5963014 e1a01005 e1a02008 e5930084
[ 118.170000] 4f60 eb02ef0f e5966008 e1590006 e2466008 1afffff6 e59f03a8 eb1361b5 e5973000
[ 118.170000] 4f80 e1d303b0 e3500000 03a00014 03a08010 0a000011 e3a0c000 e5973008 e1a0200c
[ 118.170000] 4fa0 e5931008 e3110002 0a000002 e5931014 e3510000 128cc001 e2822001 e2833028
[ 118.170000]
[ 118.170000] SP: 0xe6bcbe28:
[ 118.170000] be28 e6bcbf04 e6e5f0c0 e6bca000 e6bcbe5c 00000002 c06d6358 00008124 c088b764
[ 118.170000] be48 e6e5f0c0 0000040f 00000007 fffffff8 e6bcbf04 c0038610 c07b72e4 00000001
[ 118.170000] be68 00000000 00000001 bf0e6078 bf0e60c0 fffffff8 e6bcbf04 bf0e6084 bf0e619c
[ 118.170000] be88 00000000 00000000 00000000 e6bcbea8 c0094f40 c0094f50 a0000013 ffffffff
[ 118.170000] bea8 bf0e6084 00000000 00000000 bf0e6084 00000000 bf0e6078 00000000 00000000
[ 118.170000] bec8 bf0e6078 e6bcbf04 00000000 c05733f0 bf0e6084 c0096f88 00000000 00000000
[ 118.170000] bee8 00000002 e8bd4f88 c05733f0 e6bca000 e8bd1184 e8bd1188 00005120 e8bd1000
[ 118.170000] bf08 00005120 e8bd4b78 e8bd4a6d e8bd6098 e71f9f40 0000019c 0000024c 00000000
[ 118.170000]
[ 118.170000] R0: 0xc07b7264:
[ 118.170000] 7264 0000001b 00000000 00000000 ffffb8f5 0003818c 000087a5 00000000 81cf1420
[ 118.170000] 7284 0000001b 81680351 0000001b 81682ade 0000001b f1fad58b 00000015 213678c4
[ 118.170000] 72a4 00000003 00829247 00000000 ffffb8f6 ffffb8f7 8970fb80 0000001b 00000001
[ 118.170000] 72c4 00000000 00000001 c07b72cc c07b72cc 00000400 bf0e607c bf009468 bf000000
[ 118.170000] 72e4 00000000 c07b72e8 c07b72e8 c073d188 00000124 c0094d20 00000000 c0094d6c
[ 118.170000] 7304 c00938f0 c0094b20 00000000 c07b7310 c07b7310 00000000 c07b731c c07b731c
[ 118.170000] 7324 c06d6340 00000124 c0094d08 00000000 c0094d50 c0093900 c0094b04 c06d634c
[ 118.170000] 7344 00000124 c0094cd4 00000000 00000000 00000000 00000000 c06d6358 00000124
[ 118.170000]
[ 118.170000] R7: 0xe6bcbe84:
[ 118.170000] be84 bf0e619c 00000000 00000000 00000000 e6bcbea8 c0094f40 c0094f50 a0000013
[ 118.170000] bea4 ffffffff bf0e6084 00000000 00000000 bf0e6084 00000000 bf0e6078 00000000
[ 118.170000] bec4 00000000 bf0e6078 e6bcbf04 00000000 c05733f0 bf0e6084 c0096f88 00000000
[ 118.170000] bee4 00000000 00000002 e8bd4f88 c05733f0 e6bca000 e8bd1184 e8bd1188 00005120
[ 118.170000] bf04 e8bd1000 00005120 e8bd4b78 e8bd4a6d e8bd6098 e71f9f40 0000019c 0000024c
[ 118.170000] bf24 00000000 00000000 00000019 0000001a 00000006 00000000 00000004 00000000
[ 118.170000] bf44 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001
[ 118.170000] bf64 01397008 be9b573c 00000000 00005120 c0038e68 e6bca000 00000000 00000002
[ 118.170000] Process insmod (pid: 578, stack limit = 0xe6bca2e8)
[ 118.170000] Stack: (0xe6bcbea8 to 0xe6bcc000)
[ 118.170000] bea0: bf0e6084 00000000 00000000 bf0e6084 00000000 bf0e6078
[ 118.170000] bec0: 00000000 00000000 bf0e6078 e6bcbf04 00000000 c05733f0 bf0e6084 c0096f88
[ 118.170000] bee0: 00000000 00000000 00000002 e8bd4f88 c05733f0 e6bca000 e8bd1184 e8bd1188
[ 118.170000] bf00: 00005120 e8bd1000 00005120 e8bd4b78 e8bd4a6d e8bd6098 e71f9f40 0000019c
[ 118.170000] bf20: 0000024c 00000000 00000000 00000019 0000001a 00000006 00000000 00000004
[ 118.170000] bf40: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 118.170000] bf60: 00000001 01397008 be9b573c 00000000 00005120 c0038e68 e6bca000 00000000
[ 118.170000] bf80: 00000002 c0097150 e6bca000 c00f0420 0001f6f8 0001f6f8 01397008 be9b5740
[ 118.170000] bfa0: 00000080 c0038cc0 0001f6f8 01397008 01397008 00005120 be9b573c 00000000
[ 118.170000] bfc0: 0001f6f8 01397008 be9b5740 00000080 00005120 be9b5ba4 be9b5ba8 00000002
[ 118.170000] bfe0: 0001f800 be9b56b8 0000c79b 400b02f4 a0000010 01397008 67ffe821 67ffec21
[ 118.170000] [<c0094f50>] (mod_sysfs_setup+0x16c/0x558) from [<c0096f88>] (load_module+0x128c/0x1400)
[ 118.170000] [<c0096f88>] (load_module+0x128c/0x1400) from [<c0097150>] (sys_init_module+0x54/0x19c)
[ 118.170000] [<c0097150>] (sys_init_module+0x54/0x19c) from [<c0038cc0>] (ret_fast_syscall+0x0/0x30)
[ 118.170000] Code: e5b96124 e1590006 e2466008 0a000008 (e5963014)
[ 118.720000] ---[ end trace 59c05eb66df3e810 ]---
[ 118.730000] Kernel panic - not syncing: Fatal exception
[ 118.730000] [<c003eb10>] (unwind_backtrace+0x0/0x13c) from [<c056c0f4>] (panic+0x64/0x190)
[ 118.740000] [<c056c0f4>] (panic+0x64/0x190) from [<c003cd18>] (die+0x254/0x2b8)
[ 118.750000] [<c003cd18>] (die+0x254/0x2b8) from [<c00420cc>] (__do_kernel_fault+0x64/0x84)
[ 118.750000] [<c00420cc>] (__do_kernel_fault+0x64/0x84) from [<c004226c>] (do_page_fault+0x180/0x2e0)
[ 118.760000] [<c004226c>] (do_page_fault+0x180/0x2e0) from [<c00322b4>] (do_DataAbort+0x34/0x98)
[ 118.770000] [<c00322b4>] (do_DataAbort+0x34/0x98) from [<c0038610>] (__dabt_svc+0x70/0xa0)
[ 118.780000] Exception stack(0xe6bcbe60 to 0xe6bcbea8)
[ 118.790000] be60: c07b72e4 00000001 00000000 00000001 bf0e6078 bf0e60c0 fffffff8 e6bcbf04
[ 118.790000] be80: bf0e6084 bf0e619c 00000000 00000000 00000000 e6bcbea8 c0094f40 c0094f50
[ 118.800000] bea0: a0000013 ffffffff
[ 118.810000] [<c0038610>] (__dabt_svc+0x70/0xa0) from [<c0094f50>] (mod_sysfs_setup+0x16c/0x558)
[ 118.810000] [<c0094f50>] (mod_sysfs_setup+0x16c/0x558) from [<c0096f88>] (load_module+0x128c/0x1400)
[ 118.820000] [<c0096f88>] (load_module+0x128c/0x1400) from [<c0097150>] (sys_init_module+0x54/0x19c)
[ 118.830000] [<c0097150>] (sys_init_module+0x54/0x19c) from [<c0038cc0>] (ret_fast_syscall+0x0/0x30)
[ 118.840000] Rebooting in 1 seconds
|
|