Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RK3328 kernel hang on h264 encoding #31

Closed
sueshieh opened this issue Aug 21, 2017 · 2 comments
Closed

RK3328 kernel hang on h264 encoding #31

sueshieh opened this issue Aug 21, 2017 · 2 comments

Comments

@sueshieh
Copy link

Using the updated source code:

  • kernel release-4.4 branch (03d6a38) + rockchip_linux_defconfig + rk3328-evb.dtb
  • mpp release branch (60cbbff / tag release_20170811)
  • run mpi_enc_test

rock64@rock64:~/mpp/out$ sudo ./test/mpi_enc_test -t 7 -d 255 -i ./oo.raw -o ./oo.h264 -w 960 -h 544
mpi_enc_test: cmd parse result:
mpi_enc_test: input file name: ./oo.raw
mpi_enc_test: output file name: ./oo.h264
mpi_enc_test: width : 960
mpi_enc_test: height : 544
mpi_enc_test: type : 7
mpi_enc_test: debug flag : ff
mpi_enc_test: mpi_enc_test start
mpi_enc_test: mpi_enc_test encoder test start w 960 h 544 type 7
mpi: mpp version: 60cbbff author: Herman Chen [h264e]: Fix QP stuck error
mpi: mpp_init leave ret 0
mpi: mpi_control enter ctx 0x55828d4500 cmd 320003 parm 0x55828d2138
mpi: mpi_control leave ret 0
mpi_enc_test: mpi_enc_test bps 1958400 fps 30 gop 60
mpi: mpi_control enter ctx 0x55828d4500 cmd 320005 parm 0x55828d2184
h264e_api: h264e_config MPP_ENC_SET_RC_CFG bps 1958400 [1836000 : 2080800]
mpi: mpi_control leave ret 0
mpi: mpi_control enter ctx 0x55828d4500 cmd 320007 parm 0x55828d21bc
mpi: mpi_control leave ret 0
mpi: mpi_control enter ctx 0x55828d4500 cmd 32000f parm 0x55828d2790
mpi: mpi_control leave ret 0
mpi: mpi_control enter ctx 0x55828d4500 cmd 32000e parm 0x7fc4dc6038
mpi: mpi_control leave ret 0
mpi: mpi_poll enter ctx 0x55828d4500 type 0 timeout -1
mpi: mpi_poll leave ret 0
mpi: mpi_dequeue enter ctx 0x55828d4500 type 0 task 0x7fc4dc6030
mpi: mpi_dequeue leave ret 0
mpi: mpi_enqueue enter ctx 0x55828d4500 type 0 task 0x55828d7d80
mpi: mpi_enqueue leave ret 0
mpi: mpi_poll enter ctx 0x55828d4500 type 1 timeout -1

  • Kernel log

