Facing kernel crash in function tegra_channel_set_format with nv_imx219 driver

Hello,
I am using Jetpack 35.1 and made the imx219 driver (file: nv_imx219.c), as an inbuilt driver (CONFIG_NV_VIDEO_IMX219=y).

I have to give active_l = 0, active_t=0 in mode[n] in my device tree (integrated from imx219 device trees) in order to successfully probe the driver.

I am facing issue while executing the below command:

$  DISPLAY=:0 gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=(int)3280, height=(int)2464, format=(string)NV12, framerate=(fraction)21/1' ! perf ! fakesink
WARNING: erroneous pipeline: no element "perf"
worldcoin@tegra-ubuntu:/tmp$ DISPLAY=:0 gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=(int)3280, height=(int)2464, format=(string)NV12, framerate=(fraction)21/1' ! fakesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3280 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3280 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1640 x 1232 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 0 
   Camera mode  = 0 
   Output Stream W = 3280 H = 2464 
   seconds to Run    = 0 
   Frame Rate = 21.000000 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
[ 1498.103636] Entering function: tegra_channel_set_format line:2176               ----------------> added for tracing
[ 1498.103839] Entering function: __tegra_channel_set_frame_size line:2148      -------------------> added for tracing
[ 1498.104003] Unable to handle kernel write to read-only memory at virtual address ffffcd90c5098d60
[ 1498.104308] Mem abort info:
[ 1498.104397]   ESR = 0x9600004e
[ 1498.104472]   EC = 0x25: DABT (current EL), IL = 32 bits
[ 1498.104597]   SET = 0, FnV = 0
[ 1498.104669]   EA = 0, S1PTW = 0
[ 1498.104736] Data abort info:
[ 1498.104805]   ISV = 0, ISS = 0x0000004e
[ 1498.104892]   CM = 0, WnR = 1
[ 1498.104966] swapper pgtable: 4k pages, 48-bit VAs, pgdp=00000001da0a6000
[ 1498.105140] [ffffcd90c5098d60] pgd=000000027ffff003, p4d=000000027ffff003, pud=000000027fffe003, pmd=00600001d9a00f81
[ 1498.105413] Internal error: Oops: 9600004e [#1] PREEMPT SMP
[ 1498.105530] Modules linked in: aes_ce_ccm fuse lzo_rle lzo_compress zram realtek bnep loop iwlmvm mac80211 nvgpu snd_soc_tegra186_asrc snd_soc_tegra210_ope snd_soc_tegra186_dspk snd_soc_tegra210_iqc snd_soc_tegra186_arad ofpart snd_soc_tegra210_mvc snd_soc_tegra210_afc snd_soc_tegra210_dmic snd_soc_tegra210_mixer snd_soc_tegra210_amx cmdlinepart snd_soc_tegra210_adx snd_soc_tegra210_admaif snd_soc_tegra210_i2s qspi_mtd snd_soc_tegra_pcm mtd snd_soc_tegra210_sfc aes_ce_blk crypto_simd iwlwifi cryptd aes_ce_cipher ghash_ce sha2_ce sha256_arm64 sha1_ce btusb input_leds btrtl btbcm btintel cfg80211 snd_soc_spdif_tx snd_soc_tegra_machine_driver pwm_fan leds_gpio snd_soc_tegra210_adsp max77620_thermal snd_hda_codec_hdmi snd_soc_tegra_utils ina3221 snd_soc_simple_card_utils nvadsp snd_hda_tegra snd_hda_codec userspace_alert snd_soc_tegra210_ahub tegra_bpmp_thermal tegra210_adma snd_hda_core spi_tegra114 spi_tegra210_qspi binfmt_misc nvmap ip_tables x_tables
[ 1498.168095] CPU: 2 PID: 4336 Comm: CaptureSchedule Not tainted 5.10.104+ #7
[ 1498.175144] Hardware name: Unknown NVIDIA Jetson Xavier NX Developer Kit/NVIDIA Jetson Xavier NX Developer Kit, BIOS 1.0-d7fb19b 08/10/2022
[ 1498.188011] pstate: 20400009 (nzCv daif +PAN -UAO -TCO BTYPE=--)
[ 1498.194051] pc : tegra_channel_set_format+0xa8/0x160
[ 1498.199035] lr : tegra_channel_set_format+0x78/0x160
[ 1498.203754] sp : ffff80001c62bb90
[ 1498.207168] x29: ffff80001c62bb90 x28: ffff70233238d300 
[ 1498.212677] x27: 00000000c0d05605 x26: 0000000000000000 
[ 1498.218189] x25: ffff70233238d000 x24: ffff7024576231f8 
[ 1498.223702] x23: ffff702457623080 x22: ffff70233238d000 
[ 1498.229214] x21: ffff702300f23080 x20: ffffcd90c5500920 
[ 1498.234744] x19: ffffcd90c50a7158 x18: 0000000000000010 
[ 1498.240495] x17: 0000000000000000 x16: 0000000000000000 
[ 1498.245920] x15: ffff702334a0cf30 x14: ffffffffffffffff 
[ 1498.251433] x13: ffff80009c62b887 x12: ffff80001c62b88f 
[ 1498.256946] x11: 0101010101010101 x10: ffffcd90c5d6faa8 
[ 1498.262459] x9 : ffffcd90c3dfab2c x8 : 0000000000000001 
[ 1498.267970] x7 : 0000000000017fe8 x6 : c0000000ffffefff 
[ 1498.273483] x5 : ffff70247fdf3958 x4 : 0000000000000000 
[ 1498.278925] x3 : 0000000000000001 x2 : e2b61490a26e2100 
[ 1498.283987] x1 : 0000000000000cd0 x0 : ffffcd90c5098d60 
[ 1498.289583] Call trace:
[ 1498.291784]  tegra_channel_set_format+0xa8/0x160
[ 1498.296590]  v4l_s_fmt+0x308/0x570
[ 1498.299998]  __video_do_ioctl+0x180/0x3f0
[ 1498.303780]  video_usercopy+0x280/0x790
[ 1498.307785]  video_ioctl2+0x20/0x160
[ 1498.311484]  v4l2_ioctl+0x48/0x70
[ 1498.314444]  __arm64_sys_ioctl+0xb0/0x100
[ 1498.318489]  el0_svc_common.constprop.0+0x80/0x1d0
[ 1498.323536]  do_el0_svc+0x2c/0xa0
[ 1498.326970]  el0_svc+0x20/0x30
[ 1498.329666]  el0_sync_handler+0xb0/0xc0
[ 1498.333687]  el0_sync+0x184/0x1c0
[ 1498.337103] Code: b94226a1 7100003f 540000ad b9400ac1 (b9000001) 
[ 1498.343229] ---[ end trace 48df56f1e5d208b6 ]---
[ 1498.347515] Kernel panic - not syncing: Oops: Fatal exception
[ 1498.353372] SMP: stopping secondary CPUs
[ 1498.356720] Kernel Offset: 0x4d90b3cf0000 from 0xffff800010000000
[ 1498.363171] PHYS_OFFSET: 0xffff8fde00000000
[ 1498.367115] CPU features: 0x8240002,03802a30
[ 1498.371414] Memory Limit: none
[ 1498.374468] ---[ end Kernel panic - not syncing: Oops: Fatal exception ]---
��

Below is the output of command: v4l2-ctl -d /dev/video1 --all

$ v4l2-ctl -d /dev/video1 --all
Driver Info:
	Driver name      : tegra-video
	Card type        : vi-output, imx219 10-0010
	Bus info         : platform:tegra-capture-vi:2
	Driver version   : 5.10.104
	Capabilities     : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Media Driver Info:
	Driver name      : tegra-camrtc-ca
	Model            : NVIDIA Tegra Video Input Device
	Serial           : 
	Bus info         : 
	Media version    : 5.10.104
	Hardware revision: 0x00000003 (3)
	Driver version   : 5.10.104
Interface Info:
	ID               : 0x03000020
	Type             : V4L Video
Entity Info:
	ID               : 0x0000001e (30)
	Name             : vi-output, imx219 10-0010
	Function         : V4L2 I/O
	Pad 0x0100001f   : 0: Sink
	  Link 0x02000024: from remote pad 0x1000006 of entity '13e10000.host1x:nvcsi@15a00000-': Data, Enabled
Priority: 2
Video input : 0 (Camera 2: ok)
Format Video Capture:
	Width/Height      : 3280/2464
	Pixel Format      : 'RG10' (10-bit Bayer RGRG/GBGB)
	Field             : None
	Bytes per Line    : 6560
	Size Image        : 16163840
	Colorspace        : sRGB
	Transfer Function : Default (maps to sRGB)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Full Range)
	Flags             : 
