Commits
Robby Cai committed d40637cc8c1
LF-135 media: mx6s_capture: fix kernel dump when start two instances of capture the driver can't support two instances capturing, but should not have dump even run two instances. fix the kernel dump as below by using open counts. [ 59.147670] Mem abort info: [ 59.150480] ESR = 0x96000006 [ 59.153580] EC = 0x25: DABT (current EL), IL = 32 bits [ 59.158928] SET = 0, FnV = 0 [ 59.162271] EA = 0, S1PTW = 0 [ 59.165431] Data abort info: [ 59.171168] ISV = 0, ISS = 0x00000006 [ 59.175031] CM = 0, WnR = 0 [ 59.180852] user pgtable: 4k pages, 48-bit VAs, pgdp=00000000b9a61000 [ 59.187317] [0000000000000008] pgd=00000000b84d8003, pud=00000000b857f003, pmd=0000000000000000 [ 59.198708] Internal error: Oops: 96000006 [#1] PREEMPT SMP [ 59.204282] Modules linked in: [ 59.207343] CPU: 1 PID: 642 Comm: mx6s_v4l2_captu Not tainted 5.4.0-03538-gd9bad5b71b42 #5 Message from syslogd@imx8mme[ 59.218379] Hardware name: FSL i.MX8MM EVK board (DT) [ 59.223430] pstate: 60000005 (nZCv daif -PAN -UAO) [ 59.228228] pc : put_vaddr_frames+0x10/0xf0 [ 59.232412] lr : vb2_destroy_framevec+0x14/0x28 [ 59.236940] sp : ffff80001266bc10 [ 59.240251] x29: ffff80001266bc10 x28: ffff0000746b8dc0 [ 59.245562] x27: 0000000000000000 x26: 0000000000000030 [ 59.250872] x25: 0000000000000060 x24: 0000000000000003 [ 59.256181] x23: 0000000000000000 x22: 0000000000000000 [ 59.261491] x21: 0000000000000001 x20: 0000000000000000 [ 59.266801] x19: 0000000000000000 x18: 0000000000000000 [ 59.272112] x17: 0000000000000000 x16: 0000000000000000 [ 59.277423] x15: 0000000000000000 x14: 0000000000000000 [ 59.282733] x13: 0000000000000000 x12: 0000000000000000 [ 59.288043] x11: 0000000000000000 x10: 0000000000000001 [ 59.293354] x9 : 0000000000000020 x8 : ffff00007dba5af8 [ 59.298665] x7 : 0000000000000001 x6 : ffff00007a5ca300 [ 59.303973] x5 : ffff80001266bc60 x4 : 0000000000000000 [ 59.309283] x3 : 0000000000000002 x2 : ffff0000747b7600 [ 59.314593] x1 : ffff800010cba6a8 x0 : 0000000000000000 [ 59.319906] Call trace: [ 59.322354] put_vaddr_frames+0x10/0xf0 [ 59.326189] vb2_destroy_framevec+0x14/0x28 [ 59.330371] vb2_dc_put_userptr+0xac/0x120 [ 59.334468] __vb2_queue_free+0x118/0x240 [ 59.338476] vb2_core_queue_release+0x34/0x48 [ 59.342832] vb2_queue_release+0xc/0x18 [ 59.346668] mx6s_csi_close+0x34/0xfc [ 59.350329] v4l2_release+0xb4/0xe8 [ 59.353817] __fput+0x88/0x228 [ 59.356868] ____fput+0xc/0x18 [ 59.359925] task_work_run+0x80/0x130 [ 59.363589] do_notify_resume+0x1f0/0x460 [ 59.367597] work_pending+0x8/0x10 [ 59.371001] Code: a9bd7bfd 910003fd a90153f3 aa0003f4 (39402001) [ 59.377094] ---[ end trace 57c60e9205cdecb0 ]--- reproduce steps: 1. v4l_emma.sh 1 4 2. enter ctrl+z when systrem start capturing 3. v4l_emma.sh 1 4 Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: Guoniu.zhou <guoniu.zhou@nxp.com> (cherry picked from commit 1a7af0123bd0677ce1a2a12f333c79552885eca9)