[ 41.675708] ff340000.vepu: power on
[ 41.676326] Unhandled fault: synchronous external abort (0x96000210) at 0xffffff8008066804
[ 41.677599] Internal error: : 96000210 [#1] SMP
[ 41.678269] Modules linked in:
[ 41.678760] CPU: 1 PID: 525 Comm: mpp_enc_ctrl Not tainted 4.4.71 #3
[ 41.679682] Hardware name: Rockchip RK3328 EVB (DT)
[ 41.680403] task: ffffffc038530000 ti: ffffffc038538000 task.ti: ffffffc038538000
[ 41.681498] PC is at rk_iommu_read+0x20/0x34
[ 41.682132] LR is at rk_iommu_is_stall_active+0x44/0x64
[ 41.682893] pc : [] lr : [] pstate: 80000145
[ 41.696025] sp : ffffffc03853bb60
[ 41.708725] x29: ffffffc03853bb60 x28: ffffffc038538000
[ 41.721762] x27: ffffff8008bb2000 x26: 000000000000001d
[ 41.734521] x25: 000000000000011d x24: ffffffc0397cd030
[ 41.747008] x23: ffffffc03977ded0 x22: ffffffc03e5cac10
[ 41.759381] x21: ffffffc03e67b728 x20: ffffff8008066800
[ 41.771668] x19: 0000000000000004 x18: 00000000000a4f7c
[ 41.783931] x17: 0000007f7ab57ed0 x16: ffffff80081b6254
[ 41.795952] x15: 000000000000000a x14: ffffff8009683c20
[ 41.807699] x13: ffffff8009683c20 x12: 0000000000000000
[ 41.819401] x11: ffffff8008c0d600 x10: 0000000000000001
[ 41.830920] x9 : 0000000000000001 x8 : 00000000ffffffff
[ 41.842345] x7 : ffffffc039053480 x6 : ffffff8009683c20
[ 41.853679] x5 : 0000000000000000 x4 : 0000000000000000
[ 41.864900] x3 : 0000000000000000 x2 : ffffff80091504e8
[ 41.876019] x1 : 0000000000000004 x0 : ffffff8008066804
[ 41.886960]
[ 41.886960] PC: 0xffffff8008452098:
[ 41.907716] 2098 910103a1 aa1703e0 d63f0040 350001a0 110006d6 910103a4 2a1603e3 aa1503e2
[ 41.919268] 20b8 aa1403e1 aa1803e0 9411d621 350000e0 f94023a0 97ffffbd aa0003f3 b5fffde0
[ 41.930935] 20d8 d2800000 14000002 aa1303e0 a94153f3 a9425bf5 a94363f7 a8c97bfd d65f03c0
[ 41.942704] 20f8 a9be7bfd 910003fd a90153f3 aa0003f4 aa1e03e0 2a0103f3 d503201f 8b334280
[ 41.954434] 2118 b9400000 d5033d9f a94153f3 a8c27bfd d65f03c0 a9be7bfd 910003fd a90153f3
[ 41.966098] 2138 aa0003f3 aa1e03e0 2a0103f4 d503201f 52800000 b9401262 6b02001f 5400010a
[ 41.977798] 2158 d5033e9f f9400661 f860d822 91002042 b9000054 11000400 17fffff7 a94153f3
[ 41.989579] 2178 a8c27bfd d65f03c0 a9bd7bfd 910003fd a90153f3 f90013f5 aa0003f5 aa1e03e0
[ 42.001399]
[ 42.001399] LR: 0xffffff8008452144:
[ 42.022878] 2144 d503201f 52800000 b9401262 6b02001f 5400010a d5033e9f f9400661 f860d822
[ 42.034775] 2164 91002042 b9000054 11000400 17fffff7 a94153f3 a8c27bfd d65f03c0 a9bd7bfd
[ 42.046698] 2184 910003fd a90153f3 f90013f5 aa0003f5 aa1e03e0 52800013 52800034 d503201f
[ 42.058718] 21a4 b94012a0 6b00027f 5400012a f94006a0 52800081 f873d800 11000673 97ffffce
[ 42.070763] 21c4 d3420800 0a000294 17fffff6 2a1403e0 f94013f5 a94153f3 a8c37bfd d65f03c0
[ 42.082891] 21e4 a9bd7bfd 910003fd a90153f3 f90013f5 aa0003f5 aa1e03e0 52800013 52800034
[ 42.095013] 2204 d503201f b94012a0 6b00027f 5400010a f94006a0 52800081 f873d800 11000673
[ 42.107202] 2224 97ffffb5 0a140014 17fffff7 2a1403e0 f94013f5 a94153f3 a8c37bfd d65f03c0
[ 42.119358]
[ 42.119358] SP: 0xffffffc03853bae0:
[ 42.141329] bae0 3e5cac10 ffffffc0 3977ded0 ffffffc0 397cd030 ffffffc0 0000011d 00000000
[ 42.153484] bb00 0000001d 00000000 08bb2000 ffffff80 38538000 ffffffc0 3853bb60 ffffffc0
[ 42.165635] bb20 084521c4 ffffff80 3853bb60 ffffffc0 08452118 ffffff80 80000145 00000000
[ 42.177695] bb40 0000011d 00000000 0000001d 00000000 00000000 00000080 08b9ee78 ffffff80
[ 42.189725] bb60 3853bb80 ffffffc0 084521c4 ffffff80 00000001 00000000 00000001 00000000
[ 42.201865] bb80 3853bbb0 ffffffc0 08453538 ffffff80 3e67b728 ffffffc0 3977ded0 ffffffc0
[ 42.213882] bba0 3977ded0 ffffffc0 3977ded0 ffffffc0 3853bbe0 ffffffc0 084538d4 ffffff80
[ 42.225767] bbc0 3e67b728 ffffffc0 3977ded0 ffffffc0 3977ded0 ffffffc0 3e5cac10 ffffffc0
[ 42.233395] xhci-hcd xhci-hcd.8.auto: Cannot set link state.
[ 42.233449] usb usb5-port1: cannot disable (err = -32)
[ 42.260595]
[ 42.260595] X0: 0xffffff8008066784:
[ 42.282852] 6784
[ 42.283140] Unhandled fault: synchronous external abort (0x96000210) at 0xffffff8008066784
[ 49.306020] BUG: spinlock lockup suspected on CPU#1, mpp_enc_ctrl/525
[ 49.318172] lock: 0xffffff80090d8ca8, .magic: dead4ead, .owner: mpp_enc_ctrl/525, .owner_cpu: 1
[ 49.330854] CPU: 1 PID: 525 Comm: mpp_enc_ctrl Not tainted 4.4.71 #3
[ 49.343503] Hardware name: Rockchip RK3328 EVB (DT)
[ 49.356072] Call trace:
[ 49.368319] [] dump_backtrace+0x0/0x1b4
[ 49.381044] [] show_stack+0x24/0x30
[ 49.393759] [] dump_stack+0x94/0xb4
[ 49.406485] [] spin_dump+0x8c/0x9c
[ 49.419133] [] do_raw_spin_lock+0x104/0x158
[ 49.431955] [] _raw_spin_lock_irq+0x24/0x30
[ 49.444596] [] die+0x3c/0x1b4
[ 49.457010] [] arm64_notify_die+0x6c/0x7c
[ 49.469422] [] do_mem_abort+0x9c/0xac
[ 49.481648] Exception stack(0xffffffc03853b670 to 0xffffffc03853b7a0)
[ 49.494059] b660: ffffffc038538000 0000008000000000
[ 49.506650] b680: ffffffc03853b840 ffffff8008380c44 0000000000000007 ffffff8000000000
[ 49.519220] b6a0: ffffff8008066784 0000000000000004 ffffff80090e5000 ffffff800921b000
[ 49.531702] b6c0: 0000000000000005 0000000000000000 0000000000000000 ffffff800925e040
[ 49.543999] b6e0: 0000000000000005 0000000000000000 ffffffc03853b710 0000000000000368
[ 49.556359] b700: 0000000000000001 ffffff80090e5818 ffffffc03853b8cc ffffff8008066784
[ 49.568545] b720: 0000000000000004 ffffffc038530000 0000000000000000 ffffffc03853b8d0
[ 49.580619] b740: ffffffc03853b8cc ffffffc039052560 00000000ffffffff 0000000000000001
[ 49.592641] b760: 0000000000000001 ffffff8008c0d600 0000000000000000 ffffff8009723ea0
[ 49.604609] b780: ffffff8009723ea0 000000000000000a ffffff80081b6254 0000007f7ab57ed0
[ 49.616577] [] el1_da+0x18/0x78
[ 49.628154] [] show_data.constprop.3+0xa4/0xf4
[ 49.639783] [] __show_regs+0x158/0x198
[ 49.651190] [] die+0xb8/0x1b4
[ 49.662290] [] arm64_notify_die+0x6c/0x7c
[ 49.673576] [] do_mem_abort+0x9c/0xac
[ 49.684612] Exception stack(0xffffffc03853b990 to 0xffffffc03853bac0)
[ 49.695863] b980: 0000000000000004 0000008000000000
[ 49.707402] b9a0: ffffffc03853bb60 ffffff8008452118 0000000000000007 0000000000000000
[ 49.718842] b9c0: ffffff8008066804 ffff000100010002 ffffffc038434000 0000000000000000
[ 49.730226] b9e0: 0000024000000000 0000001000000008 0000000000000007 ffffffc0397db401
[ 49.741678] ba00: ffffffc03853ba40 ffffff80080b924c ffffff8009146450 0000000000000004
[ 49.753258] ba20: ffffffc03853ba90 000000000000000a ffffff8008066804 0000000000000004
[ 49.764829] ba40: ffffff80091504e8 0000000000000000 0000000000000000 0000000000000000
[ 49.776195] ba60: ffffff8009683c20 ffffffc039053480 00000000ffffffff 0000000000000001
[ 49.787498] ba80: 0000000000000001 ffffff8008c0d600 0000000000000000 ffffff8009683c20
[ 49.798841] baa0: ffffff8009683c20 000000000000000a ffffff80081b6254 0000007f7ab57ed0
[ 49.810376] [] el1_da+0x18/0x78
[ 49.821689] [] rk_iommu_is_stall_active+0x44/0x64
[ 49.833065] [] rk_iommu_enable_stall+0x24/0xf4
[ 49.844180] [] rk_iommu_attach_device+0x44/0x308
[ 49.855075] [] __iommu_attach_device+0x38/0xb0
[ 49.865738] [] iommu_group_do_attach_device+0x28/0x34
[ 49.876417] [] __iommu_group_for_each_dev+0x3c/0x5c
[ 49.887102] [] __iommu_attach_group+0x48/0x5c
[ 49.897652] [] iommu_attach_device+0x84/0xac
[ 49.908222] [] vpu_drm_attach+0xa0/0xf0
[ 49.918814] [] vpu_iommu_attach+0x38/0x44
[ 49.929428] [] mpp_dev_power_on+0xf8/0x128
[ 49.940038] [] rockchip_mpp_try_run+0xec/0x250
[ 49.950686] [] mpp_dev_ioctl+0x148/0x34c
[ 49.961262] [] do_vfs_ioctl+0x4d4/0x56c
[ 49.971839] [] SyS_ioctl+0x6c/0x94
[ 49.982341] [] el0_svc_naked+0x24/0x28
[ 60.146026] Watchdog detected hard LOCKUP on cpu 1
[ 60.146748] ------------[ cut here ]------------
[ 60.166562] WARNING: at kernel/watchdog.c:352
[ 60.176665] Modules linked in:
[ 60.186602]
[ 60.196239] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.71 #3
[ 60.206541] Hardware name: Rockchip RK3328 EVB (DT)
[ 60.216757] task: ffffff80090d7010 ti: ffffff80090c0000 task.ti: ffffff80090c0000
[ 60.227435] PC is at watchdog_timer_fn+0xfc/0x2e0
[ 60.237791] LR is at watchdog_timer_fn+0xfc/0x2e0
[ 60.247879] pc : [] lr : [] pstate: 600001c5
[ 60.258329] sp : ffffffc03ff5ee00
[ 60.268316] x29: ffffffc03ff5ee00 x28: 0000000000000001
[ 60.278580] x27: ffffff80090cdf10 x26: ffffff800909b1f8
[ 60.288835] x25: ffffffc03ff61210 x24: ffffff80090c3e10
[ 60.299038] x23: 0000000000000000 x22: 0000000000000034
[ 60.309248] x21: ffffff80090cc000 x20: ffffff800909b270
[ 60.319330] x19: ffffff800909b000 x18: 0000000000023a6a
[ 60.329187] x17: 0000000000000008 x16: 000000000000000e
[ 60.338962] x15: 000000000000000a x14: ffffff80097242c0
[ 60.348664] x13: ffffff80097242c0 x12: 0000000000000000
[ 60.358256] x11: ffffff8008c0d600 x10: 0000000000000001
[ 60.367614] x9 : 0000000000000001 x8 : 00000000ffffffff
[ 60.376994] x7 : ffffffc039053890 x6 : ffffff80097242c0
[ 60.386397] x5 : 0000000000000000 x4 : 0000000000000000
[ 60.395790] x3 : 00000000ffffffff x2 : ffffff80090e58b8
[ 60.405079] x1 : 0000000000000000 x0 : 0000000000000026
[ 60.414216]
[ 60.414216] PC: 0xffffff8008129d00:
[ 60.431181] 9d00 54000481 d5384100 b9401c00 f90037a4 97fffea6 2a0003e1 f0007d00 b94ea400
[ 60.440928] 9d20 6b00003f 54000362 d50339bf 90007d3b 2a0103fc 913c437b 91002283 f94037a4
[ 60.450825] 9d40 f87c7b62 38626860 34000060 3823685f 14000010 91020283 f8626b40 f8636845
[ 60.460818] 9d60 91022294 eb05001f 54000e00 f8236840 f87c7b60 3834681f 14000006 9400d533
[ 60.470926] 9d80 d4210000 f87c7b60 52800021 38346801 9107a274 913be2ba d538d081 91008280
[ 60.481102] 9da0 f8616800 97fe6b21 f9400b5b f9401b20 f9401000 d63f0000 aa0003e1 aa1b03e2
[ 60.491431] 9dc0 aa1903e0 97ff5854 b50000f6 91022694 d538d080 38606a81 34000341 38206a9f
[ 60.501861] 9de0 14000018 97fe7fb0 f9477ea1 36080941 b9400b41 34000901 531f7821 d35efc00
[ 60.512415]
[ 60.512415] LR: 0xffffff8008129d00:
[ 60.531644] 9d00 54000481 d5384100 b9401c00 f90037a4 97fffea6 2a0003e1 f0007d00 b94ea400
[ 60.542536] 9d20 6b00003f 54000362 d50339bf 90007d3b 2a0103fc 913c437b 91002283 f94037a4
[ 60.553547] 9d40 f87c7b62 38626860 34000060 3823685f 14000010 91020283 f8626b40 f8636845
[ 60.564701] 9d60 91022294 eb05001f 54000e00 f8236840 f87c7b60 3834681f 14000006 9400d533
[ 60.575997] 9d80 d4210000 f87c7b60 52800021 38346801 9107a274 913be2ba d538d081 91008280
[ 60.587441] 9da0 f8616800 97fe6b21 f9400b5b f9401b20 f9401000 d63f0000 aa0003e1 aa1b03e2
[ 60.598954] 9dc0 aa1903e0 97ff5854 b50000f6 91022694 d538d080 38606a81 34000341 38206a9f
[ 60.610573] 9de0 14000018 97fe7fb0 f9477ea1 36080941 b9400b41 34000901 531f7821 d35efc00
[ 60.622285]
[ 60.622285] SP: 0xffffffc03ff5ed80:
[ 60.643885] ed80 00000034 00000000 00000000 00000000 090c3e10 ffffff80 3ff61210 ffffffc0
[ 60.655915] eda0 0909b1f8 ffffff80 090cdf10 ffffff80 00000001 00000000 3ff5ee00 ffffffc0
[ 60.667928] edc0 08129d80 ffffff80 3ff5ee00 ffffffc0 08129d80 ffffff80 600001c5 00000000
[ 60.679857] ede0 090ccef8 ffffff80 0000000a 00000000 00000000 00000080 3e800028 ffffffc0
[ 60.691726] ee00 3ff5ee70 ffffffc0 08100758 ffffff80 3ff61210 ffffffc0 3ff60bc0 ffffffc0
[ 60.703788] ee20 3ff60c40 ffffffc0 00000003 00000000 0920b470 ffffff80 090cbe88 ffffff80
[ 60.715713] ee40 08129c84 ffffff80 fbad22f0 0000000d 3ff60d28 ffffffc0 090c0000 ffffff80
[ 60.727551] ee60 3ff61210 ffffffc0 090ccef8 ffffff80 3ff5eee0 ffffffc0 08100d8c ffffff80
[ 60.739471]
[ 60.739471] X2: 0xffffff80090e5838:
[ 60.761475] 5838 008d008d dead4ead ffffffff 00000000 ffffffff ffffffff 38f3a978 ffffffc0
[ 60.773786] 5858 38f3a978 ffffffc0 00000001 00000000 00000000 dead4ead ffffffff 00000000
[ 60.786235] 5878 ffffffff ffffffff 090e5880 ffffff80 090e5880 ffffff80 00040000 00000000
[ 60.798777] 5898 0ea50ea5 dead4ead ffffffff 00000000 ffffffff ffffffff 00000001 00000000
[ 60.811461] 58b8 090e58b8 ffffff80 090e58b8 ffffff80 00000000 dead4ead ffffffff 00000000
[ 60.824329] 58d8 ffffffff ffffffff 00001388 0000000a 00000000 00000000 00000000 00000000
[ 60.837254] 58f8 00000000 00000000 0000000f 00000004 00000001 00000007 00000001 ffffffff
[ 60.850310] 5918 ffffffff 00000000 080ec464 ffffff80 090dfc50 ffffff80 00000000 00000000
[ 60.863474]
[ 60.863474] X6: 0xffffff8009724240:
[ 60.887863] 4240 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 60.901350] 4260 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 60.914719] 4280 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 60.927934] 42a0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 60.941067] 42c0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 60.953879] 42e0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 60.966420] 4300 00000000 00000000 00000000 00000000 00aaaaaa 00000000 00000000 00000000
[ 60.978731] 4320 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 60.990814]
[ 60.990814] X7: 0xffffffc039053810:
[ 61.012650] 3810 c6c6c6c6 00c6c6c6 c6c6c6c6 78c6c6c6 d6d6d6d6 00000000 00000000 00000000
[ 61.024650] 3830 fcc6fcc6 fcc6fcc6 c6c0c6c0 c6c0c6c0 c6c0c6c0 c6c0c6c0 c6c0c6c0 c6c0c6c0
[ 61.036587] 3850 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.048479] 3870 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.060278] 3890 00000000 00000000 00000000 00000000 00000000 6cc6387c c606c606 d606d63c
[ 61.071872] 38b0 c606c606 387c6cc6 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.083380] 38d0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.094684] 38f0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.105724]
[ 61.105724] X11: 0xffffff8008c0d580:
[ 61.125482] d580 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.136440] d5a0 00000000 00000000 00000000 00000000 00000000 ff000000 00ff0000 ffff0000
[ 61.147144] d5c0 0000ff00 ff00ff00 00ffff00 ffffff00 000000ff ff0000ff 00ff00ff ffff00ff
[ 61.157679] d5e0 0000ffff ff00ffff 00ffffff ffffffff 00000000 ffff0000 0000ffff ffffffff
[ 61.168238] d600 00000000 ffffffff 00000000 ff000000 00ff0000 ffff0000 0000ff00 ff00ff00
[ 61.178633] d620 00ffff00 ffffff00 000000ff ff0000ff 00ff00ff ffff00ff 0000ffff ff00ffff
[ 61.188904] d640 00ffffff ffffffff 00000000 ffff0000 0000ffff ffffffff 00000000 ffffffff
[ 61.199081] d660 00000000 00000000 00000000 00000000 08500e48 ffffff80 08501208 ffffff80
[ 61.209205]
[ 61.209205] X13: 0xffffff8009724240:
[ 61.227375] 4240 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.237679] 4260 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.247822] 4280 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.257641] 42a0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.267375] 42c0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.276811] 42e0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.285977] 4300 00000000 00000000 00000000 00000000 00aaaaaa 00000000 00000000 00000000
[ 61.294955] 4320 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.303775]
[ 61.303775] X14: 0xffffff8009724240:
[ 61.319176] 4240 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.328070] 4260 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.336736] 4280 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.345109] 42a0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.353408] 42c0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.361384] 42e0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.369334] 4300 00000000 00000000 00000000 00000000 00aaaaaa 00000000 00000000 00000000
[ 61.377317] 4320 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.385347]
[ 61.385347] X19: 0xffffff800909af80:
[ 61.399852] af80 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.408559] afa0 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.417201] afc0 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.425557] afe0 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.433812] b000 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.441773] b020 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.449532] b040 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.457023] b060 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.464525]
[ 61.464525] X20: 0xffffff800909b1f0:
[ 61.477616] b1f0 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.485475] b210 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.493351] b230 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.500897] b250 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.508341] b270 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.515497] b290 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.522590] b2b0 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.529577] b2d0 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.536466]
[ 61.536466] X21: 0xffffff80090cbf80:
[ 61.548339] bf80 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.555564] bfa0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.562628] bfc0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.569376] bfe0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.576040] c000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.582398] c020 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.588773] c040 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.595132] c060 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.601504]
[ 61.601504] X24: 0xffffff80090c3d90:
[ 61.612749] 3d90 090c3db0 ffffff80 080cdb00 ffffff80 3ff652c8 ffffffc0 3ff652c8 ffffffc0
[ 61.619815] 3db0 090c3e30 ffffff80 080d7da0 ffffff80 3ff65240 ffffffc0 003a4ce0 ffffffc0
[ 61.626920] 3dd0 090c0000 ffffff80 00000000 00000000 00000000 00000000 090e6140 ffffff80
[ 61.633895] 3df0 00000000 01000000 57d60bc3 00000000 00008cae 00000000 00000000 00000000
[ 61.640935] 3e10 00000140 00000000 00000000 00000000 00000000 00000000 090e6140 ffffff80
[ 61.647814] 3e30 00000000 01000000 57d60bc3 00000000 00008cae 00000000 00000000 00000000
[ 61.654813] 3e50 090c3f1c ffffff80 090c0000 ffffff80 00000900 00000000 00000400 00000000
[ 61.661955] 3e70 00000144 00000000 00000004 00000000 00000001 00000000 00000007 00000000
[ 61.669263]
[ 61.669263] X25: 0xffffffc03ff61190:
[ 61.682350] 1190 ffffffff 00000000 ffffffff ffffffff 00000001 00000000 3ff611a8 ffffffc0
[ 61.690327] 11b0 3ff611a8 ffffffc0 3ff611b8 ffffffc0 3ff611b8 ffffffc0 08128888 ffffff80
[ 61.698467] 11d0 002ffcf8 ffffffc0 002ffc50 ffffffc0 00020002 00000000 00000034 00000000
[ 61.706518] 11f0 00000000 00000000 0000000f 00000000 0000000e 00000000 003a72c0 ffffffc0
[ 61.714699] 1210 3ff61210 ffffffc0 3ff61080 ffffffc0 00000000 00000000 fbad1840 0000000d
[ 61.722772] 1230 fbad1840 0000000d 08129c84 ffffff80 3ff60c40 ffffffc0 00000000 0000000a
[ 61.731061] 1250 08129c54 ffffff80 63746177 676f6468 0000302f 00000000 0000000f 00000000
[ 61.739538] 1270 00000000 00000000 00000000 00000000 00000000 00000000 00000001 00000000
[ 61.748212]
[ 61.748212] X26: 0xffffff800909b178:
[ 61.764037] b178 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.773437] b198 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.782825] b1b8 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.791879] b1d8 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.800875] b1f8 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.809532] b218 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.818175] b238 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.826828] b258 ******** ******** ******** ******** ******** ******** ******** ********
[ 61.835481]
[ 61.835481] X27: 0xffffff80090cde90:
[ 61.851286] de90 00000001 00000000 00000001 00000000 000003e8 00000000 3ffaf500 ffffffc0
[ 61.860652] deb0 00000015 00000000 3ffaf4c0 ffffffc0 00000001 00000000 00000060 00000000
[ 61.870187] ded0 00015000 00001000 00000001 00000000 3ffaf540 ffffffc0 3ffb1700 ffffffc0
[ 61.879651] def0 00000004 00000000 00000003 00000010 3ffaf3c0 ffffffc0 3ff5b000 ffffffc0
[ 61.889097] df10 36ec6000 00000040 36edb000 00000040 36ef0000 00000040 36f05000 00000040
[ 61.898417] df30 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.907828] df50 00000002 00000000 00003217 00000000 00010000 00000000 0003ffff 00000000
[ 61.917313] df70 00007233 00000000 00002000 00000000 00000000 0000fffa 00000000 00000000
[ 61.926894]
[ 61.926894] X29: 0xffffffc03ff5ed80:
[ 61.944532] ed80 00000034 00000000 00000000 00000000 090c3e10 ffffff80 3ff61210 ffffffc0
[ 61.954831] eda0 0909b1f8 ffffff80 090cdf10 ffffff80 00000001 00000000 3ff5ee00 ffffffc0
[ 61.965334] edc0 08129d80 ffffff80 3ff5ee00 ffffffc0 08129d80 ffffff80 600001c5 00000000
[ 61.975692] ede0 090ccef8 ffffff80 0000000a 00000000 00000000 00000080 3e800028 ffffffc0
[ 61.986229] ee00 3ff5ee70 ffffffc0 08100758 ffffff80 3ff61210 ffffffc0 3ff60bc0 ffffffc0
[ 61.996646] ee20 3ff60c40 ffffffc0 00000003 00000000 0920b470 ffffff80 090cbe88 ffffff80
[ 62.007142] ee40 08129c84 ffffff80 fbad22f0 0000000d 3ff60d28 ffffffc0 090c0000 ffffff80
[ 62.017609] ee60 3ff61210 ffffffc0 090ccef8 ffffff80 3ff5eee0 ffffffc0 08100d8c ffffff80
[ 62.028104]
[ 62.037541] ---[ end trace bc6b2d37aa9b4068 ]---
[ 62.047435] Call trace:
[ 62.057022] Exception stack(0xffffffc03ff5ec30 to 0xffffffc03ff5ed60)
[ 62.067271] ec20: ffffff800909b000 0000008000000000
[ 62.077684] ec40: ffffffc03ff5ee00 ffffff8008129d80 0000000000000000 ffffff800925e040
[ 62.088270] ec60: 0000000000000026 0000000000000000 ffffffc03ff5ec90 00000000000003a5
[ 62.098827] ec80: 0000000000000000 ffffff80090e5818 ffffffc03ff5ed20 ffffff80080ebdf8
[ 62.109316] eca0: ffffffc03ff5ed80 ffffff8008e34fe5 ffffff80090cc000 0000000000000034
[ 62.119812] ecc0: 0000000000000000 ffffff80090c3e10 0000000000000026 0000000000000000
[ 62.130272] ece0: ffffff80090e58b8 00000000ffffffff 0000000000000000 0000000000000000
[ 62.140659] ed00: ffffff80097242c0 ffffffc039053890 00000000ffffffff 0000000000000001
[ 62.150974] ed20: 0000000000000001 ffffff8008c0d600 0000000000000000 ffffff80097242c0
[ 62.161263] ed40: ffffff80097242c0 000000000000000a 000000000000000e 0000000000000008
[ 62.171601] [] watchdog_timer_fn+0xfc/0x2e0
[ 62.181632] [] __hrtimer_run_queues+0x15c/0x280
[ 62.191791] [] hrtimer_interrupt+0xac/0x1bc
[ 62.201729] [] arch_timer_handler_phys+0x3c/0x4c
[ 62.211908] [] handle_percpu_devid_irq+0xc4/0x170
[ 62.222234] [] generic_handle_irq+0x2c/0x44
[ 62.232649] [] __handle_domain_irq+0x90/0xb8
[ 62.243218] [] gic_handle_irq+0x78/0xc8
[ 62.253857] Exception stack(0xffffff80090c3e10 to 0xffffff80090c3f40)
[ 62.264892] 3e00: 0000000000000140 0000000000000000
[ 62.276417] 3e20: 0000000000000000 ffffff80090e6140 0100000000000000 0000000057d60bc3
[ 62.287825] 3e40: 0000000000008cae 0000000000000000 ffffff80090c3f1c ffffff80090c0000
[ 62.299370] 3e60: 0000000000000900 0000000000000400 0000000000000144 0000000000000004
[ 62.310742] 3e80: 0000000000000001 0000000000000007 000000000000000e 0000000000000008
[ 62.322002] 3ea0: 000000001ed3e33c 0000000000000000 0000000000000000 ffffff80090c0000
[ 62.333127] 3ec0: ffffff80090cb000 ffffff80090cbe18 ffffff8009004b38 00000000032d5000
[ 62.344441] 3ee0: 00000000032d8000 0000000002ba01f0 0000000002fb001c ffffff80090c3f40
[ 62.355815] 3f00: ffffff80080df29c ffffff80090c3f40 ffffff80080df30c 0000000060000145
[ 62.367338] 3f20: ffffff80090c0000 ffffff80090cb000 ffffffffffffffff ffffff80080df29c
[ 62.378957] [] el1_irq+0xb4/0x140
[ 62.390389] [] cpu_startup_entry+0x23c/0x2b8
[ 62.401705] [] rest_init+0x78/0x80
[ 62.412975] [] start_kernel+0x3d0/0x3e4
[ 62.424114] [] __primary_switched+0x30/0x6c

