tegra_channel_populate_dev_info+0xf4/0x200

ALL:
We have a custom designed board(tx2),everything is ok when the version of JetPack is 3.3.

 Now we try to port it from JetPack3.3 to JetPack4.2. 

 We use Pinmux file(Version1.05). And the usb,i2c,spi all ok.

 Follow "Sensor Driver Programming Guide" of "NVIDIA_Tegra_Linux_Driver_Package"(version 4.2) . We has 

tried “Version 1.0” and “Version 2.0”.But boot failed.

 Now we try to use "Version 1.0".

 we port the sensor driver file from Jetpack3.3 to Jetpack4.2,just delete:
priv->subdev->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;

and modify function from “media_entity_init” to “tegra_media_entity_init”

 From the minicom.txt,It seems the ar0134 has been recongnized at time 3.537111 and time 3.635036 .

 We just don't know why tegra-vi4 crashed.

minicom.txt (87.1 KB)

hello XuXiang,

you got kernel panic failure due to handle unreadable memory.

[    4.506336] Unable to handle kernel read from unreadable memory at virtual address 000001d0
[    4.506336] Mem abort info:
[    4.506338]   ESR = 0x96000005
[    4.506339]   Exception class = DABT (current EL), IL = 32 bits
[    4.506340]   SET = 0, FnV = 0
[    4.506341]   EA = 0, S1PTW = 0
[    4.506341] Data abort info:
[    4.506342]   ISV = 0, ISS = 0x00000005
[    4.506343]   CM = 0, WnR = 0
[    4.506344] [00000000000001d0] user address but active_mm is swapper
[    4.506347] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[    4.506350] Modules linked in:
[    4.506353] CPU: 3 PID: 401 Comm: kworker/u12:4 Not tainted 4.9.140+ #16
[    4.506355] Hardware name: quill (DT)
[    4.506365] Workqueue: events_unbound async_run_entry_fn
[    4.506367] task: ffffffc1eb680000 task.stack: ffffffc1eb3bc000
[    4.506372] PC is at tegra_channel_populate_dev_info+0xf4/0x200
[    4.506373] LR is at tegra_channel_populate_dev_info+0xec/0x200
[    4.506375] pc : [<ffffff8008af1abc>] lr : [<ffffff8008af1ab4>] pstate: 80400045
[    4.506376] sp : ffffffc1eb3bf850
[    4.506378] x29: ffffffc1eb3bf850 x28: 0000000000000000 
[    4.506381] x27: ffffffc1eb54d518 x26: 0000000000000038 
[    4.506383] x25: 00000000009a2065 x24: ffffffc1eb4e4850 
[    4.506384] x23: ffffffc1eb54d770 x22: ffffff800900b000 
[    4.506386] x21: ffffffc1eb3bf908 x20: ffffffc1eb54d018 
[    4.506387] x19: ffffffc1eb6f7810 x18: 0000000000000001 
[    4.506389] x17: 0000000000000002 x16: 0000000000000000 
[    4.506390] x15: ffffffffffffffff x14: ffffffc1eb3bf850 
[    4.506392] x13: ffffffc1eb3bf755 x12: ffffffffffffffff 
[    4.506394] x11: ffffff8009e04000 x10: ffffff800a0b1000 
[    4.506395] x9 : 0000000000000042 x8 : 0000000000000002 
[    4.506397] x7 : ffffff8008f66e88 x6 : 0000000000000083 
[    4.506398] x5 : 000000000000008d x4 : 0000000000000001 
[    4.506400] x3 : 0000000000000000 x2 : 0000000000000000 
[    4.506401] x1 : 0000000000000000 x0 : 0000000000000000 
[    4.506402] 
[    4.506404] Process kworker/u12:4 (pid: 401, stack limit = 0xffffffc1eb3bc000)
[    4.506405] Call trace:
[    4.506408] [<ffffff8008af1abc>] tegra_channel_populate_dev_info+0xf4/0x200
[    4.506410] [<ffffff8008af3068>] tegra_channel_init_subdevices+0x2c0/0x738
[    4.506412] [<ffffff8008af4228>] tegra_vi_graph_notify_complete+0x500/0x688
[    4.506416] [<ffffff8008ad83f8>] v4l2_async_test_notify+0x108/0x120
[    4.506417] [<ffffff8008ad853c>] v4l2_async_notifier_register+0x12c/0x1a0
[    4.506419] [<ffffff8008af4ee0>] tegra_vi_graph_init+0x210/0x290
[    4.506421] [<ffffff8008aeefb8>] tegra_vi_media_controller_init+0x1a0/0x1d8
[    4.506424] [<ffffff800854e830>] tegra_vi4_probe+0x240/0x360
[    4.506428] [<ffffff8008759780>] platform_drv_probe+0x60/0xc8
[    4.506430] [<ffffff8008756d48>] driver_probe_device+0xd0/0x3f8
[    4.506432] [<ffffff8008757194>] __driver_attach+0x124/0x128
[    4.506433] [<ffffff800875487c>] bus_for_each_dev+0x74/0xb0
[    4.506435] [<ffffff8008756540>] driver_attach+0x30/0x40
[    4.506437] [<ffffff8008754e40>] driver_attach_async+0x20/0x60
[    4.506439] [<ffffff80080df8a0>] async_run_entry_fn+0x48/0x160
[    4.506441] [<ffffff80080d4e58>] process_one_work+0x1e8/0x490
[    4.506443] [<ffffff80080d5158>] worker_thread+0x58/0x4c0
[    4.506445] [<ffffff80080dbb28>] kthread+0xd8/0xf0
[    4.506448] [<ffffff8008083850>] ret_from_fork+0x10/0x40
[    4.506450] ---[ end trace 03677a26aa979a11 ]---

there are several API changes for JetPack-4.2 (kernel-4.9)
please also check Camera Sensor Drivers Porting Guide for reference since you’re working on JetPack3.3 to JetPack4.2 porting.
thanks

Thank you for your reply.

I figured it: I made a wrong dtb file.

I modified tegra186-quill-camera-modules.dtsi which is at path …/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/

#include "t18x-common-platforms/tegra186-quill-camera-e3326-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-e3323-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-e3331-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-e3333-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-e3322-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-imx185-a00.dtsi"
  <b>#include "t18x-common-platforms/tegra186-quill-camera-ar0134-li-mipi-adpt-a00.dtsi"</b>
  #include "t18x-common-platforms/tegra186-quill-camera-imx274-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-imx274-dual.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-imx390-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-vivid.dtsi"

so,the dtb file is not about camera ar0134,may be imx274 or imx390 .

the right one is:

#include "t18x-common-platforms/tegra186-quill-camera-e3326-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-e3323-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-e3331-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-e3333-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-e3322-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-imx185-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-imx274-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-imx274-dual.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-imx390-a00.dtsi"
  #include "t18x-common-platforms/tegra186-quill-camera-vivid.dtsi"
  <b>#include "t18x-common-platforms/tegra186-quill-camera-ar0134-li-mipi-adpt-a00.dtsi"</b>

someone may be need this.