sensor driver and vi driver

Hi All,

In Jetson Tx2, We are using our sensor driver. When sensor driver attach to vi driver, then it gets corrupted as:

272796] wifi_platform_get_country_code_map: could not get country_code_map
[ 13.282440] wifi_plat_dev_drv_probe:platform country code map is not available
[ 13.291001] fpga_hdmi2csi_drv fpga_hdmi2csi: ####### fpga_convert_probe #########
[ 13.291004] fpga_hdmi2csi_drv fpga_hdmi2csi: ### memory allocated ###
[ 13.291005] fpga_hdmi2csi_drv fpga_hdmi2csi: ### device tree node found ###
[ 13.291007] fpga_hdmi2csi_drv fpga_hdmi2csi: #### Device Tree Parameters: ####
[ 13.291008] : In Probe()
[ 13.291018] ***** After media_entity_init() *****
[ 13.291754] fpga_hdmi2csi: fpga_hdmi2csi_enum_mbus_code()
[ 13.291756] fpga_hdmi2csi: code->index:0
[ 13.291757] fpga_hdmi2csi: fpga_hdmi2csi_enum_mbus_code()
[ 13.291758] fpga_hdmi2csi: code->index:1
[ 13.291760] fpga_hdmi2csi: fpga_hdmi2csi_get_fmt():
[ 13.291762] fpga_hdmi2csi: fpga_hdmi2csi_get_fmt(): width=0, height=0, code=0x0000200F, field=1
[ 13.291777] Unable to handle kernel paging request at virtual address 00020177
[ 13.291778] pgd = ffffffc1e2817000
[ 13.291781] [00020177] *pgd=0000000000000000, *pud=0000000000000000
[ 13.291784] Internal error: Oops: 96000045 [#1] PREEMPT SMP
[ 13.291788] Modules linked in: fpga_hdmi2csi_drv(+) bcmdhd(+) pci_tegra bluedroid_pm
[ 13.291792] CPU: 3 PID: 309 Comm: systemd-udevd Not tainted 4.4.38 #159
[ 13.291793] Hardware name: quill (DT)
[ 13.291795] task: ffffffc1e479e400 ti: ffffffc1e2828000 task.ti: ffffffc1e2828000
[ 13.291801] PC is at tegra_channel_s_ctrl+0x164/0x268
[ 13.291805] LR is at v4l2_ctrl_handler_setup+0xf0/0x130
[ 13.291807] pc : [] lr : [] pstate: 80000045
[ 13.291808] sp : ffffffc1e282b8b0
[ 13.291810] x29: ffffffc1e282b8b0 x28: ffffffc1eb6663c8
[ 13.291812] x27: ffffffc1e45b6550 x26: 0000000000000001
[ 13.291813] x25: ffffffc000c24000 x24: ffffffc1eb6664e0
[ 13.291815] x23: ffffffc1eb666510 x22: ffffffc1e5b2d200
[ 13.291816] x21: 0000000000000000 x20: ffffffc1e5b2d200
[ 13.291818] x19: ffffffc1eb666018 x18: 0000000000020000
[ 13.291820] x17: 000000000041a485 x16: 0000000000000001
[ 13.291821] x15: ffffffc0012381e8 x14: 0000000000000000
[ 13.291823] x13: ffffffc1eb6664e0 x12: 0000000000000000
[ 13.291824] x11: 0000000000000000 x10: ffffffc1e282b888
[ 13.291826] x9 : 0000000000000000 x8 : ffffffc1e5ba8780
[ 13.291827] x7 : 0000000000000000 x6 : ffffffc1e5b2d2bc
[ 13.291829] x5 : 0000000000000040 x4 : 00000001f4b36000
[ 13.291830] x3 : 0000000000000000 x2 : 000000000001ffba
[ 13.291832] x1 : ffffffc000c24000 x0 : ffffffc0013c1000

[ 13.291834] Process systemd-udevd (pid: 309, stack limit = 0xffffffc1e2828020)
[ 13.291835] Call trace:
[ 13.291837] [] tegra_channel_s_ctrl+0x164/0x268
[ 13.291840] [] v4l2_ctrl_handler_setup+0xf0/0x130
[ 13.291842] [] tegra_channel_init_subdevices+0x290/0x300
[ 13.291846] [] tegra_vi_graph_notify_complete+0x258/0x658

[ 13.291849] [] v4l2_async_test_notify+0xf0/0x100
[ 13.291851] [] v4l2_async_register_subdev+0x88/0x108
[ 13.291858] [] fpga_convert_probe+0x20c/0x2c0 [fpga_hdmi2csi_drv]
[ 13.291863] [] platform_drv_probe+0x50/0xb8
[ 13.291866] [] driver_probe_device+0xcc/0x428
[ 13.291868] [] __driver_attach+0x9c/0xa0
[ 13.291870] [] bus_for_each_dev+0x60/0xa0
[ 13.291871] [] driver_attach+0x20/0x28
[ 13.291873] [] bus_add_driver+0x210/0x298
[ 13.291874] [] driver_register+0x60/0xf8
[ 13.291876] [] __platform_driver_register+0x4c/0x58
[ 13.291881] [] fpga_convert_driver_init+0x18/0x30 [fpga_hdmi2csi_drv]
[ 13.291884] [] do_one_initcall+0xd0/0x1d8
[ 13.291888] [] do_init_module+0x64/0x1c4
[ 13.291891] [] load_module+0xed8/0x1198
[ 13.291893] [] SyS_finit_module+0xe0/0x110
[ 13.291895] [] el0_svc_naked+0x24/0x28
[ 13.291897] —[ end trace cadace3bdea92d26 ]—
[ 13.746833] Power-up adapter ‘DHD generic adapter’
[ 13.752970] wifi_platform_set_power = 1

Please provide your inputs.

-Thanks.

hello muhammed.asadpt,

seems you’re working with hdmi to csi driver,
could you help to generate the test pattern from the bridge to verify the driver is workable?
thanks

Hi JerryChang,

Thanks for the reply.

As per the above log,

[ 13.291837] [] tegra_channel_s_ctrl+0x164/0x268
[ 13.291840] [] v4l2_ctrl_handler_setup+0xf0/0x130
[ 13.291842] [] tegra_channel_init_subdevices+0x290/0x300
[ 13.291846] [] tegra_vi_graph_notify_complete+0x258/0x658

It gets corrupted in tegra_vi_graph_notify_complete(). It gets corrupted when setting the v4l2 ctrls.
What are the V4l2 controls required for vi driver? What is the reason for the corruption?
Since this comes from VI driver.

We set the V4l2 control V4L2_CID_DV_RX_POWER_PRESENT and Without any V4l2 controls also, it gets corrupted in same location.
Whether Vi driver expects any custom controls?

Please provide your inputs.

-Thanks.

hello muhammed.asadpt,

since you’re working with hdmi to csi driver, your bridge driver would process the hdmi-in signal into CSI signal.
in other words, tegra driver would determine this is camera sensor.
that’s why the video input (VI) driver getting involved.

moreover,
please check [release 28.1 Development Guide]-> [Camera Development]-> [Camera Software Development Solution]
for more details about V4L2 controls, thanks

Hello JerryChang,

Gone through the [release 28.1 Development Guide]-> [Camera Development]-> [Camera Software Development Solution] document.

Got the details about the V4L2 controls and Sensor Driver Programming details.

Looks like the driver is correct.

Could you please review the driver source code and provide your ideas??
Please provide your email id for this.

The Vi driver got the corruption in v4l2 subdev driver probe function itself.

-Thanks.

hello muhammed.asadpt,

our VI driver has support hdmi to csi bridge drivers.
please check Toshiba UH2C/D HDMI-CSI bridge driver, tc358840 for reference.
thanks