@yanghanxing
Copy link
Contributor

have fixed:
db41eea

@dalmatele
Copy link

Now I see this log from kernel:
mpp_dev_ioctl:545: unknown mpp ioctl cmd 40086c03

liuqsqq pushed a commit to liuqsqq/kernel-rokchip that referenced this issue Jan 20, 2018
dead lock :
IN --> drm_fb_helper_restore_fbdev_mode_unlocked
        1. Acquire mode_config lock
IN --> atomic commit
IN --> rockchip_atomic_commit_complete
IN --> drm_atomic_helper_commit_modeset_disables
IN --> bridge disable
IN --> analogix_dp_irq_thread
IN --> drm_helper_hpd_irq_event
	3. Acquire mode_config lock (have been acquired)

[  363.054554] INFO: task irq/54-analogix:174 blocked for more than 120 seconds.
[  363.054612]       Not tainted 4.4.55 rockchip-linux#31
[  363.054631] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  363.054651] irq/54-analogix D ffffff8008084f98     0   174      2 0x00000000
[  363.054691] Call trace:
[  363.054726] [<ffffff8008084f98>] __switch_to+0xb4/0xc0
[  363.054759] [<ffffff8008b21308>] __schedule+0x3f0/0x670
[  363.054785] [<ffffff8008b2160c>] schedule+0x84/0xa4
[  363.054813] [<ffffff8008b21954>] schedule_preempt_disabled+0x20/0x38
[  363.054842] [<ffffff8008b23084>] __mutex_lock_slowpath+0xfc/0x178
[  363.054869] [<ffffff8008b2312c>] mutex_lock+0x2c/0x44
[  363.054897] [<ffffff800844419c>] drm_helper_hpd_irq_event+0x34/0x154
[  363.054929] [<ffffff800848e578>] analogix_dp_irq_thread+0x30/0x58
[  363.054957] [<ffffff80080eb198>] irq_thread_fn+0x28/0x68
[  363.054991] [<ffffff80080eb3ac>] irq_thread+0x10c/0x1ec
[  363.055016] [<ffffff80080b7e58>] kthread+0xe8/0xf0
[  363.055042] [<ffffff8008082690>] ret_from_fork+0x10/0x40
[  363.055097] INFO: task surfaceflinger:240 blocked for more than 120 seconds.
[  363.055119]       Not tainted 4.4.55 rockchip-linux#31
[  363.055136] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  363.055155] surfaceflinger  D ffffff8008084f98     0   240      1 0x00000009
[  363.055191] Call trace:
[  363.055214] [<ffffff8008084f98>] __switch_to+0xb4/0xc0
[  363.055241] [<ffffff8008b21308>] __schedule+0x3f0/0x670
[  363.055268] [<ffffff8008b2160c>] schedule+0x84/0xa4
[  363.055292] [<ffffff80080ea61c>] synchronize_irq+0x64/0x98
[  363.055316] [<ffffff80080eb9d8>] disable_irq+0x20/0x2c
[  363.055344] [<ffffff800848e224>] analogix_dp_bridge_disable+0x70/0xa8
[  363.055370] [<ffffff800846fabc>] drm_bridge_disable+0x2c/0x38
[  363.055403] [<ffffff800844b930>] drm_atomic_helper_commit_modeset_disables+0x120/0x39c
[  363.055432] [<ffffff800847e018>] rockchip_atomic_commit_complete+0x30/0x14c
[  363.055459] [<ffffff800847e1b0>] rockchip_drm_atomic_commit+0x7c/0x9c
[  363.055484] [<ffffff800846e898>] drm_atomic_commit+0x64/0x70
[  363.055511] [<ffffff800844ae28>] drm_atomic_helper_connector_dpms+0xf4/0x154
[  363.055541] [<ffffff800846398c>] drm_mode_obj_set_property_ioctl+0x148/0x204
[  363.055575] [<ffffff8008463a88>] drm_mode_connector_property_set_ioctl+0x40/0x60
[  363.055602] [<ffffff80084541a8>] drm_ioctl+0x27c/0x400
[  363.055630] [<ffffff80081ba1d4>] do_vfs_ioctl+0x4d0/0x5c0
[  363.055655] [<ffffff80081ba324>] SyS_ioctl+0x60/0x88
[  363.055680] [<ffffff80080826f0>] el0_svc_naked+0x24/0x28

