[ 27.959314] BUG: soft lockup - CPU#0 stuck for 22s! [swapper/0:1]
[ 27.959334] Modules linked in:[ 27.962854] [
背景: 当平板接着TP芯片的时候,系统能正常启动,当系统没有挂载TP芯片,系统无法正常启动,
分析原因: 在驱动probe 的时候 使用了devm_kzalloc 申请了内存,当i2c通信检测不到TPx芯片的时候,出错调用了kfree(ts);释放了内存.return -1;但是devm_kzalloc是具有资源管理的 kzalloc()。使用资源管理(resource-managed)函数分配的内存,是会与所属设备相关联。当设备从系统中分离或者设备驱动被卸载,该内存会被自动释放,所以系统又会再次释放了这一部分的内存,造成系统跑飞了.
input_free_device(ts->input);
- kfree(ts);
+/*Use devm_kzalloc function application memory, do not need to release when err, because the system will automatically release
+so use kfree will let System error*/
+ //kfree(ts);
return rc;
解决办法: 去到kfree(ts);
2: 背景: 原来系统使用2片512M的DDR, 后面只贴一片,系统起不来
[ 18.902659] lowmem_reserve[]: 0 0 0
[ 18.902679] Normal: 585*4kB (EC) 440*8kB (UC) 265*16kB (C) 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 10100kB
[ 18.902739] 1933 total pagecache pages
[ 18.902753] 0 pages in swap cache
[ 18.902767] Swap cache stats: add 28461, delete 28461, find 473/6534
[ 18.902782] Free swap = 0kB
[ 18.902792] Total swap = 65532kB
[ 18.909241] 131072 pages of RAM
[ 18.909255] 8029 free pages
[ 18.909266] 4768 reserved pages
[ 18.909277] 1887 slab pages
[ 18.909288] 730 pages shared
[ 18.909298] 0 pages swap cached
[ 18.909310] [ pid ] uid tgid total_vm rss nr_ptes swapents oom_score_adj name
[ 18.909360] [ 108] 0 108 2197 60 6 118 -1000 ueventd
[ 18.909384] [ 124] 1036 124 4660 10 8 164 -1000 logd
[ 18.909406] [ 125] 0 125 2460 40 5 61 -1000 healthd
[ 18.909425] [ 126] 0 126 2656 0 5 84 -1000 lmkd
[ 18.909446] [ 127] 1000 127 2365 18 4 73 -1000 servicemanager
[ 18.909466] [ 128] 0 128 4744 0 8 201 -1000 vold
[ 18.909487] [ 129] 1000 129 13086 110 25 298 -1000 surfaceflinger
[ 18.909507] [ 130] 2000 130 2331 7 4 71 -1000 sh
[ 18.909527] [ 131] 0 131 4160 0 7 127 -1000 rild
[ 18.909548] [ 132] 0 132 5710 5 9 147 -1000 netd
[ 18.909569] [ 133] 0 133 2525 13 5 168 -1000 debuggerd
[ 18.909590] [ 134] 1019 134 5807 0 10 272 -1000 drmserver
[ 18.909610] [ 135] 1013 135 12474 2 19 603 -1000 mediaserver
[ 18.909631] [ 136] 1012 136 2354 0 4 64 -1000 installd
[ 18.909651] [ 137] 1017 137 3125 11 6 141 -1000 keystore
[ 18.909674] [ 141] 0 141 10367 13 20 497 -1000 zygote
[ 18.909694] [ 142] 1023 142 3852 0 6 95 -1000 sdcard
[ 18.909714] [ 201] 1003 201 108610 85 213 676 -1000 bootanimation
[ 18.909738] [ 265] 0 265 75226 2891 49 12759 -1000 main
[ 18.909756] Kernel panic - not syncing: Out of memory and no killable processes...
[ 18.909756]
[ 19.348695] CPU: 2 PID: 168 Comm: Binder_1 Not tainted 3.10.0 #4
[ 19.354630] [
[ 19.363020] [
[ 19.370643] [
[ 19.378691] [
[ 19.388277] [
[ 19.398203] [
[ 19.408043] [
[ 19.418394] [
[ 19.428318] [
[ 19.436961] [
[ 19.445010] [
[ 19.453401] [
[ 19.461620] [
[ 19.469917] CPU0: stopping
[ 19.472590] CPU: 0 PID: 129 Comm: surfaceflinger Not tainted 3.10.0 #4
[ 19.479021] [
[ 19.487409] [
[ 19.495540] [
[ 19.504012] [
[ 19.512222] Exception stack(0xdf4f9ba8 to 0xdf4f9bf0)
[ 19.517194] 9ba0: 00000002 00000001 00000002 c116ab80 c0b652a8 c11565c0
[ 19.525237] 9bc0: c11565c4 c0b64cf4 00000001 c0b5cb80 00000004 c1168540 00000002 df4f9bf0
[ 19.533277] 9be0: c00850a4 c0085084 00070113 ffffffff
[ 19.538255] [
[ 19.547326] [
[ 19.556994] [
[ 19.566662] [
[ 19.576074] [
[ 19.584206] [
[ 19.594215] [
[ 19.604908] [
[ 19.614151] [
[ 19.623819] [
[ 19.633317] [
[ 19.642729] [
[ 19.652056] [
[ 19.660784] [
[ 19.669256] [
[ 19.677380] Exception stack(0xdf4f9fb0 to 0xdf4f9ff8)
[ 19.682350] 9fa0: b6485480 b64a6440 ffffffc0 00000000
[ 19.690393] 9fc0: 00000001 b64b1800 00000000 b64854c0 b64a6440 00000004 b646f740 00000001
[ 19.698435] 9fe0: b5bfb1cc beb1afd8 b5ad143c b6f4644c 80070010 ffffffff
[ 19.704938] CPU1: stopping
[ 19.707608] CPU: 1 PID: 417 Comm: Compiler driver Not tainted 3.10.0 #4
[ 19.714122] [
[ 19.722510] [
[ 19.730641] [
[ 19.739112] [
[ 19.747321] Exception stack(0xcb5f5980 to 0xcb5f59c8)
[ 19.752294] 5980: 00000002 00000001 00000002 c116adc8 c0b652a8 c115f5c0 c115f5c4 c0b64cf4
[ 19.760337] 59a0: 00000001 c0b5cdc8 00000004 c1171540 00000001 cb5f59c8 c00850a4 c008507c
[ 19.768374] 59c0: 00070113 ffffffff
[ 19.771816] [
[ 19.780886] [
[ 19.790553] [
[ 19.800220] [
[ 19.809630] [
[ 19.817761] [
[ 19.827770] [
[ 19.838460] [
[ 19.847363] [
[ 19.856350] [
[ 19.865078] [
[ 19.873892] [
[ 19.883048] [
[ 19.891437] [
[ 19.900849] [
[ 19.910175] [
[ 19.918391] [
[ 19.926781] [
[ 19.935424] [
[ 19.944408] [
[ 19.953135] [
[ 19.961948] [
[ 19.971010] Exception stack(0xcb5f5fb0 to 0xcb5f5ff8)
[ 19.975980] 5fa0: ace2e820 ac85e480 ac85e480 b5c8c380
[ 19.984023] 5fc0: ace2e840 ace2e8d8 ace2e800 b69c2df4 ace2e830 ace2e820 00000000 ace2e8d8
[ 19.992065] 5fe0: 20000000 ace2e7f8 b6e2d213 b6e2b034 80070030 ffffffff
[ 19.998569] CPU3: stopping
[ 20.001240] CPU: 3 PID: 415 Comm: Compiler driver Not tainted 3.10.0 #4
[ 20.007754] [
[ 20.016140] [
[ 20.024271] [
[ 20.032743] [
[ 20.040951] Exception stack(0xcc1c38b0 to 0xcc1c38f8)
[ 20.045920] 38a0: 00000002 00000001 00000002 c116b2b0
[ 20.053964] 38c0: c0b652a8 c11715c0 c11715c4 c0b64cf4 00000001 c0b5d2b0 00000004 c1168540
[ 20.062006] 38e0: 00000002 cc1c38f8 c00850a4 c0085084 000d0113 ffffffff
[ 20.068517] [
[ 20.077587] [
[ 20.087255] [
[ 20.096922] [
[ 20.106332] [
[ 20.114463] [
[ 20.124472] [
[ 20.135162] [
[ 20.144063] [
[ 20.152793] [
[ 20.161349] [
[ 20.169908] [
[ 20.179832] [
[ 20.189329] [
[ 20.198058] [
[ 20.207213] [
[ 20.215603] [
[ 20.225015] [
[ 20.234340] [
[ 20.242556] [
[ 20.250944] [
[ 20.259588] [
[ 20.268572] [
[ 20.277300] [
[ 20.285772] [
[ 20.293895] Exception stack(0xcc1c3fb0 to 0xcc1c3ff8)
[ 20.298865] 3fa0: ad82d810 ad82d7f8 b4f73860 b6ed8a74
[ 20.306909] 3fc0: b4f73e9c ad82d8d8 ad82d800 b69c2df4 ad82d7f8 b503c24c 00000000 ad82d8d8
[ 20.314951] 3fe0: 00000085 ad82d798 b6e2d1eb b6ce6df0 200d0030 ffffffff
[ 20.321455] CRU:
[ 20.323273] 00000000: 0000204c 00001441 00000000 00000000
[ 20.328585] 00000010: 00002042 00001441 00000001 00000000
[ 20.333896] 00000020: 000020c8 00001446 00000000 00000000
[ 20.339207] 00000030: 00002063 00001442 00000000 00000000
[ 20.344519] 00000040: 00001111 00002100 00003113 00004307
[ 20.349831] 00000050: 00004100 00000043 00008003 00004100
[ 20.355143] 00000060: 01885091 0bb8ea60 0000401f 00002101
[ 20.360455] 00000070: 00004047 00000147 0000521f 0000021f
[ 20.365767] 00000080: 0000021f 00000200 0bb8ea60 0bb8ea60
[ 20.371078] 00000090: 0bb8ea60 01885091 00000000 00000000
[ 20.376390] 000000a0: 00000101 00001701 0000011f 00000000
[ 20.381701] 000000b0: 00000b01 00000300 00000501 00004300
[ 20.387014] 000000c0: 00002121 00002121 00000000 00002201
[ 20.392325] 000000d0: 0000a000 00004f90 000083f0 0000dfdc
[ 20.397638] 000000e0: 00000070 00000245 00000c30 0000d092
[ 20.402950] 000000f0: 000000f3 000017e0 0000fc07 00000000
[ 20.408260] 00000100: 00000000 00000000 00000000 00000000
[ 20.413571] 00000110: 00000000 00000000 00000000 00000000
[ 20.418882] 00000120: 00000000 00000000 00000000 00000000
[ 20.424193] 00000130: 00000000 00000000 00000000 00000000
[ 20.429504] 00000140: 3a981064 00000000 00000000 00000000
[ 20.434815] 00000150: 00000002 00000000 00000000 00000000
[ 20.440126] 00000160: 00000000 00000000 00000000 00000000
[ 20.445437] 00000170: 00000000 00000000 00000000 00000000
[ 20.450748] 00000180: 00000000 00000000 00000000 00000000
[ 20.456059] 00000190: 00000000 00000000 00000000 00000000
[ 20.461370] 000001a0: 00000000 00000000 00000000 00000000
[ 20.466680] 000001b0: 00000000 00000000 00000000 00000000
[ 20.471992] 000001c0: 00000004 00000000 00000004 00000000
[ 20.477302] 000001d0: 00000000 00000000 00000004 00000000
[ 20.482613] 000001e0: 00000000 00000000 00000000 00000000
[ 20.487924] 000001f0: 00005a5a 00000000 00000000 00000000
[ 20.493236] 00000200: 0000204c 00001441 00000000 00000000
[ 20.498548] 00000210: 00002042 00001441 00000001 00000000
[ 20.503858] Rebooting in 5 seconds..
原因是: 开机logo 动画占用太大内存,删除一些即可
cat proc/kmsg:
反复打印:
<6>[ 1617.919076] lowmemorykiller: Killing 'droid.bluetooth' (24895), adj 58,
<6>[ 1617.919076] to free 807280kB on behalf of 'kswapd0' (60) because
<6>[ 1617.919076] cache 44104kB is below limit 49152kB for oom_score_adj 0
<6>[ 1617.919076] Free memory is -11832kB above reserved
<6>[ 1618.233967] binder: send failed reply for transaction 240674 to 443:472
<6>[ 1622.015799] lowmemorykiller: Killing 'ericenceService' (24924), adj 294,
<6>[ 1622.015799] to free 10568kB on behalf of 'kswapd0' (60) because
<6>[ 1622.015799] cache 43408kB is below limit 49152kB for oom_score_adj 0
<6>[ 1622.015799] Free memory is -11784kB above reserved
<6>[ 1622.030044] lowmemorykiller: Killing 'droid.bluetooth' (24937), adj 58,
<6>[ 1622.030044] to free 807272kB on behalf of 'kswapd0' (60) because
<6>[ 1622.030044] cache 42668kB is below limit 49152kB for oom_score_adj 0
<6>[ 1622.030044] Free memory is -12004kB above reserved
<6>[ 1622.350287] binder: send failed reply for transaction 240923 to 443:472
<6>[ 1626.144102] lowmemorykiller: Killing 'ericenceService' (24968), adj 294,
<6>[ 1626.144102] to free 10628kB on behalf of 'kswapd0' (60) because
<6>[ 1626.144102] cache 42052kB is below limit 49152kB for oom_score_adj 0
<6>[ 1626.144102] Free memory is -11868kB above reserved
<6>[ 1626.157445] lowmemorykiller: Killing 'droid.bluetooth' (24981), adj 58,
<6>[ 1626.157445] to free 808636kB on behalf of 'kswapd0' (60) because
<6>[ 1626.157445] cache 41120kB is below limit 49152kB for oom_score_adj 0
<6>[ 1626.157445] Free memory is -11828kB above reserved
<6>[ 1626.472962] binder: send failed reply for transaction 241223 to 443:472
根据log 显示是蓝牙的问题,后面直接吧蓝牙干掉就成功了. 应该是蓝牙一只打开关闭照成