DB410C: MIPI csi camera: System stuck at VIDIOC_DQBUF when I tried to grab a image

Hi all,

I’m writing a csi canera driver now, after I insmod myDriver.ko, and run myApp to try to grab a image, but I fail. The system stuck at VIDIOC_DQBUF(v4l2 pipeline should be created sucessfully), no any real interrupt is triggered exception the first reset interruptions. I attached my log as the end of this post.

My questions:

a. In drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c, there is a function as below:


What does the big number ‘1000000000000LL’ mean? 1GHz for data lane’s clock frequency? But it seems bigger 1000 times than 1GHz, it is because of use ‘ps’ as a unit in this function. Now I use an oscillometer to measure the clock per data lane, it is 250MHz. Do I need modify the big number ‘1000000000000LL’ to ‘250000000000LL’/ ‘500000000000LL’? Please advise me.

b. The system stuck at VIDIOC_DQBUF, no real interrupt is triggered exception the first reset interruptions. Becides the settle time and settle count value as mentioned on question a, what else I should check? What is the conditions for camss's 4 kinds of interrupts: csiphy_isr, csid_isr, ispif_isr, vfe_isr.

-----------------------------log output-----------------------------------------------------------------
[ 5605.747815] dbg —<csiphy_set_clock_rates>:153—i=3,ret=0x0,pixel_clock=20000000,clock->name:csiphy0_timer,csiphy->timer_clk_rate:100000000—
[ 5605.760335] dbg —<csiphy_hw_version_read>:39—CSIPHY HW Version = 0x10—
[ 5605.765779] dbg —<csid_set_clock_rates>:470—ret=0x0,pixel_clock=20000000—
[ 5605.772470] dbg —<csid_set_clock_rates>:493—clock->freq[0]=100000000—
[ 5605.779443] dbg —<csid_set_clock_rates>:493—clock->freq[1]=200000000—
[ 5605.786414] dbg —<csid_set_clock_rates>:519—i=4,ret=0x0,pixel_clock=20000000,rate:100000000—
[ 5605.793475] dbg —<csid_isr>:450—CSID_IRQ_STATUS = 0x800—
[ 5605.802502] dbg —<ispif_isr_8x16>:233—VFE_m_IRQ_STATUS = 0x8000000,0,0—
[ 5605.808258] dbg —<vfe_get>:1263—power_count = 0—
[ 5605.815547] dbg —<vfe_set_clock_rates>:1181—i=1,ret=0x0,pixel_clock=20000000,rate:50000000—
[ 5605.820491] dbg —<vfe_global_reset>:252------
[ 5605.829479] dbg —<vfe_isr_read>:922—value0:0x10003bc0,value1:0x10003bc4—
[ 5605.833671] dbg —<vfe_isr>:953—vfe_isr_STATUS = 0x80000000,0—
set up stream
capabilities listed:
capabilities:0x85201000
driver capability:0x5201000
Device Qualcomm Camera Subsystem' on platform:1b0ac00.camss’ (driver ‘qcom-camss’) supports:
video: yes
meta: no
capture: yes
output: no
mplanes: yes
get format

