Quoting Petko Manolov (2022-06-06 21:35:44) > Hi guys, > > I am developing Sony imx492 driver on an imx8mm-based board. I am obviously > missing something important because trying to stream from the sensor (by using > v4l2-ctl) i get: "VIDIOC_REQBUFS returned -1 (Invalid argument)". This doesn't '-1' is -EPERM. Invalid argument would be -22? If you look at vb2_core_reqbufs(), it can return -EINVAL if the planes are not set correctly. > look too bad until one look at dmesg, which goes like: > > [ 66.589320] link-frequencies 0 value 600000000 > [ 66.589331] imx492 1-0010: imx492_power_on > [ 66.625823] imx492_detect: detected! > [ 66.625853] mxc_mipi-csi 32e30000.mipi_csi: Registered sensor subdevice: imx492 1-0010 > [ 66.668356] imx492_set_ctrl: fmt ctrl->id 9963793 > [ 192.742375] mx6s-csi 32e20000.csi1_bridge: csi v4l2 busfreq high request. > [ 192.742387] imx492_s_power(1): > [ 192.742428] mx6s-csi 32e20000.csi1_bridge: VIDIOC_G_SELECTION not implemented > [ 192.742570] mx6s-csi 32e20000.csi1_bridge: VIDIOC_G_SELECTION not implemented > [ 192.742618] mx6s-csi 32e20000.csi1_bridge: count=3, size=0 Is this driver (mx6s-csi) in an upstream kernel? > [ 192.742620] size=0 > > and then (just the short version): > > [ 192.742714] CPU: 2 PID: 506 Comm: v4l2-ctl Not tainted 5.4.127 #23 > [ 192.742716] Hardware name: Variscite VAR-SOM-MX8M-MINI on Symphony-Board 1.4a and above (DT) Is this using mainline drivers? Are there BSP patches? Have you tested on a mainline kernel (5.18, linux-media master branch?) > [ 192.742719] pstate: 80000005 (Nzcv daif -PAN -UAO) > [ 192.742723] pc : vb2_core_reqbufs+0x134/0x400 Have you deciphered which line this is yet on your build? > [ 192.742726] lr : vb2_core_reqbufs+0xfc/0x400 > > register dump not very important, and then the call trace: Was this a panic? or output from a WARN_ON? > > [ 192.742778] Call trace: > [ 192.742782] vb2_core_reqbufs+0x134/0x400 > [ 192.742787] vb2_reqbufs+0x78/0x84 > [ 192.742791] mx6s_vidioc_reqbufs+0x3c/0x70 > [ 192.742795] v4l_reqbufs+0x48/0x60 > [ 192.742798] __video_do_ioctl+0x180/0x3e0 > [ 192.742801] video_usercopy+0x134/0x500 > [ 192.742805] video_ioctl2+0x14/0x20 > [ 192.742807] v4l2_ioctl+0x3c/0x60 > [ 192.742813] do_vfs_ioctl+0x860/0xaf0 > [ 192.742816] ksys_ioctl+0x44/0x8c > [ 192.742819] __arm64_sys_ioctl+0x1c/0xc0 > [ 192.742825] el0_svc_common.constprop.0+0x68/0x160 > [ 192.742828] el0_svc_handler+0x20/0x80 > [ 192.742831] el0_svc+0x8/0x204 > [ 192.742834] ---[ end trace 25eae7f9180cbb88 ]--- > > > Have i not enabled something important for imx8's IPU or is it something on my > driver's side? What does your driver do ? I'm not sure how to answer that without seeing the driver. -- Kieran > thanks, > Petko