running Multi Session argus_camera; kernel NULL pointer dereference

I have 4 ~20M pixels sensors. Every sensor for itself is working properly streaming full resolution, but running Multi Session in argus_camera sample app results in NULL pointer.

I’ve tried maxing VI clock and running jetson_clocks script.

error:

[   73.696721] misc tegra_camera_ctrl: tegra_camera_update_isobw: Warning, Requested ISO BW 11250000 has been capped to VI's max BW 6400000
[   73.822214] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[   73.837192] misc tegra_camera_ctrl: tegra_camera_update_isobw: Warning, Requested ISO BW 8437500 has been capped to VI's max BW 6400000
[   73.840380] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[   73.840451] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[   73.840567] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[   73.840601] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[   73.840621] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[   73.840653] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[   73.840668] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[   73.840952] tegra194-vi5 15c10000.vi: 6 GoS tables configured.
[   73.840997] tegra194-vi5 15c10000.vi: gos[0] = 0xeca00000
[   73.841083] tegra194-vi5 15c10000.vi: gos[1] = 0xeca01000
[   73.841087] tegra194-vi5 15c10000.vi: gos[2] = 0xeca02000
[   73.841091] tegra194-vi5 15c10000.vi: gos[3] = 0xeca03000
[   73.841095] tegra194-vi5 15c10000.vi: gos[4] = 0xeca04000
[   73.841098] tegra194-vi5 15c10000.vi: gos[5] = 0xeca05000
[   73.867894] misc tegra_camera_ctrl: tegra_camera_update_isobw: Warning, Requested ISO BW 11250000 has been capped to VI's max BW 6400000
[   74.130422] Unable to handle kernel NULL pointer dereference at virtual address 00000020
[   74.130603] Mem abort info:
[   74.130662]   ESR = 0x96000006
[   74.130723]   Exception class = DABT (current EL), IL = 32 bits
[   74.130864]   SET = 0, FnV = 0
[   74.130923]   EA = 0, S1PTW = 0
[   74.130980] Data abort info:
[   74.131034]   ISV = 0, ISS = 0x00000006
[   74.131104]   CM = 0, WnR = 0
[   74.131172] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc3a0886000
[   74.131290] [0000000000000020] *pgd=0000000420f18003, *pud=0000000420f18003, *pmd=0000000000000000
[   74.131887] Internal error: Oops: 96000006 [#1] PREEMPT SMP
[   74.132024] Modules linked in:
[   74.132106] CPU: 2 PID: 7519 Comm: CaptureSchedule Not tainted 4.9.108-framos-005 #22
[   74.132247] Hardware name: jetson-xavier (DT)
[   74.132331] task: ffffffc36ca02a00 task.stack: ffffffc376458000
[   74.132445] PC is at iommu_dma_alloc_iova+0x58/0x90
[   74.132785] LR is at iommu_dma_alloc_iova+0x58/0x90
[   74.133167] pc : [<ffffff80086d69a0>] lr : [<ffffff80086d69a0>] pstate: 80400045
[   74.135104] sp : ffffffc37645ba50
[   74.138435] x29: ffffffc37645ba50 x28: ffffffc3e9d43800 
[   74.144289] x27: 00000000026e0000 x26: ffffffc2c0b37000 
[   74.150087] x25: 0000000000000000 x24: 0000000000000083 
[   74.155327] x23: ffffffc3e9ccfcb8 x22: 0000000000000001 
[   74.160922] x21: 0000007fffffffff x20: 00000000026e0000 
[   74.166687] x19: 000000000000000c x18: 0000000000000010 
[   74.172461] x17: 0000007fa5223b10 x16: ffffff80082622c0 
[   74.177907] x15: 0000000000000001 x14: 0000000000000000 
[   74.183673] x13: 0000000000000000 x12: 0088000000000000 
[   74.189274] x11: 0088000000000000 x10: 0101010101010101 
[   74.194972] x9 : ffffff8009572000 x8 : 00000043f650e000 
[   74.200772] x7 : 0000000380000000 x6 : ffffffc2c0b50488 
[   74.206253] x5 : ffffffc2c4847100 x4 : ffffffc3ffd75c80 
[   74.211837] x3 : 00000000000109c2 x2 : ffffffc2c48470c0 
[   74.217174] x1 : 0000000000000000 x0 : 0000000000000000 

[   74.223666] Process CaptureSchedule (pid: 7519, stack limit = 0xffffffc376458028)
[   74.230918] Call trace:
[   74.233208] [<ffffff80086d69a0>] iommu_dma_alloc_iova+0x58/0x90
[   74.239056] [<ffffff80086d75a4>] iommu_dma_map_sg+0x124/0x3c0
[   74.244400] [<ffffff80080a195c>] __iommu_map_sg_attrs+0x64/0x98
[   74.250002] [<ffffff800855ce4c>] _nvmap_dmabuf_map_dma_buf+0x49c/0x5b0
[   74.255979] [<ffffff8008565184>] nvmap_dmabuf_map_dma_buf+0x7c/0x168
[   74.261845] [<ffffff80087feb2c>] dma_buf_map_attachment+0x94/0x1c0
[   74.267940] [<ffffff8008b75fe4>] capture_common_pin_memory+0x54/0xe8
[   74.273794] [<ffffff8008b762c0>] capture_common_request_pin_and_reloc+0x248/0x4b0
[   74.280971] [<ffffff8008b78834>] isp_capture_request+0x284/0x4d0
[   74.286484] [<ffffff8008b76d14>] isp_channel_ioctl+0x38c/0x418
[   74.292526] [<ffffff8008261a78>] do_vfs_ioctl+0xb0/0x8f8
[   74.297769] [<ffffff8008262354>] SyS_ioctl+0x94/0xa8
[   74.302668] [<ffffff8008083580>] el0_svc_naked+0x34/0x38
[   74.308189] ---[ end trace 22ab5ad3101ec6b2 ]---

Assume problem is in buffers…

Streaming in ~9M pixels resolution with 4 sensors running Multi Session is ok.
Any suggestion?

Any others kernel message?
Have you try to boost nvcsi clock?

That’s all from kernel message:

[  129.413202] tegra194-isp5 14800000.isp: isp_channel_power_on
[  129.422419] t194-nvcsi 15a00000.nvcsi: Selected no CSI lane, cannot do calibration
[  129.422601] t194-nvcsi 15a00000.nvcsi: calibration failed with -22 error
[  129.428631] tegra194-isp5 14800000.isp: 6 GoS tables configured.
[  129.428691] tegra194-isp5 14800000.isp: gos[0] = 0xeca00000
[  129.428702] tegra194-isp5 14800000.isp: gos[1] = 0xeca01000
[  129.428708] tegra194-isp5 14800000.isp: gos[2] = 0xeca02000
[  129.428711] tegra194-isp5 14800000.isp: gos[3] = 0xeca03000
[  129.428715] tegra194-isp5 14800000.isp: gos[4] = 0xeca04000
[  129.428719] tegra194-isp5 14800000.isp: gos[5] = 0xeca05000
[  129.435507] [RCE] Total number of isp channels : 16 
[  130.837840] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  130.838153] tegra194-vi5 15c10000.vi: 6 GoS tables configured.
[  130.838164] tegra194-vi5 15c10000.vi: gos[0] = 0xeca00000
[  130.838168] tegra194-vi5 15c10000.vi: gos[1] = 0xeca01000
[  130.838172] tegra194-vi5 15c10000.vi: gos[2] = 0xeca02000
[  130.838175] tegra194-vi5 15c10000.vi: gos[3] = 0xeca03000
[  130.838178] tegra194-vi5 15c10000.vi: gos[4] = 0xeca04000
[  130.838181] tegra194-vi5 15c10000.vi: gos[5] = 0xeca05000
[  130.842944] [RCE] vi5_hwinit: firmware CL2018061801 protocol version 2.2
[  131.866575] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  131.932124] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  131.932435] tegra194-vi5 15c10000.vi: 6 GoS tables configured.
[  131.932447] tegra194-vi5 15c10000.vi: gos[0] = 0xeca00000
[  131.932451] tegra194-vi5 15c10000.vi: gos[1] = 0xeca01000
[  131.932455] tegra194-vi5 15c10000.vi: gos[2] = 0xeca02000
[  131.932459] tegra194-vi5 15c10000.vi: gos[3] = 0xeca03000
[  131.932462] tegra194-vi5 15c10000.vi: gos[4] = 0xeca04000
[  131.932465] tegra194-vi5 15c10000.vi: gos[5] = 0xeca05000
[  132.228902] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  132.229014] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  132.229092] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  132.229294] tegra194-vi5 15c10000.vi: 6 GoS tables configured.
[  132.229301] tegra194-vi5 15c10000.vi: gos[0] = 0xeca00000
[  132.229306] tegra194-vi5 15c10000.vi: gos[1] = 0xeca01000
[  132.229310] tegra194-vi5 15c10000.vi: gos[2] = 0xeca02000
[  132.229314] tegra194-vi5 15c10000.vi: gos[3] = 0xeca03000
[  132.229317] tegra194-vi5 15c10000.vi: gos[4] = 0xeca04000
[  132.229320] tegra194-vi5 15c10000.vi: gos[5] = 0xeca05000
[  132.405015] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  132.405237] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  132.405502] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  132.405545] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  132.405571] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  132.405727] tegra194-vi5 15c10000.vi: 6 GoS tables configured.
[  132.405735] tegra194-vi5 15c10000.vi: gos[0] = 0xeca00000
[  132.405739] tegra194-vi5 15c10000.vi: gos[1] = 0xeca01000
[  132.405742] tegra194-vi5 15c10000.vi: gos[2] = 0xeca02000
[  132.405745] tegra194-vi5 15c10000.vi: gos[3] = 0xeca03000
[  132.405748] tegra194-vi5 15c10000.vi: gos[4] = 0xeca04000
[  132.405751] tegra194-vi5 15c10000.vi: gos[5] = 0xeca05000
[  132.545082] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  132.545219] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  132.545267] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  132.545305] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  132.545323] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  132.545357] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  132.545374] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  132.545547] tegra194-vi5 15c10000.vi: 6 GoS tables configured.
[  132.545556] tegra194-vi5 15c10000.vi: gos[0] = 0xeca00000
[  132.545560] tegra194-vi5 15c10000.vi: gos[1] = 0xeca01000
[  132.545564] tegra194-vi5 15c10000.vi: gos[2] = 0xeca02000
[  132.545567] tegra194-vi5 15c10000.vi: gos[3] = 0xeca03000
[  132.545570] tegra194-vi5 15c10000.vi: gos[4] = 0xeca04000
[  132.545573] tegra194-vi5 15c10000.vi: gos[5] = 0xeca05000
[  132.945397] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  132.981376] imx283 32-001a: imx283_set_frame_length: setting frame length not implemented
[  132.987928] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  132.988238] tegra194-vi5 15c10000.vi: 6 GoS tables configured.
[  132.988254] tegra194-vi5 15c10000.vi: gos[0] = 0xeca00000
[  132.988257] tegra194-vi5 15c10000.vi: gos[1] = 0xeca01000
[  132.988263] tegra194-vi5 15c10000.vi: gos[2] = 0xeca02000
[  132.988266] tegra194-vi5 15c10000.vi: gos[3] = 0xeca03000
[  132.988269] tegra194-vi5 15c10000.vi: gos[4] = 0xeca04000
[  132.988272] tegra194-vi5 15c10000.vi: gos[5] = 0xeca05000
[  133.259684] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  133.353507] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  133.353588] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  133.353624] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  133.353741] tegra194-vi5 15c10000.vi: 6 GoS tables configured.
[  133.353748] tegra194-vi5 15c10000.vi: gos[0] = 0xeca00000
[  133.353753] tegra194-vi5 15c10000.vi: gos[1] = 0xeca01000
[  133.353757] tegra194-vi5 15c10000.vi: gos[2] = 0xeca02000
[  133.353760] tegra194-vi5 15c10000.vi: gos[3] = 0xeca03000
[  133.353764] tegra194-vi5 15c10000.vi: gos[4] = 0xeca04000
[  133.353767] tegra194-vi5 15c10000.vi: gos[5] = 0xeca05000
[  133.556467] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  133.593798] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  133.593893] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  133.593932] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  133.593971] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  133.593992] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  133.594120] tegra194-vi5 15c10000.vi: 6 GoS tables configured.
[  133.594128] tegra194-vi5 15c10000.vi: gos[0] = 0xeca00000
[  133.594132] tegra194-vi5 15c10000.vi: gos[1] = 0xeca01000
[  133.594136] tegra194-vi5 15c10000.vi: gos[2] = 0xeca02000
[  133.594139] tegra194-vi5 15c10000.vi: gos[3] = 0xeca03000
[  133.594142] tegra194-vi5 15c10000.vi: gos[4] = 0xeca04000
[  133.594145] tegra194-vi5 15c10000.vi: gos[5] = 0xeca05000
[  133.666164] misc tegra_camera_ctrl: tegra_camera_update_isobw: Warning, Requested ISO BW 8437500 has been capped to VI's max BW 6400000
[  133.798222] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  133.860238] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  133.860324] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  133.860364] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  133.860403] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  133.860422] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  133.860454] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
[  133.860472] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
[  133.860605] tegra194-vi5 15c10000.vi: 6 GoS tables configured.
[  133.860611] tegra194-vi5 15c10000.vi: gos[0] = 0xeca00000
[  133.860616] tegra194-vi5 15c10000.vi: gos[1] = 0xeca01000
[  133.860620] tegra194-vi5 15c10000.vi: gos[2] = 0xeca02000
[  133.860623] tegra194-vi5 15c10000.vi: gos[3] = 0xeca03000
[  133.860627] tegra194-vi5 15c10000.vi: gos[4] = 0xeca04000
[  133.860630] tegra194-vi5 15c10000.vi: gos[5] = 0xeca05000
[  133.926671] misc tegra_camera_ctrl: tegra_camera_update_isobw: Warning, Requested ISO BW 11250000 has been capped to VI's max BW 6400000
[  134.245347] Unable to handle kernel NULL pointer dereference at virtual address 00000020
[  134.245519] Mem abort info:
[  134.245580]   ESR = 0x96000006
[  134.245640]   Exception class = DABT (current EL), IL = 32 bits
[  134.245749]   SET = 0, FnV = 0
[  134.245888]   EA = 0, S1PTW = 0
[  134.245955] Data abort info:
[  134.246008]   ISV = 0, ISS = 0x00000006
[  134.246075]   CM = 0, WnR = 0
[  134.246135] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc3b1e2b000
[  134.246254] [0000000000000020] *pgd=0000000433516003, *pud=0000000433516003, *pmd=0000000000000000
[  134.246487] Internal error: Oops: 96000006 [#1] PREEMPT SMP
[  134.246596] Modules linked in:
[  134.246683] CPU: 1 PID: 7843 Comm: CaptureSchedule Not tainted 4.9.108-framos-005 #22
[  134.246816] Hardware name: jetson-xavier (DT)
[  134.246929] task: ffffffc35eebf000 task.stack: ffffffc35eef4000
[  134.247400] PC is at iommu_dma_alloc_iova+0x58/0x90
[  134.247769] LR is at iommu_dma_alloc_iova+0x58/0x90
[  134.248153] pc : [<ffffff80086d69a0>] lr : [<ffffff80086d69a0>] pstate: 80400145
[  134.250023] sp : ffffffc35eef7a50
[  134.253614] x29: ffffffc35eef7a50 x28: ffffffc3ea5b5800 
[  134.259205] x27: 00000000026e0000 x26: ffffffc3b342bc00 
[  134.264729] x25: 0000000000000000 x24: 000000000000000d 
[  134.270494] x23: ffffffc3ea54c3b8 x22: 0000000000000001 
[  134.276093] x21: 0000007fffffffff x20: 00000000026e0000 
[  134.281604] x19: 000000000000000c x18: 0000007fa7cd4a70 
[  134.287381] x17: 0000007fa7c49b10 x16: ffffff80082622c0 
[  134.293066] x15: 0000000000000000 x14: 0000000000000000 
[  134.298589] x13: 0000000000000000 x12: 0088000000000000 
[  134.304194] x11: 0088000000000000 x10: 0101010101010101 
[  134.310132] x9 : ffffff8009572000 x8 : 00000043f64f7000 
[  134.315905] x7 : 0000000380000000 x6 : ffffffc3b342bde0 
[  134.321417] x5 : ffffffc2e3d64700 x4 : ffffffc3ffd5ec80 
[  134.326754] x3 : 000000000004fcc1 x2 : ffffffc2e3d646c0 
[  134.332091] x1 : 0000000000000000 x0 : 0000000000000000 

[  134.338850] Process CaptureSchedule (pid: 7843, stack limit = 0xffffffc35eef4028)
[  134.345748] Call trace:
[  134.348381] [<ffffff80086d69a0>] iommu_dma_alloc_iova+0x58/0x90
[  134.353979] [<ffffff80086d75a4>] iommu_dma_map_sg+0x124/0x3c0
[  134.359317] [<ffffff80080a195c>] __iommu_map_sg_attrs+0x64/0x98
[  134.364659] [<ffffff800855ce4c>] _nvmap_dmabuf_map_dma_buf+0x49c/0x5b0
[  134.370880] [<ffffff8008565184>] nvmap_dmabuf_map_dma_buf+0x7c/0x168
[  134.377017] [<ffffff80087feb2c>] dma_buf_map_attachment+0x94/0x1c0
[  134.382851] [<ffffff8008b75fe4>] capture_common_pin_memory+0x54/0xe8
[  134.388539] [<ffffff8008b762c0>] capture_common_request_pin_and_reloc+0x248/0x4b0
[  134.395645] [<ffffff8008b78834>] isp_capture_request+0x284/0x4d0
[  134.401408] [<ffffff8008b76d14>] isp_channel_ioctl+0x38c/0x418
[  134.407443] [<ffffff8008261a78>] do_vfs_ioctl+0xb0/0x8f8
[  134.412688] [<ffffff8008262354>] SyS_ioctl+0x94/0xa8
[  134.417595] [<ffffff8008083580>] el0_svc_naked+0x34/0x38
[  134.422849] ---[ end trace 861e021fa1775935 ]---

Nvcsi clock is already on max rate.

Could you check if 3 or 2 sensors use case?

2 sensors:
works, tried various combinations.

3 sensors:
error. kernel message is the same as comment #3

The NULL pointer dereference error occurs in the function iommu_dma_alloc_iova because it dereferences a NULL pointer returned by the function alloc_iova.
Function alloc_iova returns NULL because the function __alloc_and_insert_iova_range fails.
Function __alloc_and_insert_iova_range fails and returns -ENOMEM in the following check

if (iovad->start_pfn > limit_pfn - (size + pad_size) + 1) {
spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags);
return -ENOMEM;
}

