A strange problem about camera driver

Hi

I made a driver for my sensor, the video format is 1920x1080 YUV422. It works well on kernel-4.4. After I upgrade to kernel-4.9, it does not work again. I changed the sensor_commen.c, camera_common.c to support YUV, like before, and I changed my driver based on IMX185.c.

What happended ? And how should I do next to fix my bugs. Please help me, I have been trapped here for several days.

Can’t help with much less information.
Did you rewrite the driver by reference to imx185 in k4.9?

Yes, in fact, I remove the I2C partment of IMX185.c and rename it.

If I power on my sensor, the dmesg is:

nvcs 150c0000.nvcsi:icsi_stream_check_status(0) ERROR_STATUS2VI_VC0 = 0x0000000e
nvcs 150c0000.nvcsi:csi_stream_check_status(0) ERROR_STATUS2VI_VC1 = 0x0000000a
nvcs 150c0000.nvcsi:csi_stream_check_status(0) INTR_STATUS = 0x000100aa
nvcs 150c0000.nvcsi:csi_stream_check_status(0) ERR_INTR_STATUS = 0x000100aa
tegra-vi4 15700000.vi: PXL_SOF syncpt tiemout! err = -11
tegra-vi4 15700000.vi: tegra_channel_error_recovery: attempting to reset the capture channel

If I power off my sensor, the dmesg is:
tegra-vi4 15700000.vi: PXL_SOF syncpt tiemout! err = -11
tegra-vi4 15700000.vi: tegra_channel_error_recovery: attempting to reset the capture channel

The error must be out of somewhere. But I can’t find it, even if I compare the kernel-4.9 and kernel-4.4.

Modes in device-tree are the same to those in my driver. I tested it in a jetson-tx2 board:

v4l2-ctl --set-fmt-video=width=1920,height=1080 -d /dev/video1
v4l2-ctl --stream-mmap --stream-to=/tmp/1.yuv --stream-count=10 -d /dev/video1

These commands worked, and the captured frames are correct, but /dev/video0, /dev/video2, /dev/vedio4 failed.
So I had the driver tested on another jetson-tx2 board, none worked, even the /dev/video1.

By the way, can you give me some docuemnts that described the definitions of those registers?

                                                                   Thanks very very much.

You should be able get the REG information from the TRM download from the download center.
You should have a check the trace log.

Hi ShaneCCC

I enable the trace log, got:

kworker/4:1-1316 [004] … 1662.917439: rtos_queue_peek_from_isr_failed: tstamp:52316969551 queue:0x0b4b4500
kworker/4:1-1316 [004] … 1663.029456: rtos_queue_peek_from_isr_failed: tstamp:52321969558 queue:0x0b4b4500
kworker/4:1-1316 [004] … 1663.085445: rtos_queue_peek_from_isr_failed: tstamp:52322793312 queue:0x0b4b4500
v4l2-ctl-6837 [003] … 1683.070737: tegra_channel_open: vi-output, daxc02 2-0017
v4l2-ctl-6837 [000] … 1683.072607: tegra_channel_set_power: daxc02 2-0017 : 0x1
v4l2-ctl-6837 [000] … 1683.072630: camera_common_s_power: status : 0x1
v4l2-ctl-6837 [000] … 1683.072669: tegra_channel_set_power: 150c0000.nvcsi–6 : 0x1
v4l2-ctl-6837 [000] … 1683.072674: csi_s_power: enable : 0x1
v4l2-ctl-6837 [005] … 1683.087352: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt cb
vi-output, daxc-6838 [004] … 1683.087534: tegra_channel_set_stream: enable : 0x1
vi-output, daxc-6838 [000] … 1683.093995: tegra_channel_set_stream: 150c0000.nvcsi–6 : 0x1
vi-output, daxc-6838 [000] … 1683.093997: csi_s_stream: enable : 0x1
vi-output, daxc-6838 [000] … 1683.094023: tegra_channel_set_stream: daxc02 2-0017 : 0x1
kworker/4:1-1316 [004] … 1683.137416: rtos_queue_peek_from_isr_failed: tstamp:52948774545 queue:0x0b4b4500
kworker/4:1-1316 [004] … 1683.137423: rtcpu_start: tstamp:52948775965
kworker/4:1-1316 [004] … 1683.137427: rtos_queue_send_from_isr_failed: tstamp:52948841991 queue:0x0b4a7258

How should I do next step ?

Best regards.

Thanks, problem resolved.