Change-Id: I6d5eeb83b9640a54b33b1cad03c2207196a56e16
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
wzyy2 pushed a commit that referenced this issue Jan 30, 2018
This resolves a crash if loaded under qemu + haxm under windows.
See https://www.spinics.net/lists/kernel/msg2689835.html for details.
Here is a boot log (the log is from chromeos-4.4, but Tao Wu says that
the same log is also seen with vanilla v4.4.110-rc1).

[    0.712750] Freeing unused kernel memory: 552K
[    0.721821] init: Corrupted page table at address 57b029b332e0
[    0.722761] PGD 80000000bb238067 PUD bc36a067 PMD bc369067 PTE 45d2067
[    0.722761] Bad pagetable: 000b [#1] PREEMPT SMP 
[    0.722761] Modules linked in:
[    0.722761] CPU: 1 PID: 1 Comm: init Not tainted 4.4.96 #31
[    0.722761] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.7.5.1-0-g8936dbb-20141113_115728-nilsson.home.kraxel.org 04/01/2014
[    0.722761] task: ffff8800bc290000 ti: ffff8800bc28c000 task.ti: ffff8800bc28c000
[    0.722761] RIP: 0010:[<ffffffff83f4129e>]  [<ffffffff83f4129e>] __clear_user+0x42/0x67
[    0.722761] RSP: 0000:ffff8800bc28fcf8  EFLAGS: 00010202
[    0.722761] RAX: 0000000000000000 RBX: 00000000000001a4 RCX: 00000000000001a4
[    0.722761] RDX: 0000000000000000 RSI: 0000000000000008 RDI: 000057b029b332e0
[    0.722761] RBP: ffff8800bc28fd08 R08: ffff8800bc290000 R09: ffff8800bb2f4000
[    0.722761] R10: ffff8800bc290000 R11: ffff8800bb2f4000 R12: 000057b029b332e0
[    0.722761] R13: 0000000000000000 R14: 000057b029b33340 R15: ffff8800bb1e2a00
[    0.722761] FS:  0000000000000000(0000) GS:ffff8800bfb00000(0000) knlGS:0000000000000000
[    0.722761] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[    0.722761] CR2: 000057b029b332e0 CR3: 00000000bb2f8000 CR4: 00000000000006e0
[    0.722761] Stack:
[    0.722761]  000057b029b332e0 ffff8800bb95fa80 ffff8800bc28fd18 ffffffff83f4120c
[    0.722761]  ffff8800bc28fe18 ffffffff83e9e7a1 ffff8800bc28fd68 0000000000000000
[    0.722761]  ffff8800bc290000 ffff8800bc290000 ffff8800bc290000 ffff8800bc290000
[    0.722761] Call Trace:
[    0.722761]  [<ffffffff83f4120c>] clear_user+0x2e/0x30
[    0.722761]  [<ffffffff83e9e7a1>] load_elf_binary+0xa7f/0x18f7
[    0.722761]  [<ffffffff83de2088>] search_binary_handler+0x86/0x19c
[    0.722761]  [<ffffffff83de389e>] do_execveat_common.isra.26+0x909/0xf98
[    0.722761]  [<ffffffff844febe0>] ? rest_init+0x87/0x87
[    0.722761]  [<ffffffff83de40be>] do_execve+0x23/0x25
[    0.722761]  [<ffffffff83c002e3>] run_init_process+0x2b/0x2d
[    0.722761]  [<ffffffff844fec4d>] kernel_init+0x6d/0xda
[    0.722761]  [<ffffffff84505b2f>] ret_from_fork+0x3f/0x70
[    0.722761]  [<ffffffff844febe0>] ? rest_init+0x87/0x87
[    0.722761] Code: 86 84 be 12 00 00 00 e8 87 0d e8 ff 66 66 90 48 89 d8 48 c1
eb 03 4c 89 e7 83 e0 07 48 89 d9 be 08 00 00 00 31 d2 48 85 c9 74 0a <48> 89 17
48 01 f7 ff c9 75 f6 48 89 c1 85 c9 74 09 88 17 48 ff 
[    0.722761] RIP  [<ffffffff83f4129e>] __clear_user+0x42/0x67
[    0.722761]  RSP <ffff8800bc28fcf8>
[    0.722761] ---[ end trace def703879b4ff090 ]---
[    0.722761] BUG: sleeping function called from invalid context at /mnt/host/source/src/third_party/kernel/v4.4/kernel/locking/rwsem.c:21
[    0.722761] in_atomic(): 0, irqs_disabled(): 1, pid: 1, name: init
[    0.722761] CPU: 1 PID: 1 Comm: init Tainted: G      D         4.4.96 #31
[    0.722761] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5.1-0-g8936dbb-20141113_115728-nilsson.home.kraxel.org 04/01/2014
[    0.722761]  0000000000000086 dcb5d76098c89836 ffff8800bc28fa30 ffffffff83f34004
[    0.722761]  ffffffff84839dc2 0000000000000015 ffff8800bc28fa40 ffffffff83d57dc9
[    0.722761]  ffff8800bc28fa68 ffffffff83d57e6a ffffffff84a53640 0000000000000000
[    0.722761] Call Trace:
[    0.722761]  [<ffffffff83f34004>] dump_stack+0x4d/0x63
[    0.722761]  [<ffffffff83d57dc9>] ___might_sleep+0x13a/0x13c
[    0.722761]  [<ffffffff83d57e6a>] __might_sleep+0x9f/0xa6
[    0.722761]  [<ffffffff84502788>] down_read+0x20/0x31
[    0.722761]  [<ffffffff83cc5d9b>] __blocking_notifier_call_chain+0x35/0x63
[    0.722761]  [<ffffffff83cc5ddd>] blocking_notifier_call_chain+0x14/0x16
[    0.800374] usb 1-1: new full-speed USB device number 2 using uhci_hcd
[    0.722761]  [<ffffffff83cefe97>] profile_task_exit+0x1a/0x1c
[    0.802309]  [<ffffffff83cac84e>] do_exit+0x39/0xe7f
[    0.802309]  [<ffffffff83ce5938>] ? vprintk_default+0x1d/0x1f
[    0.802309]  [<ffffffff83d7bb95>] ? printk+0x57/0x73
[    0.802309]  [<ffffffff83c46e25>] oops_end+0x80/0x85
[    0.802309]  [<ffffffff83c7b747>] pgtable_bad+0x8a/0x95
[    0.802309]  [<ffffffff83ca7f4a>] __do_page_fault+0x8c/0x352
[    0.802309]  [<ffffffff83eefba5>] ? file_has_perm+0xc4/0xe5
[    0.802309]  [<ffffffff83ca821c>] do_page_fault+0xc/0xe
[    0.802309]  [<ffffffff84507682>] page_fault+0x22/0x30
[    0.802309]  [<ffffffff83f4129e>] ? __clear_user+0x42/0x67
[    0.802309]  [<ffffffff83f4127f>] ? __clear_user+0x23/0x67
[    0.802309]  [<ffffffff83f4120c>] clear_user+0x2e/0x30
[    0.802309]  [<ffffffff83e9e7a1>] load_elf_binary+0xa7f/0x18f7
[    0.802309]  [<ffffffff83de2088>] search_binary_handler+0x86/0x19c
[    0.802309]  [<ffffffff83de389e>] do_execveat_common.isra.26+0x909/0xf98
[    0.802309]  [<ffffffff844febe0>] ? rest_init+0x87/0x87
[    0.802309]  [<ffffffff83de40be>] do_execve+0x23/0x25
[    0.802309]  [<ffffffff83c002e3>] run_init_process+0x2b/0x2d
[    0.802309]  [<ffffffff844fec4d>] kernel_init+0x6d/0xda
[    0.802309]  [<ffffffff84505b2f>] ret_from_fork+0x3f/0x70
[    0.802309]  [<ffffffff844febe0>] ? rest_init+0x87/0x87
[    0.830559] Kernel panic - not syncing: Attempted to kill init!  exitcode=0x00000009
[    0.830559] 
[    0.831305] Kernel Offset: 0x2c00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[    0.831305] ---[ end Kernel panic - not syncing: Attempted to kill init!  exitcode=0x00000009

The crash part of this problem may be solved with the following patch
(thanks to Hugh for the hint). There is still another problem, though -
with this patch applied, the qemu session aborts with "VCPU Shutdown
request", whatever that means.

Cc: lepton <ytht.net@gmail.com>
Signed-off-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
0lvin pushed a commit to free-z4u/roc-rk3328-cc-official that referenced this issue Jun 2, 2019
It is found thats UFS device may take longer than 30ms to respond to
query requests and in this case we might run into following scenario:

1. UFS host SW sends a query request to UFS device to read an attribute
   value. SW uses tag rockchip-linux#31 for this purpose.
2. UFS host SW waits for 30ms to get the query response (and doorbell
   to be cleared by UFS host HW).
3. UFS device doesn't respond back within 30ms hence UFS host SW times
   out waiting for the query response.
4. UFS host SW clears the tag#31 from UTRLCLR register.
5. UFS host SW waits until UFS host HW to clear tag#31 from the doorbell
   register.
6. UFS host SW retries the same query request on same tag#31 (sends a query
   request to device to read an attribute value).
7. UFS host HW gets the query response from the device but this was
   intended as a query response for the 1st query request sent (step-1).
8. Now UFS device sends another query response to host (for query request
   sent @step-6).

Now there are 2 issues that could happen with above scenario:
1. UFS device should have actually responded back with only one query
   response but it is found that device may respond back with 2 query
   responses.
2. If UFS device responds back with 2 resposes on same tag, host HW/SW
   behaviour isn't predictable.

To avoid running into above scenario, we would basically allow device
to take longer (upto 1.5 seconds) for query response.

Reviewed-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
0lvin pushed a commit to free-z4u/roc-rk3328-cc-official that referenced this issue Sep 29, 2019
[ Upstream commit 33d4a5a ]

Setting invalid value to /sys/devices/system/cpu/cpuX/hotplug/fail
can control `struct cpuhp_step *sp` address, results in the following
global-out-of-bounds read.

Reproducer:

  # echo -2 > /sys/devices/system/cpu/cpu0/hotplug/fail

KASAN report:

  BUG: KASAN: global-out-of-bounds in write_cpuhp_fail+0x2cd/0x2e0
  Read of size 8 at addr ffffffff89734438 by task bash/1941

  CPU: 0 PID: 1941 Comm: bash Not tainted 5.2.0-rc6+ rockchip-linux#31
  Call Trace:
   write_cpuhp_fail+0x2cd/0x2e0
   dev_attr_store+0x58/0x80
   sysfs_kf_write+0x13d/0x1a0
   kernfs_fop_write+0x2bc/0x460
   vfs_write+0x1e1/0x560
   ksys_write+0x126/0x250
   do_syscall_64+0xc1/0x390
   entry_SYSCALL_64_after_hwframe+0x49/0xbe
  RIP: 0033:0x7f05e4f4c970

  The buggy address belongs to the variable:
   cpu_hotplug_lock+0x98/0xa0

  Memory state around the buggy address:
   ffffffff89734300: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
   ffffffff89734380: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
  >ffffffff89734400: 00 00 00 00 fa fa fa fa 00 00 00 00 fa fa fa fa
                                          ^
   ffffffff89734480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   ffffffff89734500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Add a sanity check for the value written from user space.

Fixes: 1db4948 ("smp/hotplug: Hotplug state fail injection")
Signed-off-by: Eiichi Tsukata <devel@etsukata.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: peterz@infradead.org
Link: https://lkml.kernel.org/r/20190627024732.31672-1-devel@etsukata.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
fanck0605 pushed a commit to fanck0605/friendlywrt-kernel that referenced this issue Apr 30, 2020
commit e5b72e3 upstream.

Due to some hardware issues, queue 31 isn't usable on devices that have
32 queues (7000, 8000, 9000 families), which is correctly reflected in
the configuration and TX queue initialization.

However, the firmware API and queue allocation code assumes that there
are 32 queues, and if something actually attempts to use rockchip-linux#31 this leads
to a NULL-pointer dereference since it's not allocated.

Fix this by limiting to 31 in the IWL_MVM_DQA_MAX_DATA_QUEUE, and also
add some code to catch this earlier in the future, if the configuration
changes perhaps.

Cc: stable@vger.kernel.org # v4.9+
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20200417100405.98a79be2db6a.I3a4af6b03b87a6bc18db9b1ff9a812f397bee1fc@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
rkchrome pushed a commit that referenced this issue Oct 10, 2020
[ Upstream commit 96298f6 ]

According to Core Spec Version 5.2 | Vol 3, Part A 6.1.5,
the incoming L2CAP_ConfigReq should be handled during
OPEN state.

The section below shows the btmon trace when running
L2CAP/COS/CFD/BV-12-C before and after this change.

=== Before ===
...
> ACL Data RX: Handle 256 flags 0x02 dlen 12                #22
      L2CAP: Connection Request (0x02) ident 2 len 4
        PSM: 1 (0x0001)
        Source CID: 65
< ACL Data TX: Handle 256 flags 0x00 dlen 16                #23
      L2CAP: Connection Response (0x03) ident 2 len 8
        Destination CID: 64
        Source CID: 65
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000)
< ACL Data TX: Handle 256 flags 0x00 dlen 12                #24
      L2CAP: Configure Request (0x04) ident 2 len 4
        Destination CID: 65
        Flags: 0x0000
