Facing problem to get ov5645 work on db820c 4.11 kernel

Hi,
need help on this.

im trying to up ov5645 on db820c 4.11 kernel.
probe is succeeded and entity is created

  • entity 158: ov5645 3-003b (1 pad, 1 link)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev15
    pad0: Source
    [fmt:UYVY8_2X8/1920x1080 field:none colorspace:srgb
    crop:(0,0)/1920x1080]
    → “msm_csiphy0”:0 [ENABLED,IMMUTABLE]

then configured pipeline as below
sudo media-ctl -d /dev/media0 -l ‘“msm_csiphy0”:1->“msm_csid0”:0[1],“msm_csid0”:1->“msm_ispif0”:0[1],“msm_ispif0”:1->“msm_vfe0_rdi0”:0[1]’

sudo media-ctl -d /dev/media0 -V ‘“ov5645 3-003b”:0[fmt:UYVY8_2X8/1920x1080 field:none],“msm_csiphy0”:0[fmt:UYVY8_2X8/1920x1080 field:none],“msm_csid0”:0[fmt:UYVY8_2X8/1920x1080 field:none],“msm_ispif0”:0[fmt:UYVY8_2X8/1920x1080 field:none],“msm_vfe0_rdi0”:0[fmt:UYVY8_2X8/1920x1080 field:none]’

then tried to get preview with below command but it got failed.
gst-launch-1.0 v4l2src ! ‘video/x-raw,format=UYVY,width=1920,height=1080’ ! glimagesink

error logs:
Setting pipeline to PAUSED …
ERROR: Pipeline doesn’t want to pause.
Got context from element ‘sink’: gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"(GstGLDisplayX11)\ gldisplayx11-0";
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not open device ‘/dev/video0’ for reading and writing.
Additional debug info:
v4l2_calls.c(626): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: Input/output error
Setting pipeline to NULL …
Freeing pipeline …

and also

root@linaro-alip:~# [ 1111.946486]i2c-qcom-cci a0c000.qcom,cci: MASTER_0 error 0x08000000
[ 1111.946536] i2c-qcom-cci a0c000.qcom,cci: master 0 queue 0 error -5
[ 1111.951580] i2c-qcom-cci a0c000.qcom,cci: cci i2c xfer error -5
[ 1111.957872] ov5645 4-003b: ov5645_write_reg_to: write reg error -5 on addr 0x3c: reg=0x3100, val=0x76
[ 1111.963740] ov5645 4-003b: could not change i2c address
[ 1111.973169] qcom-camss a34000.camss: Failed to power up pipeline: -5
[ 1111.978657] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[ 1111.985276] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[ 1111.991214] qcom-camss a34000.camss: VFE HW Version = 0x70020000

Thanks,
Laxman

Hi,

The open of /dev/video0 has failed because on open the subdevices linked to that video node will get powered on and as seen from your logs the power on of the sensor has failed. The first I2C operation which is change of the I2C address has failed - and this is part of the power on sequence. The strange thing is that if probe has succeeded, this means that the power on has already succeeded once (on probe) but it fails later. Why this happens? Maybe you have more details about your system, what could have changed so the power on of the sensor has succeeded once but failed after that?

Hi todor,
still struggling to get this up.can you help on this to debug.