It seems that there is some memory limit check that fails.
Is this some known limit? How is it connected to streaming from multiple sensors?

Could you try decrease QUEUED_BUFFERS in file mc_common.h to try.

hi ShaneCCC,

thank you for the reply, but that did not fix the problem.

I tried with 3 sensors, lowering the QUEUED_BUFFERS to 1 but end result is the same, same error message.

Hi,

I am having exactly the same error reported in comment 3.
Also I have tried all the possible combinations using 2 sensors and everything works ok. but when I add a 3rd camera the error is generated. I am using 4 ~20M pixels camera.

From my side I able to capture with 3 cameras using v4l2, I have applied this test running each command line from a different console.

v4l2-ctl -d /dev/video1 --set-fmt-video=width=5496,height=3694, --set-ctrl bypass_mode=0 --stream-mmap 
v4l2-ctl -d /dev/video2 --set-fmt-video=width=5496,height=3694, --set-ctrl bypass_mode=0 --stream-mmap 
v4l2-ctl -d /dev/video3 --set-fmt-video=width=5496,height=3694, --set-ctrl bypass_mode=0 --stream-mmap

Based on this, the error is related with nvarguscamerasrc only.

Hi,

I am also having the same error reported in comment 6 when allocating more than 2GB of buffer with the VIDIOC_REQBUFS ioctl from V4L2 driver.

