Thread (24 messages) 24 messages, 7 authors, 2021-05-25

Re: [PATCH 00/23] media: imx: imx7-mipi-csis: Add i.MX8MM support / imx8mq support

From: Martin Kepplinger <hidden>
Date: 2021-05-18 14:39:47
Also in: linux-media

Am Sonntag, dem 16.05.2021 um 01:55 +0300 schrieb Laurent Pinchart:
Hi Martin,

Sorry for the late reply.

On Tue, May 04, 2021 at 05:59:39PM +0200, Martin Kepplinger wrote:
quoted
hi Laurent, again thanks a lot for posting this series! I can't
fully test
it, but base my work for imx8mq on it now. imx8mq includes
yet another mipi phy version than this and below is some very rough
testing
code. it's not at all something I sign-off on but my following
problem is based on it.
Unless I'm mistaken, the CSI-2 receiver in the i.MX8MQ is a
completely
different device. I wouldn't try to support it in the imx7-mipi-csis
driver, but in a separate driver.
quoted
 * configured to use both staging csi drivers
 * the csi bridge driver at least streams frames together with the
nxp "yav" mipi driver

media-ctl -p now says the output below, so one link from mipi to
csi is missing.

Note that

media-ctl --set-v4l2 "'csi':0 [fmt:SBGGR10/640x480]"
works in that it changes the configured format below, but

media-ctl -l "'imx7-mipi-csis.0':1" -> "'csi':0[1]"
doesn't create said missing link.
media-ctl can't create links, it can only enable or disable them.
Link
creation is the prerogative of drivers.
quoted
Do I maybe use that wrongly? If now, does anything come to mind
that would
be missing specifically?
The link should be created by the call to media_create_pad_link() in
imx_media_capture_device_register(). You'll need to figure out if the
function is called and returns an error early, or if it doesn't get
called at all, and why.
quoted
When trying to stream anyway (if that makes sense), I get the
following:

[ 2008.377470] capture_start_streaming: starting
[ 2008.381883] capture_find_format: calling
imx_media_find_mbus_format with code 0x2006
[ 2008.389671] imx7-csi 30a90000.csi1_bridge: capture_validate_fmt:
capture_find_format err
[ 2008.397794] imx7-csi 30a90000.csi1_bridge: capture_validate_fmt:
capture_find_format found colorspace 0x1 != 0x0
[ 2008.407999] imx7-csi 30a90000.csi1_bridge: capture format not
valid: -32

and if I ignore that (because I'm not yet sure whether that is
specific to
platforms including an IPU), I get a WARN_ON from
vb2_start_streaming()
That I have a fix for, I'll post it as part of an imx7-media-csi
series.
Hi Laurent,

You haven't posted that fix you're talking about, right? The below
driver (attached; I'll send it as patches after I successfully tested
myself, and cleanup and fixes obviously) results in the same situation
I described above:

* missing link from mipi (entity 10) -> csi (entity 1):
------------------------------------------------------

