Vi: fatal: error recovery failed

When I run below command to grab Image, Got fatal error, Even after boosting the clocks

v4l2-ctl -d /dev/video0 --set-fmt-video=width=2048,height=2186,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1

[ 155.012808] tegra194-vi5 15c10000.vi: vi_capture_ivc_send_control unexpected response from camera processor
[ 155.012965] video4linux video0: vi capture release failed
[ 155.013051] tegra194-vi5 15c10000.vi: fatal: error recovery failed

What causes this error ??

Please check the trace log if can get more information.

https://elinux.org/Jetson_TX2_Camera_BringUp

This is what see in the trace :

122.773322] video4linux video0: vi capture release failed
[ 122.773409] tegra194-vi5 15c10000.vi: fatal: error recovery failed
[ 281.567115] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 281.567270] Mem abort info:
[ 281.567346] ESR = 0x96000005
[ 281.567399] Exception class = DABT (current EL), IL = 32 bits
[ 281.567496] SET = 0, FnV = 0
[ 281.567549] EA = 0, S1PTW = 0
[ 281.567600] Data abort info:
[ 281.567654] ISV = 0, ISS = 0x00000005
[ 281.567717] CM = 0, WnR = 0
[ 281.567775] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc3e02df000
[ 281.567879] [0000000000000000] *pgd=0000000000000000, *pud=0000000000000000
[ 281.568005] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 281.568111] Modules linked in: ov5693 fuse zram overlay spidev nvgpu bluedroid_pm ip_tables x_tables [last unloaded: ov5693]
[ 281.568362] CPU: 5 PID: 11673 Comm: v4l2-ctl Not tainted 4.9.140-tegra #14
[ 281.568821] Hardware name: Jetson-AGX (DT)
[ 281.569144] task: ffffffc3bcea7000 task.stack: ffffffc3acc28000
[ 281.569605] PC is at exit_creds+0x2c/0x78
[ 281.569922] LR is at __put_task_struct+0x4c/0x140
[ 281.570260] pc : [] lr : [] pstate: 60400045
[ 281.576681] sp : ffffffc3acc2ba10
[ 281.580176] x29: ffffffc3acc2ba10 x28: 0000000000000008
[ 281.585965] x27: ffffff8008f62000 x26: ffffffc3acc2bde8
[ 281.591462] x25: ffffffc3c4efbf68 x24: ffffffc3e3000838
[ 281.597149] x23: 0000000000000001 x22: ffffffc3eb59b018
[ 281.602146] x21: ffffffc3ebe0c630 x20: 0000000000000000
[ 281.607562] x19: ffffffc3ebe0c600 x18: 0000000000000000
[ 281.613250] x17: 0000007f9ab60f60 x16: ffffff800827ae30
[ 281.618849] x15: 0000000000000001 x14: ffffff8008f699f8
[ 281.624284] x13: 00000000003b9319 x12: 071c71c71c71c71c
[ 281.630049] x11: 000000000000000b x10: 0000000000000a40
[ 281.635826] x9 : ffffffc3acc2b860 x8 : ffffffc3bcea7aa0
[ 281.641612] x7 : 0000000000000000 x6 : 000000021f7f29f6
[ 281.647113] x5 : 0000000000000800 x4 : 0000000000000000
[ 281.652450] x3 : 00000000000000c9 x2 : 0000000000000000
[ 281.657787] x1 : 0000000000000000 x0 : 00000000ffffffff
[ 281.662870]
[ 281.664267] Process v4l2-ctl (pid: 11673, stack limit = 0xffffffc3acc28000)
[ 281.671176] Call trace:
[ 281.673555] [] exit_creds+0x2c/0x78
[ 281.678108] [] __put_task_struct+0x4c/0x140
[ 281.683693] [] kthread_stop+0x1e4/0x1e8
[ 281.688782] [] vi5_channel_stop_kthreads+0x40/0x58
[ 281.694905] [] vi5_channel_stop_streaming+0x8c/0xa8
[ 281.701029] [] tegra_channel_stop_streaming+0x34/0x48
[ 281.706982] [] __vb2_queue_cancel+0x34/0x188
[ 281.712840] [] vb2_core_queue_release+0x2c/0x58
[ 281.718704] [] _vb2_fop_release+0x84/0xa0
[ 281.724041] [] tegra_channel_close+0x64/0x140
[ 281.729732] [] v4l2_release+0x48/0xa0
[ 281.734879] [] __fput+0x90/0x1d0
[ 281.739691] [] ____fput+0x20/0x30
[ 281.744518] [] task_work_run+0xbc/0xd8
[ 281.749772] [] do_exit+0x2c4/0xa08
[ 281.754927] [] do_group_exit+0x40/0xa8
[ 281.760265] [] get_signal+0x26c/0x578
[ 281.765431] [] do_signal+0x130/0x500
[ 281.770420] [] do_notify_resume+0x90/0xb0
[ 281.776265] [] work_pending+0x8/0x10
[ 281.781087] —[ end trace 0221dbeebfe31024 ]—
[ 281.793538] Fixing recursive fault but reboot is needed!

How to fix this issue ?

This looks like not trace log.

sudo su
echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 2 > /sys/kernel/debug/camrtc/log-level
echo 1 > /sys/kernel/debug/tracing/events/camera_common/enable
echo > /sys/kernel/debug/tracing/trace
cat /sys/kernel/debug/tracing/trace

I have applied all those, In the trace won’t see anything related to this, so shared dmesg logs

It’s could be the sensor driver cause the kernel crash before issue a capture command to VI.
Please have review sensor driver and device tree to figure it out.