I am using 4 sensors of 24MP at a resolution of 5664*4256 leading to a raw image size of 48MB.

The maximum number of buffer that I can allocate is 32 before having this issue.

How can I increase the maximum dma memory limit?

Thanks in advance,

@Mobilaz
Please have a try to modify the DT

            shared-dma-carveout {
                    compatible = "shared-dma-pool";
                    reusable;
                    alloc-ranges = <0x0 0x0 0x1 0x0>;
                    status = "okay";
                    size = <0x0 0x10000000>; /* 256MB */
                    linux,cma-default;
            };

Hi,

Thank you for your answer.

Where should I put this node in the device tree ?

I don’t see this node in the L4T 31.1 release ? Can I simply copy paste this node anywhere without any other modifications ?

I am also trying to modify the file hardware\nvidia\soc\t19x\kernel-dts\tegra194-soc\tegra194-soc-base.dtsi and more specifically the following node:

common_as: common {
        iova-start = <0x0 0x80000000>;
        iova-size = <0x0 0x7FF00000>;
	alignment = <0xFFFFF>;
	num-pf-page = <0>;
	gap-page = <1>;
};

I tried to modify the parameter iova-size from 0x7FF00000 to 0xFFF00000.
This allows me to increase the number of allocated buffer but I have runtime issues as follow:

[ 1184.872342] mc-err: vpr base=0:0, size=0, ctrl=1, override:(a01a8340, fcee10c1, 1, 0)
[ 1184.872545] mc-err: (255) csw_viw: MC request violates VPR requirements
[ 1184.872666] mc-err:   status = 0x0ff74072; addr = 0xffffffff00; hi_adr_reg=008
[ 1184.872835] mc-err:   secure: yes, access-type: write
[ 1184.872970] mc-err: vpr base=0:0, size=0, ctrl=1, override:(a01a8340, fcee10c1, 1, 0)
[ 1184.873114] mc-err: (255) csw_viw: MC request violates VPR requirements
[ 1184.873231] mc-err:   status = 0x0ff74072; addr = 0xffffffff00; hi_adr_reg=008
[ 1184.873356] mc-err:   secure: yes, access-type: write
[ 1184.873485] mc-err: vpr base=0:0, size=0, ctrl=1, override:(a01a8340, fcee10c1, 1, 0)
[ 1184.873615] mc-err: (255) csw_viw: MC request violates VPR requirements
[ 1184.873730] mc-err:   status = 0x0ff74072; addr = 0xffffffff00; hi_adr_reg=008
[ 1184.874122] mc-err:   secure: yes, access-type: write
[ 1184.874551] mc-err: vpr base=0:0, size=0, ctrl=1, override:(a01a8340, fcee10c1, 1, 0)
[ 1184.875243] mc-err: (255) csw_viw: MC request violates VPR requirements
[ 1184.876156] mc-err:   status = 0x0ff74072; addr = 0xffffffff00; hi_adr_reg=008
[ 1184.883787] mc-err:   secure: yes, access-type: write
[ 1184.888767] mc-err: Too many MC errors; throttling prints
[ 1184.894412] __arm_smmu_context_fault: 141 callbacks suppressed
[ 1184.894436] t19x-arm-smmu 12000000.iommu: Unhandled context fault: smmu2, iova=0x7c000000, fsynr=0x11, cb=22, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0
[ 1185.068142] t19x-arm-smmu 12000000.iommu: Unhandled context fault: smmu2, iova=0x7c100800, fsynr=0x11, cb=22, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0
[ 1185.071103] t19x-arm-smmu 12000000.iommu: Unhandled context fault: smmu2, iova=0x7804cc00, fsynr=0x11, cb=22, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0
[ 1185.072287] t19x-arm-smmu 12000000.iommu: Unhandled context fault: smmu2, iova=0x74000000, fsynr=0x11, cb=22, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0
[ 1185.072650] t19x-arm-smmu 12000000.iommu: Unhandled context fault: smmu2, iova=0x740174c0, fsynr=0x11, cb=22, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0
[ 1185.073026] t19x-arm-smmu 12000000.iommu: Unhandled context fault: smmu2, iova=0x7402dbc0, fsynr=0x11, cb=22, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0
[ 1185.073458] t19x-arm-smmu 12000000.iommu: Unhandled context fault: smmu2, iova=0x74045500, fsynr=0x11, cb=22, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0
[ 1185.073808] t19x-arm-smmu 12000000.iommu: Unhandled context fault: smmu2, iova=0x7405cec0, fsynr=0x11, cb=22, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0
[ 1185.074156] t19x-arm-smmu 12000000.iommu: Unhandled context fault: smmu2, iova=0x74071ac0, fsynr=0x11, cb=22, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0
[ 1185.268050] t19x-arm-smmu 12000000.iommu: Unhandled context fault: smmu2, iova=0x740f8000, fsynr=0x11, cb=22, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0