important! get num of planes:1
format type:9
w:4104, h:32, fmt:825770306
v4l2 buffers allocated = 1
----query buff:0—
buf map at offset:e06d1078, addr:0xffffb738d000
mmap len:131328
queue buffers
stream on
[ 5606.842801] swift 4-004a: PICO - get format
[ 5606.842879] swift 4-004a: which: 1
[ 5606.846092] swift 4-004a: width: 4104
[ 5606.849303] swift 4-004a: which: 32
[ 5606.853440] dbg —<vfe_set_stream>:1453—enable:1,line->id:0—
[ 5606.856871] dbg —<vfe_enable>:848—line_id = 0—
[ 5606.862882] dbg —<vfe_enable_output>:677—line->id:0,sensor->name:swift—
[ 5606.867928] dbg —<vfe_enable_irq_wm_line>:586—enable(1) line_id: 0x0—
[ 5606.874897] dbg —<vfe_bus_connect_wm_to_rdi>:450—wm(0) line_id: 0x0—
[ 5606.881665] dbg —<vfe_set_rdi_cid>:556—cid(0) line_id: 0x0—
[ 5606.888692] dbg —<ispif_select_csid>:551—intf = 1—
[ 5606.894794] dbg —<ispif_config_irq>:637—enable(1) ,intf= 0x1—
[ 5606.900206] dbg —<ispif_set_stream>:807—ENANBLE isp IRQ—
[ 5606.906182] dbg —<ispif_set_intf_cmd>:751—intf:1,cmd:1,vfe:0,vc:0—
[ 5606.912108] dbg —<csid_set_stream>:694—data_type:0x2a = f->code:0x3001—
[ 5606.918942] dbg —<csiphy_set_stream>:302—enable:1—
[ 5606.925994] dbg —<csiphy_settle_cnt_calc>:85—pixel_clock:20000000,bpp:8,TX_OUT_FREQ_PER_LANE:500000000000,timer_clk_rate:100000000,mipi_clock:40000000,settle_cnt:32,t_hs_settle:165000,ui:6250—
[ 5606.931386] swift 4-004a: PICO start stream:1
[ 5606.931392] dbg —<csiphy_isr>:167—s(0) = 0x0—
dq buffer
[ 5606.931398] dbg —<csiphy_isr>:167—s(1) = 0x0—
[ 5606.957876] dbg —<csiphy_isr>:167—s(2) = 0x0—
[ 5606.962737] dbg —<csiphy_isr>:167—s(3) = 0x0—
[ 5606.967597] dbg —<csiphy_isr>:167—s(4) = 0x0—
[ 5606.972458] dbg —<csiphy_isr>:167—s(5) = 0x0—
[ 5606.977319] dbg —<csiphy_isr>:167—s(6) = 0x0—
[ 5606.982180] dbg —<csiphy_isr>:167—s(7) = 0x0—

^C[ 9206.709687] dbg —<vfe_set_stream>:1453—enable:0,line->id:0—
[ 9207.220198] qcom-camss 1b0ac00.camss: VFE sof timeout
[ 9207.732275] qcom-camss 1b0ac00.camss: VFE reg update timeout
[ 9207.732374] dbg —<vfe_bus_disconnect_wm_from_rdi>:491—wm(0) line_id: 0x0—
[ 9207.737056] dbg —<vfe_enable_irq_wm_line>:586—enable(0) line_id: 0x0—
[ 9207.744440] dbg —<vfe_disable>:906—line_id = 0—
[ 9207.751035] dbg —<ispif_set_intf_cmd>:751—intf:1,cmd:0,vfe:0,vc:0—
[ 9207.756269] dbg —<ispif_set_stream>:829—DISANBLE isp IRQ—
[ 9207.763036] dbg —<ispif_config_irq>:637—enable(0) ,intf= 0x1—
[ 9207.768687] dbg —<ispif_select_csid>:551—intf = 1—
[ 9207.774918] dbg —<csiphy_set_stream>:302—enable:0—
[ 9207.780489] dbg —<csiphy_lanes_disable>:144—i:0,lane:0—
[ 9207.785764] dbg —<csiphy_lanes_disable>:144—i:1,lane:2—
[ 9207.791419] dbg —<csiphy_lanes_disable>:144—i:2,lane:1—
[ 9207.797136] swift 4-004a: PICO start stream:0
[ 9207.802983] swift 4-004a: PICO s power:0
[ 9207.807236] swift 4-004a: set power registers:0
[ 9207.811563] dbg —<vfe_put>:1321—power_count = 1—
[ 9207.815486] dbg —<vfe_isr_read>:922—value0:0x10003e50,value1:0x10003e54—
[ 9207.820629] dbg —<vfe_isr>:953—vfe_isr_STATUS = 0x0,100—

Were you able to resolve this issue? If yes could you please explain how you solve this ? Thank you

I fixed this issue ourselvs. I add a “mipi tx reset” register write to fix this issue because our ToF sensor is using a continuous d-phy clock.