> HCI Event: Number of Completed Packets (0x13) plen 5      #25
        Num handles: 1
        Handle: 256
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5      #26
        Num handles: 1
        Handle: 256
        Count: 1
> ACL Data RX: Handle 256 flags 0x02 dlen 16                #27
      L2CAP: Configure Request (0x04) ident 3 len 8
        Destination CID: 64
        Flags: 0x0000
        Option: Unknown (0x10) [hint]
        01 00                                            ..
< ACL Data TX: Handle 256 flags 0x00 dlen 18                #28
      L2CAP: Configure Response (0x05) ident 3 len 10
        Source CID: 65
        Flags: 0x0000
        Result: Success (0x0000)
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 672
> HCI Event: Number of Completed Packets (0x13) plen 5      #29
        Num handles: 1
        Handle: 256
        Count: 1
> ACL Data RX: Handle 256 flags 0x02 dlen 14                #30
      L2CAP: Configure Response (0x05) ident 2 len 6
        Source CID: 64
        Flags: 0x0000
        Result: Success (0x0000)
> ACL Data RX: Handle 256 flags 0x02 dlen 20                #31
      L2CAP: Configure Request (0x04) ident 3 len 12
        Destination CID: 64
        Flags: 0x0000
        Option: Unknown (0x10) [hint]
        01 00 91 02 11 11                                ......