Do you have any idea what else should I do to increase the iova-size properly ?

Thanks in advance,

mc-err are seen in latest log because memory is not mapped before usage or accessed after unmap.
Please see that you have mapped the memory before using

Hi,

The mapping of my buffer seems to be working (I don’t have any MAP_FAILED).

The issue seems to be linked with a wrong setting in the DMA zone configuration.

Do you have any other ideas I could test to have more visibility ?

Thanks in advance,

Hi,

I’m having the same issue.

I created a driver for IMX283 sensor and it is working good for a single and dual capture using nvarguscamerasrc. However, when I try to capture from 3 cameras I get and error that doesn’t let me start the streaming correctly.

I verified that the problem appears when using a high amount of data because I observed the issue only when trying to capture on 5496x3694@25fps (total_active_pixels=5592×3710) mode, but I was able to capture from up to 4 cameras testing 3032x3046@42fps (total_active_pixels=3128x3062) mode.

I’m using the following pipelines for this test:

gst-launch-1.0 nvarguscamerasrc sensor-id=0 num-buffers=250 ! 'video/x-raw(memory:NVMM), width=(int)5496, height=(int)3694, format=(string)NV12, framerate=(fraction)25/1' ! perf ! fakesink sync=false async=false &
gst-launch-1.0 nvarguscamerasrc sensor-id=1 num-buffers=250 ! 'video/x-raw(memory:NVMM), width=(int)5496, height=(int)3694, format=(string)NV12, framerate=(fraction)25/1' ! perf ! fakesink sync=false async=false &
gst-launch-1.0 nvarguscamerasrc sensor-id=2 num-buffers=250 ! 'video/x-raw(memory:NVMM), width=(int)5496, height=(int)3694, format=(string)NV12, framerate=(fraction)25/1' ! perf ! fakesink sync=false async=false &

