Steps to reproduce:
Xavier NX Devkit
JetPack 4.6
Using Raspi Cam V2.1 (IMX219 driver) on CAM0
For testing, start stream, works fine:
$ v4l2-ctl --stream-mmap
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.09 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.04 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.03 fps
Then, in parallel, cause a timeout by stopping the camera:
$ sudo su
$ cd /sys/kernel/debug/imx219_c
$ echo "0x100 0x00" > d
This leads to the following error in the kernel log:
[ 539.228448] tegra194-vi5 15c10000.vi: no reply from camera processor
[ 539.228612] tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
[ 539.228786] tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel
[ 539.232009] Unable to handle kernel NULL pointer dereference at virtual address 00000010
[ 539.232215] Mem abort info:
[ 539.232270] ESR = 0x96000005
[ 539.232332] Exception class = DABT (current EL), IL = 32 bits
[ 539.232509] SET = 0, FnV = 0
[ 539.232579] EA = 0, S1PTW = 0
[ 539.232644] Data abort info:
[ 539.232723] ISV = 0, ISS = 0x00000005
[ 539.232794] CM = 0, WnR = 0
[ 539.232856] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc15c4ba000
[ 539.232966] [0000000000000010] *pgd=0000000000000000, *pud=0000000000000000
[ 539.233109] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 539.233210] Modules linked in: fuse xt_conntrack ipt_MASQUERADE nf_nat_masquerade_ipv4 nf_conntrack_netlink nfnetlink xt_addrtype iptable_filter iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack br_netfilter zram overlay bnep rtk_btusb rtl8822ce btusb btrtl btbcm btintel cfg80211 userspace_alert binfmt_misc nvgpu ip_tables x_tables
[ 539.248020] CPU: 2 PID: 9637 Comm: vi-output, imx2 Tainted: G W 4.9.253-tegra #1
[ 539.256573] Hardware name: NVIDIA Jetson Xavier NX Developer Kit (DT)
[ 539.263130] task: ffffffc1f2d50e00 task.stack: ffffffc1f293c000
[ 539.269177] PC is at _raw_write_lock+0x30/0x58
[ 539.273202] LR is at destroy_buffer_table+0x40/0xd8
[ 539.278266] pc : [<ffffff8008f6c6f0>] lr : [<ffffff8008b4d280>] pstate: 20c00045
[ 539.285440] sp : ffffffc1f293fc70
[ 539.288508] x29: ffffffc1f293fc70 x28: 0000000000000000
[ 539.294367] x27: 0000000000000000 x26: 0000000000000000
[ 539.299963] x25: 0000000000000010 x24: 0000000000000098
[ 539.304525] x23: 0000000000000018 x22: ffffff8009087458
[ 539.310039] x21: 0000000000000000 x20: ffffffc1dcbc3800
[ 539.315800] x19: 0000000000000010 x18: 0000000000000000
[ 539.321240] x17: 0000000000000002 x16: 0000000000000003
[ 539.327263] x15: 000000000000002a x14: 00060000000bfeb7
[ 539.332950] x13: 0006000000000000 x12: ffffff800c000064
[ 539.338639] x11: 0000000000000400 x10: 0000000000000a10
[ 539.344328] x9 : ffffffc1f293fa80 x8 : 0000000000000000
[ 539.350103] x7 : ffffffc192b7f2c0 x6 : ffffffc163720d41
[ 539.355615] x5 : ffffff800852d904 x4 : ffffffbf058dc810
[ 539.360702] x3 : 0000000000000000 x2 : ffffffc163720d40
[ 539.366292] x1 : 0000000000000000 x0 : 0000000080000000
[ 539.372779] Process vi-output, imx2 (pid: 9637, stack limit = 0xffffffc1f293c000)
[ 539.380027] Call trace:
[ 539.382572] [<ffffff8008f6c6f0>] _raw_write_lock+0x30/0x58
[ 539.387646] [<ffffff8008b4d280>] destroy_buffer_table+0x40/0xd8
[ 539.392988] [<ffffff8008b3f58c>] vi_capture_shutdown+0xd4/0x130
[ 539.398846] [<ffffff8008b3fbe4>] vi_channel_close_ex+0x34/0x88
[ 539.404445] [<ffffff8008b410f0>] vi5_channel_error_recover+0x48/0x1c8
[ 539.410397] [<ffffff8008b361c0>] tegra_channel_error_recover+0x58/0x90
[ 539.416261] [<ffffff8008b419b0>] tegra_channel_kthread_capture_dequeue+0xf8/0x1c0
[ 539.423176] [<ffffff80080db09c>] kthread+0xec/0xf0
[ 539.427988] [<ffffff80080838a0>] ret_from_fork+0x10/0x30
[ 539.433322] ---[ end trace 3d8f3e796590f570 ]---
[ 539.453705] note: vi-output, imx2[9637] exited with preempt_count 1
Cancelling the v4l2-ctl command makes it even worse:
[ 641.372865] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 641.373043] Mem abort info:
[ 641.373124] ESR = 0x96000005
[ 641.373185] Exception class = DABT (current EL), IL = 32 bits
[ 641.373289] SET = 0, FnV = 0
[ 641.373344] EA = 0, S1PTW = 0
[ 641.373401] Data abort info:
[ 641.373452] ISV = 0, ISS = 0x00000005
[ 641.373541] CM = 0, WnR = 0
[ 641.373603] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc1a1e98000
[ 641.373713] [0000000000000000] *pgd=0000000000000000, *pud=0000000000000000
[ 641.373854] Internal error: Oops: 96000005 [#2] PREEMPT SMP
[ 641.373959] Modules linked in: fuse xt_conntrack ipt_MASQUERADE nf_nat_masquerade_ipv4 nf_conntrack_netlink nfnetlink xt_addrtype iptable_filter iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack br_netfilter zram overlay bnep rtk_btusb rtl8822ce btusb btrtl btbcm btintel cfg80211 userspace_alert binfmt_misc nvgpu ip_tables x_tables
[ 641.375726] CPU: 5 PID: 9635 Comm: v4l2-ctl Tainted: G D W 4.9.253-tegra #1
[ 641.378608] Hardware name: NVIDIA Jetson Xavier NX Developer Kit (DT)
[ 641.384911] task: ffffffc1936baa00 task.stack: ffffffc147250000
[ 641.391213] PC is at exit_creds+0x2c/0x78
[ 641.395148] LR is at __put_task_struct+0x4c/0x140
[ 641.399520] pc : [<ffffff80080de15c>] lr : [<ffffff80080aee9c>] pstate: 60400045
[ 641.406869] sp : ffffffc147253a00
[ 641.410364] x29: ffffffc147253a00 x28: ffffffc1936baa00
[ 641.415875] x27: ffffff8008f82000 x26: ffffffc1ba25b180
[ 641.421476] x25: ffffffc1c4c3d1e8 x24: ffffffc1e05b1598
[ 641.426214] x23: 0000000000000001 x22: ffffffc1e2ac4018
[ 641.431800] x21: ffffffc1f2d50e30 x20: 000000000000000b
[ 641.437311] x19: ffffffc1f2d50e00 x18: 0000007f7cb36a70
[ 641.442912] x17: 0000007f7caa9d40 x16: ffffff8008274b68
[ 641.448436] x15: 0000000000000000 x14: 000000000003be1d
[ 641.454373] x13: 0000000000000000 x12: 0000000000000000
[ 641.459638] x11: ffffff8008f899d0 x10: 0000000000000a10
[ 641.465664] x9 : ffffffc147253850 x8 : ffffffc1936bb470
[ 641.471436] x7 : 0000000000000400 x6 : 0000000000000000
[ 641.476702] x5 : 0000000000000800 x4 : 0000000000000000
[ 641.482288] x3 : 00000000000000bf x2 : 0000000000000000
[ 641.487375] x1 : 0000000000000000 x0 : 00000000ffffffff
[ 641.494120] Process v4l2-ctl (pid: 9635, stack limit = 0xffffffc147250000)
[ 641.501015] Call trace:
[ 641.503125] [<ffffff80080de15c>] exit_creds+0x2c/0x78
[ 641.508193] [<ffffff80080aee9c>] __put_task_struct+0x4c/0x140
[ 641.513531] [<ffffff80080dbbfc>] kthread_stop+0x1e4/0x1e8
[ 641.518610] [<ffffff8008b41308>] vi5_channel_stop_kthreads+0x40/0x58
[ 641.524475] [<ffffff8008b413ec>] vi5_channel_stop_streaming+0xcc/0xd0
[ 641.530603] [<ffffff8008b3305c>] tegra_channel_stop_streaming+0x34/0x48
[ 641.537069] [<ffffff8008b2b374>] __vb2_queue_cancel+0x34/0x188
[ 641.542409] [<ffffff8008b2c89c>] vb2_core_queue_release+0x2c/0x58
[ 641.548531] [<ffffff8008b2ef1c>] _vb2_fop_release+0x84/0xa0
[ 641.553613] [<ffffff8008b349f4>] tegra_channel_close+0x64/0x140
[ 641.559299] [<ffffff8008b082e8>] v4l2_release+0x48/0xa0
[ 641.564637] [<ffffff800825dcb8>] __fput+0x90/0x1d0
[ 641.569442] [<ffffff800825de70>] ____fput+0x20/0x30
[ 641.574000] [<ffffff80080d8dac>] task_work_run+0xbc/0xd8
[ 641.579770] [<ffffff80080b8408>] do_exit+0x2e0/0xa88
[ 641.584668] [<ffffff80080b8c40>] do_group_exit+0x40/0xa8
[ 641.590007] [<ffffff80080c64ec>] get_signal+0xbc/0x750
[ 641.595171] [<ffffff800808add8>] do_signal+0x130/0x500
[ 641.600160] [<ffffff800808b320>] do_notify_resume+0x90/0xb0
[ 641.605762] [<ffffff800808379c>] work_pending+0x8/0x10
[ 641.610841] ---[ end trace 3d8f3e796590f571 ]---
[ 641.630038] Fixing recursive fault but reboot is needed!
This problem was not present with JetPack 4.5.1 and prior.
It does not occur when streaming via nvarguscamerasrc.
Even though this might look contrived; having timeout not crash is essential to have a camera running in trigger mode.