Selection Video Capture: crop, Left 0, Top 0, Width 3280, Height 2464, Flags: 
Selection Video Output: crop, Left 0, Top 0, Width 3280, Height 2464, Flags: 

Camera Controls

                     group_hold 0x009a2003 (bool)   : default=0 value=0 flags=execute-on-write
                    sensor_mode 0x009a2008 (int64)  : min=0 max=5 step=1 default=0 value=0 flags=slider
                           gain 0x009a2009 (int64)  : min=16 max=170 step=1 default=16 value=16 flags=slider
                       exposure 0x009a200a (int64)  : min=13 max=683709 step=1 default=2495 value=13 flags=slider
                     frame_rate 0x009a200b (int64)  : min=2000000 max=21000000 step=1 default=21000000 value=2000000 flags=slider
           sensor_configuration 0x009a2032 (u32)    : min=0 max=4294967295 step=1 default=0 [22] flags=read-only, volatile, has-payload
         sensor_mode_i2c_packet 0x009a2033 (u32)    : min=0 max=4294967295 step=1 default=0 [1026] flags=read-only, volatile, has-payload
      sensor_control_i2c_packet 0x009a2034 (u32)    : min=0 max=4294967295 step=1 default=0 [1026] flags=read-only, volatile, has-payload
                    bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=0
				0: 0 (0x0)
				1: 1 (0x1)
                override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=0
				0: 0 (0x0)
				1: 1 (0x1)
                   height_align 0x009a2066 (int)    : min=1 max=16 step=1 default=1 value=1
                     size_align 0x009a2067 (intmenu): min=0 max=2 default=0 value=0
				0: 1 (0x1)
				1: 65536 (0x10000)
				2: 131072 (0x20000)
               write_isp_format 0x009a2068 (int)    : min=1 max=1 step=1 default=1 value=1
       sensor_signal_properties 0x009a2069 (u32)    : min=0 max=4294967295 step=1 default=0 [30][18] flags=read-only, has-payload
        sensor_image_properties 0x009a206a (u32)    : min=0 max=4294967295 step=1 default=0 [30][18] flags=read-only, has-payload
      sensor_control_properties 0x009a206b (u32)    : min=0 max=4294967295 step=1 default=0 [30][36] flags=read-only, has-payload
              sensor_dv_timings 0x009a206c (u32)    : min=0 max=4294967295 step=1 default=0 [30][16] flags=read-only, has-payload
               low_latency_mode 0x009a206d (bool)   : default=0 value=0
               preferred_stride 0x009a206e (int)    : min=0 max=65535 step=1 default=0 value=0
                   sensor_modes 0x009a2082 (int)    : min=0 max=30 step=1 default=30 value=5 flags=read-only
$

Could anyone point why I might facing the issue in function: __tegra_channel_set_frame_size

Many thanks!!

The default have include the nv_imx219.ko at /lib/modules/5.10.104-tegra/
Please use this default kernel module instead of customized driver to try.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.