It seems that the problem is related to the ISP bandwidth or the nvarguscamersrc element because I’m able to capture from up to 4 cameras using v4l2-ctl:

v4l2-ctl -d /dev/video0 --set-fmt-video=width=5496,height=3694,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=250 &
v4l2-ctl -d /dev/video1 --set-fmt-video=width=5496,height=3694,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=250 &
v4l2-ctl -d /dev/video2 --set-fmt-video=width=5496,height=3694,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=250 &
v4l2-ctl -d /dev/video3 --set-fmt-video=width=5496,height=3694,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=250 &

I have the following definitions on tegra-camera-platform:

compatible = "nvidia, tegra-camera-platform";
        num_csi_lanes = <16>;
        max_lane_speed = <1500000>;
        max_pixel_rate = <750000>;
        min_bits_per_pixel = <10>;
        vi_peak_byte_per_pixel = <2>;
        vi_bw_margin_pct = <25>;
        isp_peak_byte_per_pixel = <5>;
        isp_bw_margin_pct = <25>;

I also tested setting max_lane_speed=<2000000> and max_pixel_rate=<1400000> in order to increase bandwidth, but I got same results.

From the dmesg output, there is a memory limitation in the system.

[  160.782515] Unable to handle kernel NULL pointer dereference at virtual address 00000020
[  160.782717] Mem abort info:
[  160.782777]   ESR = 0x96000006
[  160.782862]   Exception class = DABT (current EL), IL = 32 bits
[  160.782971]   SET = 0, FnV = 0
[  160.783032]   EA = 0, S1PTW = 0
[  160.783091] Data abort info:
[  160.783152]   ISV = 0, ISS = 0x00000006
[  160.783221]   CM = 0, WnR = 0
[  160.783283] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc3a02d2000
[  160.783394] [0000000000000020] *pgd=00000004203d8003, *pud=00000004203d8003, *pmd=0000000000000000

I attached the full dmesg log.

Do you have more ideas about what can be causing this limitation?
dmesg.log (76.9 KB)

Hi All
The JetPack 4.2 have some memory fixed.
COuld you have a try on r32.1.