< ACL Data TX: Handle 256 flags 0x00 dlen 14                #32
      L2CAP: Command Reject (0x01) ident 3 len 6
        Reason: Invalid CID in request (0x0002)
        Destination CID: 64
        Source CID: 65
> HCI Event: Number of Completed Packets (0x13) plen 5      #33
        Num handles: 1
        Handle: 256
        Count: 1
...
=== After ===
...
> ACL Data RX: Handle 256 flags 0x02 dlen 12               #22
      L2CAP: Connection Request (0x02) ident 2 len 4
        PSM: 1 (0x0001)
        Source CID: 65
< ACL Data TX: Handle 256 flags 0x00 dlen 16               #23
      L2CAP: Connection Response (0x03) ident 2 len 8
        Destination CID: 64
        Source CID: 65
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000)
< ACL Data TX: Handle 256 flags 0x00 dlen 12               #24
      L2CAP: Configure Request (0x04) ident 2 len 4
        Destination CID: 65
        Flags: 0x0000
> HCI Event: Number of Completed Packets (0x13) plen 5     #25
        Num handles: 1
        Handle: 256
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5     #26
        Num handles: 1
        Handle: 256
        Count: 1
> ACL Data RX: Handle 256 flags 0x02 dlen 16               #27
      L2CAP: Configure Request (0x04) ident 3 len 8
        Destination CID: 64
        Flags: 0x0000
        Option: Unknown (0x10) [hint]
        01 00                                            ..