Device topology
- entity 1: csi (2 pads, 1 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
	pad0: Sink
		[fmt:UYVY8_2X8/640x480 field:none colorspace:srgb
xfer:srgb ycbcr:601 quantization:lim-range]
	pad1: Source
		[fmt:UYVY8_2X8/640x480 field:none colorspace:srgb
xfer:srgb ycbcr:601 quantization:lim-range]
		-> "csi capture":0 [ENABLED,IMMUTABLE]

- entity 4: csi capture (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
	pad0: Sink
		<- "csi":1 [ENABLED,IMMUTABLE]

- entity 10: imx8mq-mipi-csis.0 (2 pads, 1 link)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev1
	pad0: Sink
		<- "hi846 2-0020":0 []
	pad1: Source

- entity 13: hi846 2-0020 (1 pad, 1 link)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev2
	pad0: Source
		[fmt:SGBRG10_1X10/640x480 field:none colorspace:raw]
		-> "imx8mq-mipi-csis.0":0 []


* and the mentioned vb2 WARN_ON:
--------------------------------

[   56.120834] imx7-csi 30a90000.csi1_bridge: begin graph walk at 'csi
capture'
[   56.120859] imx7-csi 30a90000.csi1_bridge: walk: pushing 'csi' on
stack
[   56.120865] imx7-csi 30a90000.csi1_bridge: walk: skipping entity
'csi capture' (already seen)
[   56.120871] imx7-csi 30a90000.csi1_bridge: walk: returning entity
'csi'
[   56.120877] imx7-csi 30a90000.csi1_bridge: walk: returning entity
'csi capture'
[   56.127415] vb2_common_vm_open: 000000006622b5ef, refcount: 1, vma:
ffffabe0b000-ffffabea1000
[   56.127438] vb2_dc_mmap: mapped dma addr 0xe8100000 at
0xffffabe0b000, size 614400
[   56.127480] vb2_common_vm_open: 00000000e689fd4f, refcount: 1, vma:
ffffabd75000-ffffabe0b000
[   56.127488] vb2_dc_mmap: mapped dma addr 0xe8200000 at
0xffffabd75000, size 614400
[   56.127501] vb2_common_vm_open: 00000000485fa30a, refcount: 1, vma:
ffffabcdf000-ffffabd75000
[   56.127509] vb2_dc_mmap: mapped dma addr 0xe8300000 at
0xffffabcdf000, size 614400
[   56.127522] vb2_common_vm_open: 0000000092607c6a, refcount: 1, vma:
ffffabc49000-ffffabcdf000
[   56.127529] vb2_dc_mmap: mapped dma addr 0xe8400000 at
0xffffabc49000, size 614400
[   56.127579] imx7-csi 30a90000.csi1_bridge: begin graph walk at 'csi'
[   56.127587] imx7-csi 30a90000.csi1_bridge: walk: pushing 'csi
capture' on stack
[   56.127593] imx7-csi 30a90000.csi1_bridge: walk: skipping entity
'csi' (already seen)
[   56.127599] imx7-csi 30a90000.csi1_bridge: walk: returning entity
'csi capture'
[   56.127604] imx7-csi 30a90000.csi1_bridge: walk: returning entity
'csi'
[   56.128102] imx7-csi 30a90000.csi1_bridge: begin graph walk at 'csi'
[   56.128111] imx7-csi 30a90000.csi1_bridge: walk: pushing 'csi
capture' on stack
[   56.128117] imx7-csi 30a90000.csi1_bridge: walk: skipping entity
'csi' (already seen)
[   56.128122] imx7-csi 30a90000.csi1_bridge: walk: returning entity
'csi capture'
[   56.128127] imx7-csi 30a90000.csi1_bridge: walk: returning entity
'csi'
[   56.128133] imx7-csi 30a90000.csi1_bridge: pipeline start failed
with -19
[   56.135091] ------------[ cut here ]------------
[   56.135102] WARNING: CPU: 3 PID: 1984 at
drivers/media/common/videobuf2/videobuf2-core.c:1568
vb2_start_streaming+0xe4/0x160 [videobuf2_common]
[   56.135151] Modules linked in: aes_ce_ccm exfat rfcomm algif_hash
algif_skcipher af_alg bnep qmi_wwan cdc_wdm option usbnet usb_wwan
usbserial mii ofpart mousedev spi_nor caam_jr mtd caamhash_desc
caamalg_desc crypto_engine uas redpine_sdio usb_storage redpine_91x
bluetooth mac80211 aes_ce_blk crypto_simd crct10dif_ce ghash_ce
cfg80211 sha2_ce sha1_ce st_lsm6dsx_spi bq25890_charger pwm_vibra
snd_soc_gtm601 snd_soc_simple_card snd_soc_simple_card_utils hi846
s5k3l6xx edt_ft5x06 snd_soc_wm8962 mx6s_capture imx7_media_csi(C)
imx_media_common(C) videobuf2_dma_contig imx8mq_mipi_csis(C)
mxc_mipi_csi2_yav videobuf2_memops videobuf2_v4l2 tps6598x
videobuf2_common vcnl4000 v4l2_fwnode typec
industrialio_triggered_buffer leds_lm3560 videodev mc st_lsm6dsx_i2c
st_lsm6dsx kfifo_buf gnss_mtk gnss_serial gnss snd_soc_fsl_sai imx_sdma
snvs_pwrkey imx_pcm_dma virt_dma snd_soc_core imx2_wdt watchdog
snd_pcm_dmaengine snd_pcm snd_timer snd caam soundcore error rfkill_hks
rfkill ledtrig_timer usb_f_acm
[   56.135494]  u_serial usb_f_rndis g_multi usb_f_mass_storage u_ether
libcomposite ledtrig_pattern fuse ip_tables x_tables ipv6 xhci_plat_hcd
xhci_hcd usbcore imx_dcss clk_bd718x7 cdns_mhdp_imx cdns_mhdp_drmcore
dwc3 ulpi udc_core roles phy_fsl_imx8mq_usb usb_common
[   56.135596] CPU: 3 PID: 1984 Comm: v4l2-ctl Tainted: G         C   
5.12.2-librem5-00049-g99f86eccfeae #335
[   56.135607] Hardware name: Purism Librem 5r4 (DT)
[   56.135613] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO BTYPE=--)
[   56.135623] pc : vb2_start_streaming+0xe4/0x160 [videobuf2_common]
[   56.135653] lr : vb2_start_streaming+0x74/0x160 [videobuf2_common]
[   56.135682] sp : ffff8000148bbba0
[   56.135686] x29: ffff8000148bbba0 x28: ffff00001e833f00 
[   56.135700] x27: 0000000040045612 x26: ffff800008f406a0 
[   56.135713] x25: 0000000000000000 x24: ffff8000148bbd58 
[   56.135725] x23: ffff0000be730138 x22: ffff00000230ab00 
[   56.135738] x21: ffff0000be730330 x20: ffff0000be730348 
[   56.135751] x19: 00000000ffffffed x18: 0000000000000000 
[   56.135763] x17: 0000000000000000 x16: 0000000000000000 
[   56.135776] x15: 0000000000000030 x14: ffffffffffffffff 
[   56.135788] x13: ffff8000948bb737 x12: ffff8000148bb73f 
[   56.135801] x11: ffff80001152a7a0 x10: 00000000ffffe000 
[   56.135813] x9 : ffff800008f3c900 x8 : ffff80001147a7a0 
[   56.135826] x7 : ffff80001152a7a0 x6 : 0000000000000000 
[   56.135838] x5 : 0000000000000000 x4 : 0000000000000000 
[   56.135850] x3 : ffff0000be730344 x2 : 0000000000000000 
[   56.135863] x1 : ffff800008fe4000 x0 : ffff0000253d29f0 
[   56.135877] Call trace:
[   56.135882]  vb2_start_streaming+0xe4/0x160 [videobuf2_common]
[   56.135912]  vb2_core_streamon+0x9c/0x1a0 [videobuf2_common]
[   56.135940]  vb2_ioctl_streamon+0x68/0xbc [videobuf2_v4l2]
[   56.135964]  v4l_streamon+0x30/0x40 [videodev]
[   56.136063]  __video_do_ioctl+0x194/0x3f4 [videodev]
[   56.136145]  video_usercopy+0x1a4/0x770 [videodev]
[   56.136226]  video_ioctl2+0x24/0x40 [videodev]
[   56.136305]  v4l2_ioctl+0x4c/0x70 [videodev]
[   56.136385]  __arm64_sys_ioctl+0xb4/0xfc
[   56.136401]  el0_svc_common.constprop.0+0x68/0x130
[   56.136416]  do_el0_svc+0x28/0x34
[   56.136426]  el0_svc+0x2c/0x54
[   56.136438]  el0_sync_handler+0x1a4/0x1b0
[   56.136449]  el0_sync+0x174/0x180
[   56.136459] ---[ end trace 122c8abc5f14e4e5 ]---


thank you very much for your help,

                           martin

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help