Kernel crash when capture mipi csi video

Hello forum,

I am using 16G-EMMC NX with Jetpack4.4 to capture a pre-configured csi video,1920x1080@30fps UYVY, 4lane, connect to our carrier board CSI port0 and port1.
nv_tegra_release:# R32 (release), REVISION: 4.3, GCID: 21589087, BOARD: t186ref, EABI: aarch64, DATE: Fri Jun 26 04:34:27 UTC 2020

I got kernel crash when capture video0 raw data:

v4l2-ctl -d /dev/video0 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.raw --set-fmt-video=width=1920,height=1080,pixelformat=UYVY

kernel log:
crash.log (37.4 KB)

Can anybody tell me what is going wrong here…
Thanks so much.

Hello, I need help.

Thanks.

。。。。

Are you able to get the trace log.

Hello,ShaneCCC

this is the trace log,

root@nvidia:/home/nvidia# tail -f /sys/kernel/debug/tracing/trace
 kworker/0:2-1141  [000] ....  1610.973731: rtos_queue_peek_from_isr_failed: tstamp:50664402660 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1611.141733: rtos_queue_peek_from_isr_failed: tstamp:50669402661 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1611.253793: rtos_queue_peek_from_isr_failed: tstamp:50674402661 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1611.421736: rtos_queue_peek_from_isr_failed: tstamp:50679402660 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1611.589736: rtos_queue_peek_from_isr_failed: tstamp:50684402661 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1611.757746: rtos_queue_peek_from_isr_failed: tstamp:50689402660 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1611.925731: rtos_queue_peek_from_isr_failed: tstamp:50694402660 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1612.093729: rtos_queue_peek_from_isr_failed: tstamp:50699402661 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1612.261725: rtos_queue_peek_from_isr_failed: tstamp:50704402661 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1612.373738: rtos_queue_peek_from_isr_failed: tstamp:50709276237 queue:0x0bcbcf78

tail: /sys/kernel/debug/tracing/trace: file truncated

tracer: nop

entries-in-buffer/entries-written: 30/30 #P:6

_-----=> irqs-off

/ _----=> need-resched

| / _—=> hardirq/softirq

|| / _–=> preempt-depth

||| / delay

TASK-PID CPU# |||| TIMESTAMP FUNCTION

| | | |||| | |

 kworker/0:2-1141  [000] ....  1607.781754: rtos_queue_peek_from_isr_failed: tstamp:50564402661 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1607.893748: rtos_queue_peek_from_isr_failed: tstamp:50569402661 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1608.061748: rtos_queue_peek_from_isr_failed: tstamp:50574402661 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1608.229750: rtos_queue_peek_from_isr_failed: tstamp:50579402660 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1608.397739: rtos_queue_peek_from_isr_failed: tstamp:50584402660 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1608.565745: rtos_queue_peek_from_isr_failed: tstamp:50589402656 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1608.733754: rtos_queue_peek_from_isr_failed: tstamp:50594402665 queue:0x0bcbcf78
 kworker/0:2-1141  [000] ....  1608.901778: rtos_queue_peek_from_isr_failed: tstamp:50599402660 queue:0x0bcbcf78

The trace log show didn’t receive any data from the MIPI bus,
Could you don’t program the sensor streaming on to check if the kernel crash cause by NVCSI/VI didn’t receive data or the sensor driver cause it.

Hi, ShaneCCC,
If I turn off the mipi output then v4l2-ctl will not cause kernel crash.

OK, from the trace NVCSI/VI didn’t receive any validate data from the MIPI bus.
I think you may need to probe the MIPI signal to make sure the sensor output data as MIPI spec.

Hi,ShaneCCC
Could you please help me check my dts code?

The MIPI signal works fine on TX2,the mipi output without cam_i2c,I changed ov5693 driver code and dts to capture the video.And on NX I test with IMX219.

Is there any different between tx2 and nx nvcsi/vi driver code?

mipi-csi-test.txt (3.4 KB)

Not sure if below cause the problem.

pixel_t Deprecated. Use the following properties instead:

•mode_type

•csi_pixel_bit_depth

•pixel_phase

Hi ShaneCCC,

I have already add the 3 properties and get same error:
mode_type = “yuv”;
pixel_phase = “uyvy”;
csi_pixel_bit_depth = “16”;

Maybe you may need to check if the sensor is connect to the right lanes due to didn’t receive any validate data.

Hello, ShaneCCC

V4l2-ctl cmd will not cause kernel crash now,I get new trace log as below:
trace.log (33.8 KB)
Please have a look.

Thanks

It could be HW or signal issue.
Have a check the TRM the REG NVCSI_PHY_0_CILA_INTR_0_STATUS_CILA_0

     kworker/0:3-1652  [000] ....   297.394745: rtcpu_nvcsi_intr: tstamp:9615489190 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x1e000044
     kworker/0:3-1652  [000] ....   297.394746: rtcpu_nvcsi_intr: tstamp:9615489190 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x06000040
     kworker/0:3-1652  [000] ....   297.394747: rtcpu_nvcsi_intr: tstamp:9615489190 class:CORRECTABLE_ERR type:PHY_INTR phy:0 cil:0 st:0 vc:0 status:0x00001e44
     kworker/0:3-1652  [000] ....   297.394748: rtcpu_nvcsi_intr: tstamp:9615489190 class:CORRECTABLE_ERR type:PHY_INTR phy:0 cil:1 st:0 vc:0 status:0x00000640
     kworker/0:3-1652  [000] ....   297.394749: rtcpu_nvcsi_intr: tstamp:9615492827 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x0e000000
     kworker/0:3-1652  [000] ....   297.394750: rtcpu_nvcsi_intr: tstamp:9615492827 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x06000000