< ACL Data TX: Handle 256 flags 0x00 dlen 18               #28
      L2CAP: Configure Response (0x05) ident 3 len 10
        Source CID: 65
        Flags: 0x0000
        Result: Success (0x0000)
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 672
> HCI Event: Number of Completed Packets (0x13) plen 5     #29
        Num handles: 1
        Handle: 256
        Count: 1
> ACL Data RX: Handle 256 flags 0x02 dlen 14               #30
      L2CAP: Configure Response (0x05) ident 2 len 6
        Source CID: 64
        Flags: 0x0000
        Result: Success (0x0000)
> ACL Data RX: Handle 256 flags 0x02 dlen 20               #31
      L2CAP: Configure Request (0x04) ident 3 len 12
        Destination CID: 64
        Flags: 0x0000
        Option: Unknown (0x10) [hint]
        01 00 91 02 11 11                                .....
< ACL Data TX: Handle 256 flags 0x00 dlen 18               #32
      L2CAP: Configure Response (0x05) ident 3 len 10
        Source CID: 65
        Flags: 0x0000
        Result: Success (0x0000)
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 672
< ACL Data TX: Handle 256 flags 0x00 dlen 12               #33
      L2CAP: Configure Request (0x04) ident 3 len 4
        Destination CID: 65
        Flags: 0x0000
> HCI Event: Number of Completed Packets (0x13) plen 5     #34
        Num handles: 1
        Handle: 256
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5     #35
        Num handles: 1
        Handle: 256
        Count: 1
...

Signed-off-by: Howard Chung <howardchung@google.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
friendlyarm pushed a commit to friendlyarm/kernel-rockchip that referenced this issue Jun 15, 2021
[ Upstream commit 0f20615 ]

Fix BPF_CORE_READ_BITFIELD() macro used for reading CO-RE-relocatable
bitfields. Missing breaks in a switch caused 8-byte reads always. This can
confuse libbpf because it does strict checks that memory load size corresponds
to the original size of the field, which in this case quite often would be
wrong.

After fixing that, we run into another problem, which quite subtle, so worth
documenting here. The issue is in Clang optimization and CO-RE relocation
interactions. Without that asm volatile construct (also known as
barrier_var()), Clang will re-order BYTE_OFFSET and BYTE_SIZE relocations and
will apply BYTE_OFFSET 4 times for each switch case arm. This will result in
the same error from libbpf about mismatch of memory load size and original
field size. I.e., if we were reading u32, we'd still have *(u8 *), *(u16 *),
*(u32 *), and *(u64 *) memory loads, three of which will fail. Using
barrier_var() forces Clang to apply BYTE_OFFSET relocation first (and once) to
calculate p, after which value of p is used without relocation in each of
switch case arms, doing appropiately-sized memory load.

Here's the list of relevant relocations and pieces of generated BPF code
before and after this patch for test_core_reloc_bitfields_direct selftests.

BEFORE
=====
 rockchip-linux#45: core_reloc: insn rockchip-linux#160 --> [5] + 0:5: byte_sz --> struct core_reloc_bitfields.u32
 rockchip-linux#46: core_reloc: insn rockchip-linux#167 --> [5] + 0:5: byte_off --> struct core_reloc_bitfields.u32
 rockchip-linux#47: core_reloc: insn rockchip-linux#174 --> [5] + 0:5: byte_off --> struct core_reloc_bitfields.u32
 rockchip-linux#48: core_reloc: insn rockchip-linux#178 --> [5] + 0:5: byte_off --> struct core_reloc_bitfields.u32
 rockchip-linux#49: core_reloc: insn rockchip-linux#182 --> [5] + 0:5: byte_off --> struct core_reloc_bitfields.u32

     157:       18 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 r2 = 0 ll
     159:       7b 12 20 01 00 00 00 00 *(u64 *)(r2 + 288) = r1
     160:       b7 02 00 00 04 00 00 00 r2 = 4
; BYTE_SIZE relocation here                 ^^^
     161:       66 02 07 00 03 00 00 00 if w2 s> 3 goto +7 <LBB0_63>
     162:       16 02 0d 00 01 00 00 00 if w2 == 1 goto +13 <LBB0_65>
     163:       16 02 01 00 02 00 00 00 if w2 == 2 goto +1 <LBB0_66>
     164:       05 00 12 00 00 00 00 00 goto +18 <LBB0_69>

0000000000000528 <LBB0_66>:
     165:       18 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 r1 = 0 ll
     167:       69 11 08 00 00 00 00 00 r1 = *(u16 *)(r1 + 8)
; BYTE_OFFSET relo here w/ WRONG size        ^^^^^^^^^^^^^^^^
     168:       05 00 0e 00 00 00 00 00 goto +14 <LBB0_69>