following crash has been seen only with camera changes. is this might be the issue?
WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:637 clk_core_disable+0x78/0x80
[ 6.037425] Modules linked in:
[ 6.045110]
[ 6.048155] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.11-tordox #47
[ 6.049816] Hardware name: Qualcomm Technologies, Inc. DB820c (DT)
[ 6.056154] task: ffff8000f9260000 task.stack: ffff8000f925c000
[ 6.062234] PC is at clk_core_disable+0x78/0x80
[ 6.068041] LR is at clk_core_disable_lock+0x20/0x38
[ 6.072556] pc : [] lr : [] pstate: 800001c5
[ 6.077786] sp : ffff8000f925f940
[ 6.085131] x29: ffff8000f925f940 x28: 0000000000000000
[ 6.088353] x27: ffff0000091a7000 x26: ffff000008f731c8
[ 6.093734] x25: 0000000000000000 x24: ffff0000091ad8c8
[ 6.099029] x23: 0000000000000001 x22: 0000000000000000
[ 6.104325] x21: ffff8000f7c40700 x20: ffff8000f7c2ce00
[ 6.109620] x19: 0000000000000140 x18: 0000000000000000
[ 6.114914] x17: 0000000000000000 x16: 000000000001c200
[ 6.120209] x15: ffffffffffffffff x14: ffff8000f880d91c
[ 6.125505] x13: ffff8000f880d191 x12: 0000000000000000
[ 6.130801] x11: 00000000c00001fe x10: ffff000009ed0068
[ 6.136095] x9 : 0000000000008000 x8 : 0000000000001000
[ 6.141391] x7 : 0000000000000002 x6 : 0000000010399a91
[ 6.146685] x5 : 00ffffffffffffff x4 : 0001312cfdcb2800
[ 6.151981] x3 : 0000000000000018 x2 : 0000000000a900a8
[ 6.157275] x1 : 0000000000000000 x0 : ffff8000f7c2ce00
[ 6.162570]
[ 6.167860] —[ end trace 5131352394cbee26 ]—
[ 6.169344] Call trace:
[ 6.173934] Exception stack(0xffff8000f925f770 to 0xffff8000f925f8a0)
[ 6.176123] f760: 0000000000000140 0001000000000000
[ 6.182740] f780: ffff8000f925f940 ffff0000084c9ff0 ffff8000fe3b6b68 ffff8000f9351b80
[ 6.190552] f7a0: 0000000000000001 ffff8000fe3b6b00 ffff8000f925f7e0 ffff00000861ff6c
[ 6.198364] f7c0: ffff8000f7c24c00 0000000000000100 0000000000000001 ffff8000f9351b00
[ 6.206175] f7e0: ffff8000f925f7f0 ffff000008621b00 ffff8000f925f820 ffff00000861ff6c
[ 6.213988] f800: ffff8000f7c24c00 0000000000003c48 ffff8000f7c2ce00 0000000000000000
[ 6.221802] f820: 0000000000a900a8 0000000000000018 0001312cfdcb2800 00ffffffffffffff
[ 6.229613] f840: 0000000010399a91 0000000000000002 0000000000001000 0000000000008000
[ 6.237426] f860: ffff000009ed0068 00000000c00001fe 0000000000000000 ffff8000f880d191
[ 6.245238] f880: ffff8000f880d91c ffffffffffffffff 000000000001c200 0000000000000000
[ 6.253056] [] clk_core_disable+0x78/0x80
[ 6.260843] [] clk_disable+0x1c/0x30
[ 6.266229] [] gdsc_disable+0x160/0x1b8
[ 6.271440] [] genpd_power_off+0xf8/0x250
[ 6.276902] [] genpd_power_off+0x184/0x250
[ 6.282285] [] genpd_runtime_suspend+0x1b4/0x280
[ 6.288196] [] __rpm_callback+0xe0/0x258
[ 6.294178] [] rpm_callback+0x24/0x98
[ 6.299644] [] rpm_suspend+0xdc/0x4e8
[ 6.304763] [] rpm_idle+0x124/0x140
[ 6.309973] [] __pm_runtime_idle+0x58/0x98
[ 6.315189] [] arm_smmu_device_probe+0xcf4/0xe10
[ 6.320920] [] platform_drv_probe+0x58/0xc0
[ 6.326904] [] driver_probe_device+0x354/0x470
[ 6.332721] [] __driver_attach+0x114/0x118
[ 6.338795] [] bus_for_each_dev+0x64/0xa0
[ 6.344436] [] driver_attach+0x20/0x28
[ 6.349729] [] bus_add_driver+0x1f0/0x2a8
[ 6.355287] [] driver_register+0x60/0xf8
[ 6.360584] [] __platform_driver_register+0x40/0x48
[ 6.366149] [] arm_smmu_driver_init+0x1c/0x24
[ 6.372653] [] do_one_initcall+0x38/0x120
[ 6.378385] [] kernel_init_freeable+0x198/0x238
[ 6.383941] [] kernel_init+0x10/0x100
[ 6.390181] [] ret_from_fork+0x10/0x50
[ 6.395333] ------------[ cut here ]------------
[ 6.400778] WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:519 clk_core_unprepare+0x80/0x90
[ 6.405393] Modules linked in:
[ 6.413425]
[ 6.416294] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.11-tordox #47
[ 6.417979] Hardware name: Qualcomm Technologies, Inc. DB820c (DT)
[ 6.425337] task: ffff8000f9260000 task.stack: ffff8000f925c000
[ 6.431590] PC is at clk_core_unprepare+0x80/0x90
[ 6.437402] LR is at clk_unprepare+0x28/0x40
[ 6.442256] pc : [] lr : [] pstate: 60000145
[ 6.446621] sp : ffff8000f925f950
[ 6.453968] x29: ffff8000f925f950 x28: 0000000000000000
[ 6.457190] x27: ffff0000091a7000 x26: ffff000008f731c8
[ 6.462570] x25: 0000000000000000 x24: ffff0000091ad8c8
[ 6.467866] x23: 0000000000000001 x22: 0000000000000000
[ 6.473161] x21: ffff8000f7c40700 x20: 0000000000000001
[ 6.478457] x19: ffff8000f7c2ce00 x18: 0000000000000000
[ 6.483750] x17: 0000000000000000 x16: 000000000001c200
[ 6.489046] x15: ffffffffffffffff x14: ffff8000f880d91c
[ 6.494341] x13: ffff8000f880d191 x12: 0000000000000000
[ 6.499636] x11: 00000000c00001fe x10: ffff000009ed0068
[ 6.504931] x9 : 0000000000008000 x8 : 0000000000001000
[ 6.510227] x7 : 0000000000000002 x6 : 0000000010399a91
[ 6.515521] x5 : 0000000000000000 x4 : 0000000000000000
[ 6.520818] x3 : ffff8000f9260000 x2 : ffff8000f9260000
[ 6.526111] x1 : 0000000000000000 x0 : ffff8000f7c2ce00
[ 6.531407]
[ 6.536685] —[ end trace 5131352394cbee27 ]—
[ 6.538175] Call trace:
[ 6.542769] Exception stack(0xffff8000f925f780 to 0xffff8000f925f8b0)
[ 6.544961] f780: ffff8000f7c2ce00 0001000000000000 ffff8000f925f950 ffff0000084c9dc8
[ 6.551577] f7a0: 0000000000000001 ffff8000fe3b6b00 ffff8000f925f7e0 ffff00000861ff6c
[ 6.559390] f7c0: ffff8000f7c24c00 0000000000000100 0000000000000001 ffff8000f9351b00
[ 6.567201] f7e0: ffff8000f925f7f0 ffff000008621b00 ffff8000f925f820 ffff00000861ff6c
[ 6.575013] f800: ffff00000935a178 0000000000000140 00000000000000a9 ffff00000935a170
[ 6.582826] f820: ffff8000f7c2ce00 0000000000000000 ffff8000f9260000 ffff8000f9260000
[ 6.590637] f840: 0000000000000000 0000000000000000 0000000010399a91 0000000000000002
[ 6.598450] f860: 0000000000001000 0000000000008000 ffff000009ed0068 00000000c00001fe
[ 6.606262] f880: 0000000000000000 ffff8000f880d191 ffff8000f880d91c ffffffffffffffff
[ 6.614074] f8a0: 000000000001c200 0000000000000000
[ 6.621865] [] clk_core_unprepare+0x80/0x90
[ 6.626559] [] gdsc_disable+0x168/0x1b8
[ 6.632459] [] genpd_power_off+0xf8/0x250
[ 6.637840] [] genpd_power_off+0x184/0x250
[ 6.643222] [] genpd_runtime_suspend+0x1b4/0x280
[ 6.649130] [] __rpm_callback+0xe0/0x258
[ 6.655114] [] rpm_callback+0x24/0x98
[ 6.660580] [] rpm_suspend+0xdc/0x4e8
[ 6.665703] [] rpm_idle+0x124/0x140
[ 6.670910] [] __pm_runtime_idle+0x58/0x98
[ 6.676121] [] arm_smmu_device_probe+0xcf4/0xe10
[ 6.681854] [] platform_drv_probe+0x58/0xc0
[ 6.687839] [] driver_probe_device+0x354/0x470
[ 6.693657] [] __driver_attach+0x114/0x118
[ 6.699731] [] bus_for_each_dev+0x64/0xa0
[ 6.705372] [] driver_attach+0x20/0x28
[ 6.710667] [] bus_add_driver+0x1f0/0x2a8
[ 6.716223] [] driver_register+0x60/0xf8
[ 6.721521] [] __platform_driver_register+0x40/0x48
[ 6.727082] [] arm_smmu_driver_init+0x1c/0x24
[ 6.733586] [] do_one_initcall+0x38/0x120
[ 6.739317] [] kernel_init_freeable+0x198/0x238
[ 6.744873] [] kernel_init+0x10/0x100
[ 6.751118] [] ret_from_fork+0x10/0x50

I already meet this issue (with ov5640), The warning message is because the clock which is disabled is actually not enabled. This is not critical and I think this is not directly related to your issue. Do you have a link to the entire dmesg output?

Hi Loic,
you can find entire log@

Hi,
i found out that problem is with return value of “cci master” status in ‘cci_run_queue’.
i.e.,ret = cci->master[master].status;

if i hardcode this return value to ‘0’ then camera started working fine.

and i think the master status is being updated from “cci_isr” handler

if (unlikely(val & CCI_IRQ_STATUS_0_I2C_M0_ERROR)) {
› › dev_err_ratelimited(cci->dev, “MASTER_0 error 0x%08x\n”, val);
› › cci->master[MASTER_0].status = -EIO;
› › writel(CCI_HALT_REQ_I2C_M0_Q0Q1, cci->base + CCI_HALT_REQ);
› }

can you help on why this is happening?

Regards,
Laxman