Kernel panic i2c

Jetpack 5.1.4
Custom board (with dev board the same behaver)

I get kernel panic when 2 cameras defined in device tree and not connected to the board.
In jetpack 4.6.x everything is fine.

When cameras are connected to the board everything is ok.
When only 1 camera is defined in DT and not connected everything is ok also.

Problem persists only when 2 cameras are defined and not connected.

[    6.346720] tegra-xudc 3550000.xudc: failed to get usbphy-0: -517
[    6.361813] imx678 1-001a: tegracam sensor driver:imx678_v2.0.6
[    6.362835] imx678 1-001a: imx678_board_setup: error during i2c read probe (-121)
[    6.363150] imx678 1-001a: board setup failed
[    6.367051] imx678: probe of 1-001a failed with error -121
[    6.377428] imx678 2-001a: tegracam sensor driver:imx678_v2.0.6
[    6.378359] Unable to handle kernel paging request at virtual address ffff46e06d7b6120
[    6.386141] Mem abort info:
[    6.388647]   ESR = 0x96000005
[    6.391734]   EC = 0x25: DABT (current EL), IL = 32 bits
[    6.397112]   SET = 0, FnV = 0
[    6.400236]   EA = 0, S1PTW = 0
[    6.403311] Data abort info:
[    6.406252]   ISV = 0, ISS = 0x00000005
[    6.409750]   CM = 0, WnR = 0
[    6.412891] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000250d22000
[    6.419584] [ffff46e06d7b6120] pgd=000000027fff8003, p4d=000000027fff8003, pud=0000000000000000
[    6.428313] Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP
[    6.434496] Modules linked in:
[    6.437660] CPU: 2 PID: 114 Comm: kworker/2:3 Not tainted 5.10.216-tegra #7
[    6.444900] Hardware name: NVIDIA NVIDIA Jetson Xavier NX Developer Kit/Jetson, BIOS 6.0-37391689 08/28/2024
[    6.454461] Workqueue: events deferred_probe_work_func
[    6.459527] pstate: 60c00009 (nZCv daif +PAN +UAO -TCO BTYPE=--)
[    6.465660] pc : tegra_prod_set_tuple+0x38/0xa0
[    6.470278] lr : tegra_prod_set_tuple+0x28/0xa0
[    6.475039] sp : ffff800010c7b260
[    6.478074] x29: ffff800010c7b260 x28: ffffc1ee23118900 
[    6.483663] x27: 0000000000000000 x26: ffff46dfaa0e8ec0 
[    6.488826] x25: ffff800011761000 x24: 000000000000008c 
[    6.494167] x23: 0000000000000010 x22: ffff46de450a34e0 
[    6.499933] x21: ffff46de450a34e0 x20: 00000000000000ff 
[    6.505361] x19: ffff46de450ceb90 x18: 0000000000000010 
[    6.510529] x17: 00000000e84989de x16: 0000000000000068 
[    6.516334] x15: ffff46dfaa0e9430 x14: ffffffffffffffff 
[    6.521465] x13: 0000000000000030 x12: 0101010101010101 
[    6.527147] x11: 0000000000000040 x10: ffffc1ee231a7c60 
[    6.532446] x9 : 0000000000000008 x8 : 0000000000000008 
[    6.537996] x7 : ffffc1ee226c2870 x6 : 0000000000000020 
[    6.543116] x5 : 0000000000000020 x4 : 0000000000000005 
[    6.548765] x3 : 0000000000000308 x2 : 00000000ffff46de 
[    6.554127] x1 : ffff46de450ceb90 x0 : 00000000450e2588 
[    6.559180] Call trace:
[    6.561274] usb 1-2: new high-speed USB device number 2 using tegra-xusb
[    6.561642]  tegra_prod_set_tuple+0x38/0xa0
[    6.561696]  tegra_prod_set.part.0+0x5c/0x90
[    6.561727]  tegra_prod_set_by_name+0x7c/0xb0
[    6.581075]  tegra_i2c_config_prod_settings+0x74/0xb0
[    6.586133]  tegra_i2c_init+0xd4/0x320
[    6.590150]  tegra_i2c_xfer_msg.part.0+0x454/0x6d0
[    6.594706]  tegra_i2c_xfer+0x84/0x2d0
[    6.598745]  __i2c_transfer+0x1b8/0x6d0
[    6.602407]  i2c_transfer+0xe0/0x120
[    6.605921]  regmap_i2c_read+0x7c/0xd0
[    6.609965]  _regmap_raw_read+0xd8/0x2f0
[    6.613431]  _regmap_bus_read+0x58/0x90
[    6.617632]  _regmap_read+0x6c/0x1c0
[    6.621124]  regmap_read+0x54/0x80
[    6.624151]  imx678_probe+0x198/0x340
[    6.627607]  i2c_device_probe+0xb0/0x2e0
[    6.631801]  really_probe+0xf8/0x3f0
[    6.635177]  driver_probe_device+0x60/0x100
[    6.639334]  __device_attach_driver+0xb8/0xe0
[    6.643877]  bus_for_each_drv+0x8c/0xe0
[    6.647466]  __device_attach+0x100/0x190
[    6.651488]  device_initial_probe+0x28/0x40
[    6.655514]  bus_probe_device+0xa4/0xb0
[    6.659193]  device_add+0x36c/0x780
[    6.662728]  device_register+0x2c/0x40
[    6.666713]  i2c_new_client_device+0x148/0x280
[    6.670871]  of_i2c_register_device+0x88/0xb0
[    6.675287]  of_i2c_register_devices+0xa4/0x130
[    6.680015]  i2c_register_adapter+0x240/0x650
[    6.684132]  __i2c_add_numbered_adapter+0x64/0xb0
[    6.688771]  i2c_add_adapter+0xa8/0xe0
[    6.692962]  i2c_add_numbered_adapter+0x40/0x50
[    6.697692]  tegra_i2c_probe+0x4ec/0x6e0
[    6.701283]  platform_drv_probe+0x5c/0xb0
[    6.705481]  really_probe+0xf8/0x3f0
[    6.709156]  driver_probe_device+0x60/0x100
[    6.713182]  __device_attach_driver+0xb8/0xe0
[    6.717905]  bus_for_each_drv+0x8c/0xe0
[    6.721579]  __device_attach+0x100/0x190
[    6.725690]  device_initial_probe+0x28/0x40
[    6.726721] usb 1-2: New USB device found, idVendor=0bda, idProduct=5411, bcdDevice= 1.01
[    6.729761]  bus_probe_device+0xa4/0xb0
[    6.729787]  deferred_probe_work_func+0x90/0xd0
[    6.738032] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    6.741560]  process_one_work+0x1c4/0x4c0
[    6.741583]  worker_thread+0x200/0x450
[    6.746110] usb 1-2: Product: 4-Port USB 2.1 Hub
[    6.753357]  kthread+0x148/0x170
[    6.753378]  ret_from_fork+0x10/0x18
[    6.753471] Code: 35000054 b9400a74 b40002f3 29400a60 (f8607aa3) 
[    6.757576] usb 1-2: Manufacturer: Generic
[    6.761635] ---[ end trace 514367fe4189e21d ]---
[    6.769107] hub 1-2:1.0: USB hub found
[    6.769283] Kernel panic - not syncing: Oops: Fatal exception
[    6.769293] SMP: stopping secondary CPUs
[    6.769383] Kernel Offset: 0x41ee113e0000 from 0xffff800010000000
[    6.769386] PHYS_OFFSET: 0xffffb922c0000000
[    6.769395] CPU features: 0x48240002,03802a30
[    6.769400] Memory Limit: none
[    6.819069] ---[ end Kernel panic - not syncing: Oops: Fatal exception ]---

Could you remove all I2C access code to narrow down it.

I did it and then everything fine.

Maybe narrow down which line cause the panic.

It’s line with first try to communicate with i2c.
The same with imx477 driver.

Please check reference sensor driver for the i2c function if any different with JP4.

it’s 100% the same

Using reference sensor driver like nv_imx219.c as template to implement your driver again.

Thanks

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