0000000000000548 <LBB0_63>:
     169:       16 02 0a 00 04 00 00 00 if w2 == 4 goto +10 <LBB0_67>
     170:       16 02 01 00 08 00 00 00 if w2 == 8 goto +1 <LBB0_68>
     171:       05 00 0b 00 00 00 00 00 goto +11 <LBB0_69>

0000000000000560 <LBB0_68>:
     172:       18 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 r1 = 0 ll
     174:       79 11 08 00 00 00 00 00 r1 = *(u64 *)(r1 + 8)
; BYTE_OFFSET relo here w/ WRONG size        ^^^^^^^^^^^^^^^^
     175:       05 00 07 00 00 00 00 00 goto +7 <LBB0_69>

0000000000000580 <LBB0_65>:
     176:       18 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 r1 = 0 ll
     178:       71 11 08 00 00 00 00 00 r1 = *(u8 *)(r1 + 8)
; BYTE_OFFSET relo here w/ WRONG size        ^^^^^^^^^^^^^^^^
     179:       05 00 03 00 00 00 00 00 goto +3 <LBB0_69>

00000000000005a0 <LBB0_67>:
     180:       18 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 r1 = 0 ll
     182:       61 11 08 00 00 00 00 00 r1 = *(u32 *)(r1 + 8)
; BYTE_OFFSET relo here w/ RIGHT size        ^^^^^^^^^^^^^^^^

00000000000005b8 <LBB0_69>:
     183:       67 01 00 00 20 00 00 00 r1 <<= 32
     184:       b7 02 00 00 00 00 00 00 r2 = 0
     185:       16 02 02 00 00 00 00 00 if w2 == 0 goto +2 <LBB0_71>
     186:       c7 01 00 00 20 00 00 00 r1 s>>= 32
     187:       05 00 01 00 00 00 00 00 goto +1 <LBB0_72>

00000000000005e0 <LBB0_71>:
     188:       77 01 00 00 20 00 00 00 r1 >>= 32

AFTER
=====

 rockchip-linux#30: core_reloc: insn rockchip-linux#132 --> [5] + 0:5: byte_off --> struct core_reloc_bitfields.u32
 rockchip-linux#31: core_reloc: insn rockchip-linux#134 --> [5] + 0:5: byte_sz --> struct core_reloc_bitfields.u32

     129:       18 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 r2 = 0 ll
     131:       7b 12 20 01 00 00 00 00 *(u64 *)(r2 + 288) = r1
     132:       b7 01 00 00 08 00 00 00 r1 = 8
; BYTE_OFFSET relo here                     ^^^
; no size check for non-memory dereferencing instructions
     133:       0f 12 00 00 00 00 00 00 r2 += r1
     134:       b7 03 00 00 04 00 00 00 r3 = 4
; BYTE_SIZE relocation here                 ^^^
     135:       66 03 05 00 03 00 00 00 if w3 s> 3 goto +5 <LBB0_63>
     136:       16 03 09 00 01 00 00 00 if w3 == 1 goto +9 <LBB0_65>
     137:       16 03 01 00 02 00 00 00 if w3 == 2 goto +1 <LBB0_66>
     138:       05 00 0a 00 00 00 00 00 goto +10 <LBB0_69>

0000000000000458 <LBB0_66>:
     139:       69 21 00 00 00 00 00 00 r1 = *(u16 *)(r2 + 0)
; NO CO-RE relocation here                   ^^^^^^^^^^^^^^^^
     140:       05 00 08 00 00 00 00 00 goto +8 <LBB0_69>

0000000000000468 <LBB0_63>:
     141:       16 03 06 00 04 00 00 00 if w3 == 4 goto +6 <LBB0_67>
     142:       16 03 01 00 08 00 00 00 if w3 == 8 goto +1 <LBB0_68>
     143:       05 00 05 00 00 00 00 00 goto +5 <LBB0_69>

0000000000000480 <LBB0_68>:
     144:       79 21 00 00 00 00 00 00 r1 = *(u64 *)(r2 + 0)
; NO CO-RE relocation here                   ^^^^^^^^^^^^^^^^
     145:       05 00 03 00 00 00 00 00 goto +3 <LBB0_69>

0000000000000490 <LBB0_65>:
     146:       71 21 00 00 00 00 00 00 r1 = *(u8 *)(r2 + 0)
; NO CO-RE relocation here                   ^^^^^^^^^^^^^^^^
     147:       05 00 01 00 00 00 00 00 goto +1 <LBB0_69>

00000000000004a0 <LBB0_67>:
     148:       61 21 00 00 00 00 00 00 r1 = *(u32 *)(r2 + 0)
; NO CO-RE relocation here                   ^^^^^^^^^^^^^^^^

00000000000004a8 <LBB0_69>:
     149:       67 01 00 00 20 00 00 00 r1 <<= 32
     150:       b7 02 00 00 00 00 00 00 r2 = 0
     151:       16 02 02 00 00 00 00 00 if w2 == 0 goto +2 <LBB0_71>
     152:       c7 01 00 00 20 00 00 00 r1 s>>= 32
     153:       05 00 01 00 00 00 00 00 goto +1 <LBB0_72>

00000000000004d0 <LBB0_71>:
     154:       77 01 00 00 20 00 00 00 r1 >>= 323

Fixes: ee26dad ("libbpf: Add support for relocatable bitfields")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Lorenz Bauer <lmb@cloudflare.com>
Link: https://lore.kernel.org/bpf/20210426192949.416837-4-andrii@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
friendlyarm pushed a commit to friendlyarm/kernel-rockchip that referenced this issue Aug 31, 2021
commit 16a200f upstream.

A fstrim on a degraded raid1 can trigger the following null pointer
dereference:

  BTRFS info (device loop0): allowing degraded mounts
  BTRFS info (device loop0): disk space caching is enabled
  BTRFS info (device loop0): has skinny extents
  BTRFS warning (device loop0): devid 2 uuid 97ac16f7-e14d-4db1-95bc-3d489b424adb is missing
  BTRFS warning (device loop0): devid 2 uuid 97ac16f7-e14d-4db1-95bc-3d489b424adb is missing
  BTRFS info (device loop0): enabling ssd optimizations
  BUG: kernel NULL pointer dereference, address: 0000000000000620
  PGD 0 P4D 0
  Oops: 0000 [#1] SMP NOPTI
  CPU: 0 PID: 4574 Comm: fstrim Not tainted 5.13.0-rc7+ rockchip-linux#31
  Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
  RIP: 0010:btrfs_trim_fs+0x199/0x4a0 [btrfs]
  RSP: 0018:ffff959541797d28 EFLAGS: 00010293
  RAX: 0000000000000000 RBX: ffff946f84eca508 RCX: a7a67937adff8608
  RDX: ffff946e8122d000 RSI: 0000000000000000 RDI: ffffffffc02fdbf0
  RBP: ffff946ea4615000 R08: 0000000000000001 R09: 0000000000000000
  R10: 0000000000000000 R11: ffff946e8122d960 R12: 0000000000000000
  R13: ffff959541797db8 R14: ffff946e8122d000 R15: ffff959541797db8
  FS:  00007f55917a5080(0000) GS:ffff946f9bc00000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 0000000000000620 CR3: 000000002d2c8001 CR4: 00000000000706f0
  Call Trace:
  btrfs_ioctl_fitrim+0x167/0x260 [btrfs]
  btrfs_ioctl+0x1c00/0x2fe0 [btrfs]
  ? selinux_file_ioctl+0x140/0x240
  ? syscall_trace_enter.constprop.0+0x188/0x240
  ? __x64_sys_ioctl+0x83/0xb0
  __x64_sys_ioctl+0x83/0xb0

Reproducer:

  $ mkfs.btrfs -fq -d raid1 -m raid1 /dev/loop0 /dev/loop1
  $ mount /dev/loop0 /btrfs
  $ umount /btrfs
  $ btrfs dev scan --forget
  $ mount -o degraded /dev/loop0 /btrfs

  $ fstrim /btrfs

The reason is we call btrfs_trim_free_extents() for the missing device,
which uses device->bdev (NULL for missing device) to find if the device
supports discard.

Fix is to check if the device is missing before calling
btrfs_trim_free_extents().

CC: stable@vger.kernel.org # 5.4+
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
FanX-Tek pushed a commit to FanX-Tek/kernel that referenced this issue Nov 21, 2022
Fix issue : rockchip-linux#273

Signed-off-by: Wentao Guan <otgwt@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants