aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
AgeCommit message (Collapse)Author
2022-04-14LF-1599 media: platform: mxc_vout: Do not check 's->r.width/height<0' in ↵Liu Ying
->vidioc_s_selection commit 38d145b05cdcfa87c1a381bedd7e3e64fc9e7d5a from https://source.codeaurora.org/external/imx/linux-imx The commit f90580ca0133 ("[media] videodev2: Set vb2_rect's width and height as unsigned") changes the width and height fields of struct v4l2_rect from type __s32 to type __u32, which makes Coverity complain that it's unnecessary for the platform driver to check on the fields to ensure they are not less than zero. This patch removes the check to make Coverity happy. This fixes Coverity issue: CID 9176743. Signed-off-by: Liu Ying <victor.liu@nxp.com> Reviewed-by: Sandor Yu <sandor.yu@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-1162-18 media: mxc: mxc_vout: change to use VFL_TYPE_VIDEODong Aisheng
commit 5720b20f41bfa8b1ab424aae97b086a7c149b69e from https://source.codeaurora.org/external/imx/linux-imx The legacy one VFL_TYPE_GRABBER was removed since: dc42cf74d98a ("media: v4l2-dev.h: remove VFL_TYPE_GRABBER") Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: platform: mxc: output: Forward IPUv3 V4L2 output driver from imx_4.19.yLiu Ying
commit a6257e45730bd71f39bcdbb91be7812caf34febe from https://source.codeaurora.org/external/imx/linux-imx This patch forwards IPUv3 V4l2 output driver from imx_4.19.y kernel. [ Liu Ying: remove unused get_jiffies(), resolve conflicts related to vb->ts, some ioctrls(vidioc_cropcap, vidioc_g_crop and vidioc_s_crop) and mxc_vout_template->device_caps ] Signed-off-by: Liu Ying <victor.liu@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-4418: media: ov5640: fix first frame abnormal issue when capture 1080PGuoniu.zhou
commit 75f2ca3b452a3b216d8f58985e99ab517247880c from https://source.codeaurora.org/external/imx/linux-imx Enable line sync except XGA and QSXGA since it will introduce random hang issue on iMX8MP platform to send line short packet for each line to fix first frame abnormal issue when capture 1080P on iMX8ULP platform. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Reviewed-by: Robby Cai <Robby.Cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-4155-9 media: capture: ov5640: fix build error due to api changeRobby Cai
commit 75f2ca3b452a3b216d8f58985e99ab517247880c from https://source.codeaurora.org/external/imx/linux-imx Replace struct v4l2_subdev_pad_config with struct v4l2_subdev_state due to V4L2 API change as follows: 0d346d2a6f54 ("media: v4l2-subdev: add subdev-wide state struct") Signed-off-by: Robby Cai <robby.cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-4155-3 media: ov5640: fix build error due to api changeRobby Cai
commit 75f2ca3b452a3b216d8f58985e99ab517247880c from https://source.codeaurora.org/external/imx/linux-imx Replace struct v4l2_subdev_pad_config with struct v4l2_subdev_state due to V4L2 API change as follows: 0d346d2a6f54 ("media: v4l2-subdev: add subdev-wide state struct") Signed-off-by: Robby Cai <robby.cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-4064: media: i2c: ov5640: remove frame rate check before resolution updateGuoniu.zhou
commit 75f2ca3b452a3b216d8f58985e99ab517247880c from https://source.codeaurora.org/external/imx/linux-imx Remove frame rate check before resolution update because driver update them by two steps and driver will check the information before s_stream, so we can remove it. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Reviewed-by: Robby.Cai <robby.cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-2855 media: camera: Fix Coverity Issue: 17397 Unsigned compared against 0Robby Cai
commit 75f2ca3b452a3b216d8f58985e99ab517247880c from https://source.codeaurora.org/external/imx/linux-imx remove the comparison against 0 which is not necessary Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: G.n. Zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-2853 media: camera: Fix Coverity Issue: 17391 Unsigned compared against 0Robby Cai
commit d7e33fe4016878f1b60345afab3d86c4e766ca93 from https://source.codeaurora.org/external/imx/linux-imx remove the comparison against 0 which is not necessary Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: G.n. Zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-3694: media: i2c: ov5640: add QQVGA mode supportGuoniu.zhou
commit edd8debda0282992297b2c0c1d126f85c02b6cd7 from https://source.codeaurora.org/external/imx/linux-imx Add QQVGA mode support for OV5640 Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14MLK-23712: media: capture: add get/set_register callbackGuoniu.zhou
commit 57a369feffb231aa64fb40cdb5ffc38c63e1033d from https://source.codeaurora.org/external/imx/linux-imx In ov5640_mipi_v2.c, driver don't implement get_register/set_register callback but assign ov5640_get_register/ov5640_set_register to v4l2_subdev_core_ops->get_register/set_register if define CONFIG_VIDEO_ADV_DEBUG, so implement them in this patch. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14MLK-24585: media: ov5640: fix state out of sync with sensor real state issueGuoniu.zhou
commit 0e8d902025ba98696c5fdbc2551e3f906734fac0 from https://source.codeaurora.org/external/imx/linux-imx Variable streaming is used to track ov5640 working state and control to turn on/off ov5640. For normal case, streaming will be set to false when user call STREAMOFF ioctl, but for some special cases, process will be killed at any time and STREAMOFF ioctl will be ignored in this case. It leads to sensor software state is out of sync with its real state, so driver force to set streaming to false when call ov5640_set_power_off(). It will keep software state sync with sensor real state. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: ov5640: remove v4l2 subdev node for ov5640Guoniu.zhou
commit c2f800e2fe21a74da4a6099ba982e1f69fcd715b from https://source.codeaurora.org/external/imx/linux-imx Remove v4l2 subdev node for ov5640 because ISP media server can't detect it. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Reviewed-by: Robby.cai <robby.cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14MLK-23526: media: ov5640: fix black frame issue when resolution changeGuoniu.zhou
commit cbf4769b0eebe5f4ae9d15b9e6e9a9d56bff0291 from https://source.codeaurora.org/external/imx/linux-imx Ov5640 will output some black frames at first when switch to other resolution. So add about 100ms delay and software powerdown sensor after finishing current video stream and before starting another video stream to wait for sensor stable. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-1564 media: capture: check return value of devm_kzalloc against NULLRobby Cai
commit 533d5165dac6ded1d3205e660bc4682e9c90e32d from https://source.codeaurora.org/external/imx/linux-imx check return value agaist NULL for devm_kzalloc() Fix Coverity Issue ID: 6091815 Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: G.n. Zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-1011-24 media: mxc: ov5640_mipi_v2: fix build due to i2c_new_dummy removedDong Aisheng
commit 7054383b30c07d17d61c80913c5201576ca86fba from https://source.codeaurora.org/external/imx/linux-imx API changed since: 2c2f00ab1641 ("i2c: remove i2c_new_dummy() API") ../drivers/media/platform/mxc/capture/ov5640_mipi_v2.c: In function ‘ov5640_update_slave_id’: ../drivers/media/platform/mxc/capture/ov5640_mipi_v2.c:524:3: error: implicit declaration of function ‘i2c_new_dummy’ [-Werror=implicit-function-declaration] 524 | i2c_new_dummy(tmp_client->adapter, DEFAULT_SCCB_ID >> 1); | ^~~~~~~~~~~~~ ../drivers/media/platform/mxc/capture/ov5640_mipi_v2.c:523:21: warning: assignment to ‘struct i2c_client *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] 523 | sensor->i2c_client = | ^ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-665-21 mxc: ov5640: fix build break due to un-exist pr_warningDong Aisheng
commit 6631d5789e376fc32ce9b6e47c648ec24488f922 from https://source.codeaurora.org/external/imx/linux-imx pr_warning does not exist anymore. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-155: media: i2c: ov5640: fix 1024x768 abnormal green flicker issueGuoniu.zhou
commit abb40d44d6c9fbdc1216bb358d37dbd3ee6c27ae from https://source.codeaurora.org/external/imx/linux-imx IMX8QXP MEK board connect data[9:2] lines of ov5640 sensor, so we need to set sensor work at 10-bit mode. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Reviewed-by: Sandor.yu <sandor.yu@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-237 media: ov5640_mipi: fix regulator dump when i2c access for camera failRobby Cai
commit e0d7eb3f869ffff168cb97757fbad36a9fb0df9f from https://source.codeaurora.org/external/imx/linux-imx in 5451781dadf85000665e0e2c3288e9e0f34b860a commit, it added the check that the regulator need to be disabled before calling regulator_put(). when i2c access for camera fails in some case, need disable the regulator to fix following dump message. [ 3.881140] i2c i2c-2: cannot deal with slave irq,i2c_imx->slave is null [ 3.981772] ov5640_mipi 2-003c: Write reg error: reg=3008, val=2 [ 3.987841] ov5640_mipi 2-003c: Camera init failed [ 4.001224] ------------[ cut here ]------------ [ 4.005949] WARNING: CPU: 2 PID: 189 at drivers/regulator/core.c:2042 _regulator_put.part.0+0x140/0x148 [ 4.015363] Modules linked in: [ 4.018466] CPU: 2 PID: 189 Comm: kworker/2:2 Not tainted 5.4.0-rc7-5.4-zeus-next+g56a9ca3b7f4e #1 [ 4.027434] Hardware name: FSL i.MX8MM EVK board (DT) [ 4.032554] Workqueue: events deferred_probe_work_func [ 4.037712] pstate: 80000005 (Nzcv daif -PAN -UAO) [ 4.042511] pc : _regulator_put.part.0+0x140/0x148 [ 4.047316] lr : regulator_put+0x34/0x48 [ 4.051248] sp : ffff8000129935f0 [ 4.054571] x29: ffff8000129935f0 x28: ffff000079d39580 [ 4.059891] x27: ffff000079d6cc80 x26: ffff80001206eae0 [ 4.065213] x25: ffff8000120ab538 x24: ffff000079d3fc00 [ 4.070534] x23: 0000000000000009 x22: ffff8000129936a8 [ 4.075856] x21: ffff00007a47c4c0 x20: ffff8000120550c0 [ 4.081174] x19: ffff000079d3ff00 x18: 0000000000000000 [ 4.086495] x17: 0000000000000000 x16: 0000000000000000 [ 4.091817] x15: 0000000000000000 x14: ffff00007b0aa940 [ 4.097138] x13: ffff80006c0ef000 x12: 0000000034d4d91d [ 4.102460] x11: 071c71c71c71c71c x10: 0000000000000990 [ 4.107780] x9 : 0000000000000000 x8 : ffff8000107ef620 [ 4.113102] x7 : ffff000079d5e2b8 x6 : ffff000079d3fc00 [ 4.118424] x5 : ffff000079d5e2b8 x4 : 0000000000000000 [ 4.123745] x3 : ffff800012055490 x2 : ffff00007a47c4c0 [ 4.129066] x1 : 0000000000000000 x0 : 0000000000000001 [ 4.134397] Call trace: [ 4.136861] _regulator_put.part.0+0x140/0x148 [ 4.141318] regulator_put+0x34/0x48 [ 4.144917] devm_regulator_release+0x10/0x18 [ 4.149298] release_nodes+0x1a8/0x220 [ 4.153057] devres_release_all+0x34/0x58 [ 4.157078] really_probe+0x1b8/0x308 [ 4.160748] driver_probe_device+0x54/0xe8 [ 4.164851] __device_attach_driver+0x80/0xb8 [ 4.169225] bus_for_each_drv+0x74/0xc0 [ 4.173070] __device_attach+0xdc/0x138 [ 4.176916] device_initial_probe+0x10/0x18 [ 4.181105] bus_probe_device+0x90/0x98 [ 4.184954] device_add+0x378/0x648 [ 4.188450] device_register+0x1c/0x28 [ 4.192230] i2c_new_client_device+0x134/0x270 [ 4.196681] i2c_new_device+0xc/0x20 [ 4.200277] of_i2c_register_device+0x70/0x98 [ 4.204640] of_i2c_register_devices+0x9c/0x164 [ 4.209176] i2c_register_adapter+0x14c/0x400 [ 4.213545] __i2c_add_numbered_adapter+0x58/0xa0 [ 4.218259] i2c_add_adapter+0x9c/0xc8 [ 4.222015] i2c_add_numbered_adapter+0x24/0x30 [ 4.226580] i2c_imx_probe+0x37c/0x840 [ 4.230340] platform_drv_probe+0x50/0xa0 [ 4.234357] really_probe+0xd4/0x308 [ 4.237944] driver_probe_device+0x54/0xe8 [ 4.242050] __device_attach_driver+0x80/0xb8 [ 4.246414] bus_for_each_drv+0x74/0xc0 [ 4.250264] __device_attach+0xdc/0x138 [ 4.254111] device_initial_probe+0x10/0x18 [ 4.258304] bus_probe_device+0x90/0x98 [ 4.262147] deferred_probe_work_func+0x64/0x98 [ 4.266720] process_one_work+0x198/0x320 [ 4.270740] worker_thread+0x1f0/0x420 [ 4.274523] kthread+0xf0/0x120 [ 4.277694] ret_from_fork+0x10/0x18 [ 4.281291] ---[ end trace 429c2bceeb60ea02 ]--- Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: Guoniu.zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-115: media: i2c: ov5640: fix enumerate capture mode issueGuoniu.zhou
commit adcae9cd1db7e81629833c9ecc60f63f94e41bb2 from https://source.codeaurora.org/external/imx/linux-imx Driver will enumerate all res@fps to user, but for ov5640, when it work in DVP mode, 1080P only can reach 15fps. For 2592x1944, no matter which mode it works, it only support about 8fps. So driver need to clarify these info and report the real capability to user. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: i2c: ov5640: add mode and fps checking for ov5640Guoniu.zhou
commit bfc7c08fb55c9df456bfe176057b3c64acb88733 from https://source.codeaurora.org/external/imx/linux-imx Accroding to ov5640 datasheet, 2592x1944 only support 7.5fps. But actually, it can reach about 8. For 1080P@30fps in DVP mode, it can reach 1080P@15fsp, so adding valid mode and fps checking before streaming. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: i2c: fix the incomplete first frame issueGuoniu.zhou
commit 7b6c4fa8aefdf0fb94dbecacc7332c41d0140d46 from https://source.codeaurora.org/external/imx/linux-imx VSYNC signal trigger before a frame end when ov5640 work at MIPI mode. It leads to the first frame content only hav some lines of image. I tried many configuration and finally have the patch to fix the issue. My thought is suspending sensor when update its registers and resume after update. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> [ Aisheng: fix minior conflicts due to 92b9096c0fe0 ("media: ov5640: Fix 1920x1080 mode to remove extra enable/disable") ] Sign-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: i2c: fix hang issue when ov5640 work at DVP modeGuoniu.zhou
commit 3768258b42b4ac16ab0af8b368ce5d0307d16227 from https://source.codeaurora.org/external/imx/linux-imx When setting ov5640 to XGA, 720P, 1080P and 2592x1944 at DVP mode, receiver can't get data from sensor. After trying many configuration, I found 0x3824[1] need to be set to control divide DVP PCLK and do software power-down when configure sensor to XGA and 720P. For 1080P and 2592x1944, sensor don't support 30fps. So return NULL when user try to get 1080P@30 and 2592x1944@30fps. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: platform: mxc: capture: ov5640: Disable regulators in ov5640_remove()Liu Ying
commit cc9e41b6a9b6b8d4242ed8e3eacc297e239f49af from https://source.codeaurora.org/external/imx/linux-imx The below commit introduced in v5.0 would warn us when putting a regulator with non-zero enable_count. So, we should disable regulators in ov5640_remove() in cases where regulators are still enabled when the module is removed. This patch can suppress the below warnings when the module is removed: [ 456.156524] WARNING: CPU: 3 PID: 11175 at drivers/regulator/core.c:2042 _regulator_put.part.4+0x1a4/0x1c8 [ 456.166261] Modules linked in: mxc_v4l2_capture ipu_bg_overlay_sdc ipu_still ipu_prp_enc ipu_csi_enc ipu_fg_overlay_sdc ov5640_camera_mipi_v2 ov5640_camera_int(-) imx_vdoa ov5640_camera_mipi_int v4l2_int_device galcore(O) [last unloaded: ipu_bg_overlay_sdc] [ 456.189199] CPU: 3 PID: 11175 Comm: modprobe Tainted: G W O 5.4.0-rc3-5.3-warrior-next+gfb33033 #1 [ 456.199312] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [ 456.205881] [<c0112e70>] (unwind_backtrace) from [<c010cd80>] (show_stack+0x10/0x14) [ 456.213654] [<c010cd80>] (show_stack) from [<c0c98ba0>] (dump_stack+0xd8/0x110) [ 456.220992] [<c0c98ba0>] (dump_stack) from [<c0136da0>] (__warn+0xc0/0x10c) [ 456.227978] [<c0136da0>] (__warn) from [<c0137168>] (warn_slowpath_fmt+0x58/0xb8) [ 456.235490] [<c0137168>] (warn_slowpath_fmt) from [<c05f143c>] (_regulator_put.part.4+0x1a4/0x1c8) [ 456.244477] [<c05f143c>] (_regulator_put.part.4) from [<c05f148c>] (regulator_put+0x2c/0x3c) [ 456.252942] [<c05f148c>] (regulator_put) from [<c0685f08>] (release_nodes+0x1ac/0x1f8) [ 456.260890] [<c0685f08>] (release_nodes) from [<c0682168>] (device_release_driver_internal+0xf8/0x1b8) [ 456.270222] [<c0682168>] (device_release_driver_internal) from [<c0682284>] (driver_detach+0x44/0x80) [ 456.279464] [<c0682284>] (driver_detach) from [<c0680e40>] (bus_remove_driver+0x4c/0xa4) [ 456.287584] [<c0680e40>] (bus_remove_driver) from [<c01e4c64>] (sys_delete_module+0x164/0x1d8) [ 456.296222] [<c01e4c64>] (sys_delete_module) from [<c0101000>] (ret_fast_syscall+0x0/0x28) [ 456.304505] Exception stack(0xe7657fa8 to 0xe7657ff0) [ 456.309577] 7fa0: 01d284b8 01d284f4 01d284f4 00000800 00000070 00000000 [ 456.317776] 7fc0: 01d284b8 01d284f4 00000000 00000081 00000001 01d27150 01d284b8 be935b40 [ 456.325973] 7fe0: b6ef8340 be93479c 0001fd24 b6ef834c [ 456.331155] irq event stamp: 4303 [ 456.334505] hardirqs last enabled at (4311): [<c019d73c>] console_unlock+0x420/0x5dc [ 456.342449] hardirqs last disabled at (4328): [<c019d3c4>] console_unlock+0xa8/0x5dc [ 456.350328] softirqs last enabled at (4344): [<c01024e4>] __do_softirq+0x2c4/0x518 [ 456.358104] softirqs last disabled at (4355): [<c013e9d4>] irq_exit+0x100/0x18c [ 456.365516] ---[ end trace 67f399ebac279467 ]--- commit 5451781dadf8 ("regulator: core: Only count load for enabled consumers") Signed-off-by: Liu Ying <victor.liu@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: ov5640 v2: fix kernel warning when no camera is plugged inRobby Cai
commit 26f4c1e4eb8ecc03b68eac385c75b20147238d77 from https://source.codeaurora.org/external/imx/linux-imx in 5451781dadf85000665e0e2c3288e9e0f34b860a commit, it added the check that the regulator need to be disabled before calling regulator_put(). If not do so, the kernel will print warning message as below. To fix this, need to disable regulator before probe function return if the camera's not found. regulator_put() will be called when probe fails in this case as devm_regulator_get() already called in probe function. [ 1482.424157] camera ov5640 is not found [ 1482.428022] ------------[ cut here ]------------ [ 1482.433070] WARNING: CPU: 0 PID: 697 at drivers/regulator/core.c:2039 _regulator_put.part.4+0x100/0x120 [ 1482.442566] Modules linked in: ov5640_camera_v2(+) v4l2_int_device mx6s_capture galcore(O) [last unloaded: ov5640_camera_int] [ 1482.453990] CPU: 0 PID: 697 Comm: modprobe Tainted: G O 5.3.0-rc3-next-20190809-5.3-warrior-next+g1dc2946 #1 [ 1482.465136] Hardware name: Freescale i.MX6 SoloX (Device Tree) [ 1482.471007] [<c0112868>] (unwind_backtrace) from [<c010cd9c>] (show_stack+0x10/0x14) [ 1482.478781] [<c010cd9c>] (show_stack) from [<c0cec834>] (dump_stack+0xd8/0x110) [ 1482.486116] [<c0cec834>] (dump_stack) from [<c01362c4>] (__warn.part.3+0xa8/0xe8) [ 1482.493620] [<c01362c4>] (__warn.part.3) from [<c013645c>] (warn_slowpath_null+0x40/0x4c) [ 1482.501824] [<c013645c>] (warn_slowpath_null) from [<c05e6868>] (_regulator_put.part.4+0x100/0x120) [ 1482.510894] [<c05e6868>] (_regulator_put.part.4) from [<c05e68b4>] (regulator_put+0x2c/0x3c) [ 1482.519356] [<c05e68b4>] (regulator_put) from [<c06dd210>] (release_nodes+0x1ac/0x1f8) [ 1482.527298] [<c06dd210>] (release_nodes) from [<c06d8cb0>] (really_probe+0x104/0x340) [ 1482.535151] [<c06d8cb0>] (really_probe) from [<c06d9098>] (driver_probe_device+0x84/0x194) [ 1482.543436] [<c06d9098>] (driver_probe_device) from [<c06d938c>] (device_driver_attach+0x58/0x60) [ 1482.552329] [<c06d938c>] (device_driver_attach) from [<c06d93ec>] (__driver_attach+0x58/0xd0) [ 1482.560875] [<c06d93ec>] (__driver_attach) from [<c06d70b8>] (bus_for_each_dev+0x70/0xb4) [ 1482.569073] [<c06d70b8>] (bus_for_each_dev) from [<c06d80e4>] (bus_add_driver+0x198/0x1d0) [ 1482.577358] [<c06d80e4>] (bus_add_driver) from [<c06da078>] (driver_register+0x74/0x108) [ 1482.585474] [<c06da078>] (driver_register) from [<c088b238>] (i2c_register_driver+0x38/0x84) [ 1482.593937] [<c088b238>] (i2c_register_driver) from [<c0103078>] (do_one_initcall+0x80/0x338) [ 1482.602486] [<c0103078>] (do_one_initcall) from [<c01e163c>] (do_init_module+0x5c/0x238) [ 1482.610598] [<c01e163c>] (do_init_module) from [<c01e3b00>] (load_module+0x2260/0x256c) [ 1482.618623] [<c01e3b00>] (load_module) from [<c01e4060>] (sys_finit_module+0xbc/0xdc) [ 1482.626473] [<c01e4060>] (sys_finit_module) from [<c0101000>] (ret_fast_syscall+0x0/0x28) [ 1482.634666] Exception stack(0xec0f5fa8 to 0xec0f5ff0) [ 1482.639737] 5fa0: 00000000 00000000 00000003 00028e44 00000000 01602408 [ 1482.647933] 5fc0: 00000000 00000000 00040000 0000017b 00000000 00000000 00000000 01602630 [ 1482.656127] 5fe0: beb158f0 beb158e0 0001fdb4 b6f1f510 [ 1482.661324] irq event stamp: 3497 [ 1482.664677] hardirqs last enabled at (3505): [<c019be00>] console_unlock+0x418/0x5f4 [ 1482.672612] hardirqs last disabled at (3522): [<c019ba70>] console_unlock+0x88/0x5f4 [ 1482.680451] softirqs last enabled at (3538): [<c01024e4>] __do_softirq+0x2c4/0x514 [ 1482.688136] softirqs last disabled at (3531): [<c013da4c>] irq_exit+0x100/0x188 [ 1482.695530] ---[ end trace e580778621876135 ]--- Signed-off-by: Robby Cai <robby.cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: ov5640 mipi v2: fix kernel warning when no camera is plugged inRobby Cai
commit 6f77de6f2a4c54dcb8099e992b8ffc4150d358a5 from https://source.codeaurora.org/external/imx/linux-imx in 5451781dadf85000665e0e2c3288e9e0f34b860a commit, it added the check that the regulator need to be disabled before calling regulator_put(). If not do so, the kernel will print warning message as below. To fix this, need to disable regulator before probe function return if the camera's not found. regulator_put() will be called when probe fails in this case as devm_regulator_get() already called in probe function. [ 2.834247] ov5640_mipi 1-003c: Camera is not found [ 2.839198] ------------[ cut here ]------------ [ 2.844386] WARNING: CPU: 0 PID: 33 at drivers/regulator/core.c:2039 _regulator_put+0x34/0xd8 [ 2.852954] Modules linked in: [ 2.856091] CPU: 0 PID: 33 Comm: kworker/0:1 Not tainted 5.3.0-rc3-next-20190809-5.3-warrior-next+g1dc2946 #1 [ 2.866044] Hardware name: NXP i.MX8MQ EVK (DT) [ 2.870692] Workqueue: events deferred_probe_work_func [ 2.875879] pstate: 60000005 (nZCv daif -PAN -UAO) [ 2.880712] pc : _regulator_put+0x34/0xd8 [ 2.884756] lr : _regulator_put+0x34/0xd8 [ 2.888802] sp : ffff00001210b5f0 [ 2.892153] x29: ffff00001210b5f0 x28: ffff0000111ca238 [ 2.897478] x27: ffff000011db1850 x26: ffff000011db1790 [ 2.902800] x25: ffff000011db1790 x24: 0000000000000009 [ 2.908151] x23: ffff00001210b698 x22: ffff8000baec9e00 [ 2.913501] x21: ffff000011c498c8 x20: ffff8000baecc100 [ 2.918852] x19: ffff8000baecc100 x18: 0000000000000010 [ 2.924202] x17: 0000000000000000 x16: 0000000000000000 [ 2.929553] x15: ffffffffffffffff x14: ffff000011c498c8 [ 2.934904] x13: ffff00009210b387 x12: ffff00001210b38f [ 2.940254] x11: ffff000011c62000 x10: ffff00001210b310 [ 2.945605] x9 : 00000000ffffffd0 x8 : ffff0000106e31a0 [ 2.950955] x7 : 0000000000000124 x6 : ffff000011e63b43 [ 2.956305] x5 : 0000000000000000 x4 : 0000000000000000 [ 2.961655] x3 : 00000000ffffffff x2 : e14ea0006ddd6c00 [ 2.967006] x1 : 0000000000000000 x0 : 0000000000000024 [ 2.972390] Call trace: [ 2.974884] _regulator_put+0x34/0xd8 [ 2.978588] regulator_put+0x2c/0x40 [ 2.982227] devm_regulator_release+0x10/0x18 [ 2.986640] release_nodes+0x1b0/0x220 [ 2.990429] devres_release_all+0x34/0x58 [ 2.994480] really_probe+0x1b8/0x2e8 [ 2.998184] driver_probe_device+0x74/0x118 [ 3.002406] __device_attach_driver+0x80/0xb8 [ 3.006805] bus_for_each_drv+0x78/0xc8 [ 3.010653] __device_attach+0xd4/0x130 [ 3.014528] device_initial_probe+0x10/0x18 [ 3.018746] bus_probe_device+0x90/0x98 [ 3.022624] device_add+0x48c/0x720 [ 3.026150] device_register+0x1c/0x28 [ 3.029975] i2c_new_client_device+0x130/0x2a0 [ 3.034431] i2c_new_device+0xc/0x20 [ 3.038061] of_i2c_register_device+0x70/0x98 [ 3.042457] of_i2c_register_devices+0x98/0x120 [ 3.047026] i2c_register_adapter+0x160/0x410 [ 3.051395] __i2c_add_numbered_adapter+0x58/0x90 [ 3.056137] i2c_add_adapter+0x9c/0xc8 [ 3.059925] i2c_add_numbered_adapter+0x24/0x30 [ 3.064507] i2c_imx_probe+0x3d0/0x880 [ 3.068296] platform_drv_probe+0x50/0xa0 [ 3.072318] really_probe+0xdc/0x2e8 [ 3.075933] driver_probe_device+0x74/0x118 [ 3.080127] __device_attach_driver+0x80/0xb8 [ 3.084522] bus_for_each_drv+0x78/0xc8 [ 3.088397] __device_attach+0xd4/0x130 [ 3.092268] device_initial_probe+0x10/0x18 [ 3.096461] bus_probe_device+0x90/0x98 [ 3.100332] deferred_probe_work_func+0x64/0x98 [ 3.104956] process_one_work+0x1e0/0x320 [ 3.109007] worker_thread+0x228/0x428 [ 3.112812] kthread+0x120/0x128 [ 3.116104] ret_from_fork+0x10/0x18 [ 3.119722] ---[ end trace 69a95d03ced5eb6c ]--- Signed-off-by: Robby Cai <robby.cai@nxp.com> (cherry picked from commit ddfe50087eb3addb4d0574b8ee1a153b7da71284) Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: ov5640 mipi: fix kernel warning when no camera is plugged inRobby Cai
commit 782690e653a7083aea85ce810a8030f7e62a2f7c from https://source.codeaurora.org/external/imx/linux-imx in 5451781dadf85000665e0e2c3288e9e0f34b860a commit, it added the check that the regulator need to be disabled before calling regulator_put(). If not do so, the kernel will print warning message as below. To fix this, need to disable regulator before probe function return if the camera's not found. regulator_put() will be called when probe fails in this case as devm_regulator_get() already called in probe function. [ 11.444811] ------------[ cut here ]------------ [ 11.444866] WARNING: CPU: 1 PID: 317 at drivers/regulator/core.c:2039 _regulator_put.part.4+0x100/0x120 [ 11.444881] Modules linked in: ov5640_camera_mipi_int(+) ov5640_camera_int(+) v4l2_int_device [ 11.444949] CPU: 1 PID: 317 Comm: systemd-udevd Tainted: G W O 5.3.0-rc3-next-20190809-02774-g6e085ec #18 [ 11.444965] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [ 11.445008] [<c0112868>] (unwind_backtrace) from [<c010cd9c>] (show_stack+0x10/0x14) [ 11.445047] [<c010cd9c>] (show_stack) from [<c0d26ad4>] (dump_stack+0xd8/0x110) [ 11.445081] [<c0d26ad4>] (dump_stack) from [<c01362c4>] (__warn.part.3+0xa8/0xe8) [ 11.445107] [<c01362c4>] (__warn.part.3) from [<c013645c>] (warn_slowpath_null+0x40/0x4c) [ 11.445143] [<c013645c>] (warn_slowpath_null) from [<c05e6520>] (_regulator_put.part.4+0x100/0x120) [ 11.445177] [<c05e6520>] (_regulator_put.part.4) from [<c05e656c>] (regulator_put+0x2c/0x3c) [ 11.445213] [<c05e656c>] (regulator_put) from [<c06dce90>] (release_nodes+0x1ac/0x1f8) [ 11.445247] [<c06dce90>] (release_nodes) from [<c06d8968>] (really_probe+0x104/0x340) [ 11.445266] [<c06d8968>] (really_probe) from [<c06d8d50>] (driver_probe_device+0x84/0x194) [ 11.445281] [<c06d8d50>] (driver_probe_device) from [<c06d9044>] (device_driver_attach+0x58/0x60) [ 11.445295] [<c06d9044>] (device_driver_attach) from [<c06d90a4>] (__driver_attach+0x58/0xd0) [ 11.445308] [<c06d90a4>] (__driver_attach) from [<c06d6d70>] (bus_for_each_dev+0x70/0xb4) [ 11.445322] [<c06d6d70>] (bus_for_each_dev) from [<c06d7d9c>] (bus_add_driver+0x198/0x1d0) [ 11.445337] [<c06d7d9c>] (bus_add_driver) from [<c06d9d30>] (driver_register+0x74/0x108) [ 11.445355] [<c06d9d30>] (driver_register) from [<c088ae30>] (i2c_register_driver+0x38/0x84) [ 11.445394] [<c088ae30>] (i2c_register_driver) from [<bf01b010>] (ov5640_init+0x10/0x1000 [ov5640_camera_mipi_int]) [ 11.445442] [<bf01b010>] (ov5640_init [ov5640_camera_mipi_int]) from [<c0103078>] (do_one_initcall+0x80/0x338) [ 11.445482] [<c0103078>] (do_one_initcall) from [<c01e163c>] (do_init_module+0x5c/0x238) [ 11.445512] [<c01e163c>] (do_init_module) from [<c01e3b00>] (load_module+0x2260/0x256c) [ 11.445535] [<c01e3b00>] (load_module) from [<c01e4060>] (sys_finit_module+0xbc/0xdc) [ 11.445550] [<c01e4060>] (sys_finit_module) from [<c0101000>] (ret_fast_syscall+0x0/0x28) [ 11.445559] Exception stack(0xed885fa8 to 0xed885ff0) [ 11.445571] 5fa0: 00000000 00000000 00000007 b6f167e8 00000000 007f2e78 [ 11.445583] 5fc0: 00000000 00000000 beebbddc 0000017b 00000000 00000000 beebbda0 007f0890 [ 11.445593] 5fe0: beebbd08 beebbcf8 b6f0ed84 b6d81510 [ 11.445604] irq event stamp: 19099 [ 11.445618] hardirqs last enabled at (19105): [<c019d9f4>] vprintk_emit+0x294/0x2c8 [ 11.445629] hardirqs last disabled at (19110): [<c019d884>] vprintk_emit+0x124/0x2c8 [ 11.445641] softirqs last enabled at (18974): [<c01024e4>] __do_softirq+0x2c4/0x514 [ 11.445657] softirqs last disabled at (18917): [<c013da4c>] irq_exit+0x100/0x188 [ 11.445666] ---[ end trace 13b19ccc3a78aa48 ]--- Signed-off-by: Robby Cai <robby.cai@nxp.com> (cherry picked from commit 5c9b5de893eda4e328d1b72a244fe790efaddd54) Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: ov5640: fix kernel warning when no camera is plugged inRobby Cai
commit 6e4980977b6c937658c32437dbdbf4a71151df48 from https://source.codeaurora.org/external/imx/linux-imx in 5451781dadf85000665e0e2c3288e9e0f34b860a commit, it added the check that the regulator need to be disabled before calling regulator_put(). If not do so, the kernel will print warning message as below. To fix this, need to disable regulator before probe function return if the camera's not found. regulator_put() will be called when probe fails in this case as devm_regulator_get() already called in probe function. [ 11.342219] ------------[ cut here ]------------ [ 11.347211] WARNING: CPU: 0 PID: 314 at drivers/regulator/core.c:2039 _regulator_put.part.4+0x100/0x120 [ 11.356861] Modules linked in: ov5640_camera_mipi_int(+) ov5640_camera_int(+) v4l2_int_device [ 11.365604] CPU: 0 PID: 314 Comm: systemd-udevd Tainted: G W O 5.3.0-rc3-next-20190809-02774-g6e085ec #18 [ 11.376346] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [ 11.382947] [<c0112868>] (unwind_backtrace) from [<c010cd9c>] (show_stack+0x10/0x14) [ 11.390758] [<c010cd9c>] (show_stack) from [<c0d26ad4>] (dump_stack+0xd8/0x110) [ 11.398120] [<c0d26ad4>] (dump_stack) from [<c01362c4>] (__warn.part.3+0xa8/0xe8) [ 11.405636] [<c01362c4>] (__warn.part.3) from [<c013645c>] (warn_slowpath_null+0x40/0x4c) [ 11.414007] [<c013645c>] (warn_slowpath_null) from [<c05e6520>] (_regulator_put.part.4+0x100/0x120) [ 11.414045] [<c05e6520>] (_regulator_put.part.4) from [<c05e656c>] (regulator_put+0x2c/0x3c) [ 11.414063] [<c05e656c>] (regulator_put) from [<c06dce90>] (release_nodes+0x1ac/0x1f8) [ 11.414082] [<c06dce90>] (release_nodes) from [<c06d8968>] (really_probe+0x104/0x340) [ 11.414097] [<c06d8968>] (really_probe) from [<c06d8d50>] (driver_probe_device+0x84/0x194) [ 11.414112] [<c06d8d50>] (driver_probe_device) from [<c06d9044>] (device_driver_attach+0x58/0x60) [ 11.414126] [<c06d9044>] (device_driver_attach) from [<c06d90a4>] (__driver_attach+0x58/0xd0) [ 11.414141] [<c06d90a4>] (__driver_attach) from [<c06d6d70>] (bus_for_each_dev+0x70/0xb4) [ 11.414154] [<c06d6d70>] (bus_for_each_dev) from [<c06d7d9c>] (bus_add_driver+0x198/0x1d0) [ 11.414168] [<c06d7d9c>] (bus_add_driver) from [<c06d9d30>] (driver_register+0x74/0x108) [ 11.414186] [<c06d9d30>] (driver_register) from [<c088ae30>] (i2c_register_driver+0x38/0x84) [ 11.414203] [<c088ae30>] (i2c_register_driver) from [<c0103078>] (do_one_initcall+0x80/0x338) [ 11.414223] [<c0103078>] (do_one_initcall) from [<c01e163c>] (do_init_module+0x5c/0x238) [ 11.414236] [<c01e163c>] (do_init_module) from [<c01e3b00>] (load_module+0x2260/0x256c) [ 11.414250] [<c01e3b00>] (load_module) from [<c01e4060>] (sys_finit_module+0xbc/0xdc) [ 11.414263] [<c01e4060>] (sys_finit_module) from [<c0101000>] (ret_fast_syscall+0x0/0x28) [ 11.414272] Exception stack(0xeda6bfa8 to 0xeda6bff0) [ 11.414284] bfa0: 00000000 00000000 0000000f b6f167e8 00000000 007ecba0 [ 11.414297] bfc0: 00000000 00000000 beebbddc 0000017b 00000000 00000000 beebbda0 007f7db0 [ 11.414307] bfe0: beebbd08 beebbcf8 b6f0ed84 b6d81510 [ 11.414423] irq event stamp: 16217 [ 11.414445] hardirqs last enabled at (16223): [<c019d9f4>] vprintk_emit+0x294/0x2c8 [ 11.414458] hardirqs last disabled at (16228): [<c019d884>] vprintk_emit+0x124/0x2c8 [ 11.414472] softirqs last enabled at (16192): [<c01024e4>] __do_softirq+0x2c4/0x514 [ 11.414489] softirqs last disabled at (16137): [<c013da4c>] irq_exit+0x100/0x188 [ 11.414498] ---[ end trace 13b19ccc3a78aa43 ]--- Signed-off-by: Robby Cai <robby.cai@nxp.com> (cherry picked from commit 14d7e9fc1249f8d8ed81743c42e157fcd6598ac9) Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: capture: add mipi camera ov5647 driverRobby Cai
commit 736f06de8abb2500ead3273e87bcfdce8a25d857 from https://source.codeaurora.org/external/imx/linux-imx add ov5647 driver Signed-off-by: Robby Cai <robby.cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: capture: add ov5640 mipi and parallel driver of subdev versionRobby Cai
commit 4a2766d696ef8a2b758c3728ea510d33c1502e69 from https://source.codeaurora.org/external/imx/linux-imx ov5640 module supports both mipi and parallel interface. The driver is based on subdev framework. The driver is used on 6UL/6ULL/6SX/6SL/6SLL/7D EVK or SabreSD board. Signed-off-by: Robby Cai <robby.cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: capture: add ov5640 mipi and parallel driverRobby Cai
commit 4a2766d696ef8a2b758c3728ea510d33c1502e69 from https://source.codeaurora.org/external/imx/linux-imx ov5640 module supports both mipi and parallel interface. The driver is based on int device framework. The driver is used on imx6qdl Sabresd boads. Signed-off-by: Robby Cai <robby.cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: i2c: save width and height of new mode to sensor formatGuoniu.zhou
commit c011b94c057b2a31e5f4ed11d97e94e3a50dd885 from https://source.codeaurora.org/external/imx/linux-imx Save the width and height info of new mode to sensor format data in order to get the info by G_FMT ioctl command Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> [ Aisheng: fix minior conflicts due to cc196e48e517 ("media: ov5640: add PIXEL_RATE control") ] Sign-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14media: i2c: sensor: add link_setup entity ops for ov5640 driverGuoniu.zhou
commit 52d92bfa91ed488d88cd1396cb379646fee78280 from https://source.codeaurora.org/external/imx/linux-imx Add link_setup callback for ov5640 sensor entity ops. In some cases, driver will call the related entity ops to notify the link setup events Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-4155-8 media: capture: vadc: fix build error due to api changeRobby Cai
commit b0519c4b9531e65e71b3ff5db18553d6ad840099 from https://source.codeaurora.org/external/imx/linux-imx Replace struct v4l2_subdev_pad_config with struct v4l2_subdev_state due to V4L2 API change as follows: 0d346d2a6f54 ("media: v4l2-subdev: add subdev-wide state struct") Signed-off-by: Robby Cai <robby.cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-4185 media: mxc_capture: Fix VTE test failure due to accumulated errorRobby Cai
commit b0519c4b9531e65e71b3ff5db18553d6ad840099 from https://source.codeaurora.org/external/imx/linux-imx $ v4l_capture_testapp -T 10 ... camera_module are: ov5640_camera_int ov5640_camera_mipi_v2 OK to setup v4l v4l_capture_testapp 0 TINFO : Testing if v4l_capture_testapp test case is OK v4l_capture_testapp 0 TINFO : capture mode is 0 v4l_capture_testapp 0 TINFO : Default image: left = 0, top = 0, width = 320, height = 240 v4l_capture_testapp 0 TINFO : VIDIOC_S_FBUF executed - overlay type OVERLAY is set v4l_capture_testapp 0 TINFO : Please wait 10 sec ... v4l_capture_testapp 0 TINFO : Start capturing... [ 54.864917] fb_set_var err code -1 v4l_capture_testapp 0 TWARN : v4l_capture_test.c:871: Error stop_capturing() for VIDIOC_OVERLAY : Operation not permitted v4l_capture_testapp 1 TBROK : v4l_capture_test.c:1872: /dev/video0 capturing stop failed v4l_capture_testapp 2 TFAIL : v4l_capture_main.c:537: v4l_capture_testapp test case did NOT work as expected ... the root cause is that following patch accumulates the error when function returns. 4e66a87f64f2 LF-2488 media: mxc_capture: Fix Coverity Issue:11024996 Unchecked return value Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: G.n. Zhou <guoniu.zhou@nxp.com> (cherry picked from commit f12192aaaf37d43ae41cbdaba6aab4a8f5024312) Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-3760 media: csi: fill in colorspaceRobby Cai
commit b0519c4b9531e65e71b3ff5db18553d6ad840099 from https://source.codeaurora.org/external/imx/linux-imx filling in colorspace, this also fixed v4l2 compliance test issue. Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed by: G.n. Zhou <guoniu.zhou@nxp.com> (cherry picked from commit 9db46794ad9925f34979936755818f08ba0c73d4) Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14mxc: capture: v4l2: drop the usage of MODULE_SUPPORTED_DEVICEDong Aisheng
commit b0519c4b9531e65e71b3ff5db18553d6ad840099 from https://source.codeaurora.org/external/imx/linux-imx it was removed since: 6417f03132a6 ("module: remove never implemented MODULE_SUPPORTED_DEVICE") Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-2861 media: mx6s_capture: Fix Coverity Issue: 17695 Dereference before ↵Robby Cai
null check commit b0519c4b9531e65e71b3ff5db18553d6ad840099 from https://source.codeaurora.org/external/imx/linux-imx Fix dereference before NULL check issue Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: G.n. Zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-2860 media: mxc_capture: Fix Coverity Issue: 17691 Dereference before ↵Robby Cai
null check commit cd5410d8928415cfc96f4df2bf87e2228cbc1d11 from https://source.codeaurora.org/external/imx/linux-imx Fix dereference before NULL check issue Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: G.n. Zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-2859 media: mxc_capture: Fix Coverity Issue: 17678 Dereference before ↵Robby Cai
null check commit 78d46a8b198aca646fa1702520bc127335943c1a from https://source.codeaurora.org/external/imx/linux-imx Fix issue for dereference before NULL check Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: G.n. Zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-2858 media: ipu: Fix Coverity Issue: 17676 Dereference before null checkRobby Cai
commit 1e868c6e255ce974967a157a4d4f8a5063bd068e from https://source.codeaurora.org/external/imx/linux-imx Fix issue for dereference before NULL check Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: G.n. Zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-2856 media: ipu: Fix Coverity Issue: 17672 Dereference before null checkRobby Cai
commit affd84d3188c56772965f3362a82443cc703029a from https://source.codeaurora.org/external/imx/linux-imx Fixed dereference before NULL check issue Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: G.n. Zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-2488 media: mxc_capture: Fix Coverity Issue:11024996 Unchecked return valueRobby Cai
commit 6c9708bf63ffcf4f19a6512ea0b54ab13a5b79b4 from https://source.codeaurora.org/external/imx/linux-imx Add return value check for fb_set_var Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: G.n. Zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-3583-02: media: mx6s_capture: fix api change issue due to kernel upgradeGuoniu.zhou
commit e5b695af78fbb7554a60dc336f5c003cdee0e605 from https://source.codeaurora.org/external/imx/linux-imx v4l2_async_notifier_add_subdev is replaced by v4l2_async_notifier_add_*, more info please refer to commit as bellow: commit c1cc236250629f3181e2b98c16db2642e295278a Author: Ezequiel Garcia <ezequiel@collabora.com> Date: Mon Jan 18 02:52:57 2021 +0100 media: v4l2-async: Discourage use of v4l2_async_notifier_add_subdev Most -if not all- use-cases are expected to be covered by one of: v4l2_async_notifier_add_fwnode_subdev, v4l2_async_notifier_add_fwnode_remote_subdev or v4l2_async_notifier_add_i2c_subdev. We'd like to discourage drivers from using v4l2_async_notifier_add_subdev, so rename it as __v4l2_async_notifier_add_subdev. This is typically a good hint for drivers to avoid using the function. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-2854: media: mxc_vadc: fix Coverity Issue: 17396Sandor Yu
commit b4f3182cb69db1f3110ec8885fbd1150c3b526ff from https://source.codeaurora.org/external/imx/linux-imx Remove less-than-zero comparison of an unsigned value Signed-off-by: Sandor Yu <Sandor.yu@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-2976 media: adv7180: fix not work by "ERROR: v4l2 capture: slave not found!"Robby Cai
commit 003b032b945f73e646b0ef663e6c3da991820a79 from https://source.codeaurora.org/external/imx/linux-imx in some case, the pin of gpio expander(max7310) can't be pulled high due to i2c access problem. need retry this step several times to succeed. Signed-off-by: Robby Cai <robby.cai@nxp.com> Acked-by: Haibo Chen <haibo.chen@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14Revert "LF-2488 media: mxc V4L2 capture: fix coverity issue 11024996 & 11024997"Robby Cai
commit 0a864f7e226f28dd6366296ad5a1cbe63bc29919 from https://source.codeaurora.org/external/imx/linux-imx This reverts commit 6c72564530d2142cf48d89d7c33a93ae2cc8a107. need revisit as it breaks some lava test under some circumstance Signed-off-by: Robby Cai <robby.cai@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-2488 media: mxc V4L2 capture: fix coverity issue 11024996 & 11024997Robby Cai
commit 0a864f7e226f28dd6366296ad5a1cbe63bc29919 from https://source.codeaurora.org/external/imx/linux-imx Fix CID 11024996 & 11024997 Fix Unchecked return value (CHECKED_RETURN) for fb_set_var() Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: Liu Ying <victor.liu@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-2483 media: mxc V4L2 capture: fix coverity issue 10953010Robby Cai
commit 7815ba78609414abe437110714413ac41826e78a from https://source.codeaurora.org/external/imx/linux-imx Fix invalid printk format string (PRINTF_ARGS) for type 'v4l2_std_id' which is __u64. Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: Liu Ying <victor.liu@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
2022-04-14LF-2229-2 media: csi: Fix the kernel dump issue for VTE testingRobby Cai
commit 11846c8dad7a67fb607099c74805f2e1d9e5414b from https://source.codeaurora.org/external/imx/linux-imx This is further/complete fix. the command is $ v4l_emma.sh 1 15 ... [ 7551.550391] Internal error: Oops: 17 [#1] PREEMPT SMP ARM [ 7551.557091] Modules linked in: 8021q ov5640_camera_mipi_v2 mxc_mipi_csi mx6s_capture [ 7551.564876] CPU: 1 PID: 1133 Comm: v4l2_capture_em Not tainted 5.8.0-next-20200807-lts-next+gedf77a2bf1a9 #1 [ 7551.574709] Hardware name: Freescale i.MX7 Dual (Device Tree) [ 7551.580473] PC is at __lock_acquire+0x524/0x3258 [ 7551.585100] LR is at 0x1 [ 7551.587642] pc : [<c0196d44>] lr : [<00000001>] psr: 200f0093 [ 7551.593917] sp : d81d1c08 ip : d81d0000 fp : d9076a00 [ 7551.599150] r10: c1805a04 r9 : 00000000 r8 : 00000001 [ 7551.604383] r7 : 00000000 r6 : 00000160 r5 : 00000000 r4 : 00000000 [ 7551.610918] r3 : c1620488 r2 : 00000000 r1 : 00000000 r0 : 00000160 [ 7551.617456] Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none [ 7551.624687] Control: 10c5387d Table: 9914c06a DAC: 00000051 [ 7551.630442] Process v4l2_capture_em (pid: 1133, stack limit = 0x710302de) [ 7551.637238] Stack: (0xd81d1c08 to 0xd81d2000) [ 7551.641608] 1c00: d9076f40 00000000 00000001 d9076f70 00000001 00000001 [ 7551.649799] 1c20: d9076f70 00000003 00000000 c0196b60 d9076a00 c0196b60 00000001 00000000 [ 7551.657989] 1c40: 00000002 d9076f90 d9076f50 00000000 00002955 c1c4fa14 27504366 c1c4c534 [ 7551.666179] 1c60: 0921e3b3 30722719 d9076f40 fffffffe d9076f40 00000000 00000003 d9076fb0 [ 7551.674369] 1c80: 00000003 00000001 d9076fb0 00000003 d9076a00 00000000 00000004 d9076fd0 [ 7551.682559] 1ca0: 00000004 00000001 d9076fd0 00000003 d9076a00 00000000 00000003 c1609388 [ 7551.690748] 1cc0: 00000003 00000000 00000000 00000160 00000000 600f0093 00000000 c1805a04 [ 7551.698938] 1ce0: c16093ac c019a414 00000001 00000080 00000000 c09c70e0 00000000 00000000 [ 7551.707128] 1d00: 00000000 c1805a04 c16093ac c019a414 00000001 00000080 00000000 bf000940 [ 7551.715318] 1d20: 00000000 00000000 00000000 c1609388 00000150 00000150 c09c70e0 600f0093 [ 7551.723508] 1d40: d9043c1c d904399c 00000150 00000000 bf003900 c0e944b0 00000001 00000000 [ 7551.731698] 1d60: c09c70e0 800f0013 d90439b8 00000000 00000006 c09c70e0 800f0013 c0e944b8 [ 7551.739888] 1d80: 00000001 800f0013 d9043b84 d9043840 d9043c1c d904399c d9043b38 bf0009a4 [ 7551.748078] 1da0: d81d1e74 00000004 d9043b70 d90438c4 00000001 d90438c4 00000000 c0994148 [ 7551.756268] 1dc0: d9043b38 c09c73bc d90438c4 00000001 d9043840 00000000 c0994148 d9043b38 [ 7551.764458] 1de0: 00000000 c09c7ad8 d90d2490 bf0004d4 d9044000 40045613 00000000 c0998a5c [ 7551.772648] 1e00: d9076a00 6a5d251c d9043840 00000000 d81d1e74 0000004c c0fd0604 00000001 [ 7551.780838] 1e20: 00000001 c0e94774 c159525c c0224c78 600f0013 c1609388 600f0013 00000000 [ 7551.789028] 1e40: 40045613 40045613 00000000 d81d1e74 00000000 becee7b0 00000000 c0999448 [ 7551.797218] 1e60: 00000000 d8e08640 c0998848 00000000 00000000 00000001 d81d1e74 00000001 [ 7551.805408] 1e80: 00000000 c1609388 d9117018 00000043 00000000 01c9e21b d43b0640 d43c9680 [ 7551.813598] 1ea0: d81d0000 c06b2e6c d9117000 c06a9b80 00000001 00000043 00000051 c06abb10 [ 7551.821788] 1ec0: 00000043 c1609388 db72e600 d43b0640 00000043 00000043 01c9e1d8 d81d1f78 [ 7551.829978] 1ee0: c06a9998 00000004 000007e6 c02c5b28 00000020 c1609388 d9076ec4 40045613 [ 7551.838168] 1f00: d8e08640 becee7b0 d8e08640 c0100080 d913c078 00000003 00000000 c02db0a4 [ 7551.846358] 1f20: d81d0000 d81d1fb0 00000000 c0100244 c0100244 c010b7d4 c02e8e7c c019a020 [ 7551.854548] 1f40: 00000000 00000004 d9254c80 c1609388 00000001 d43b0640 d43b0640 01c9e1d8 [ 7551.862737] 1f60: 00000043 00000000 00000000 00000004 000007e6 c02c5e60 00000000 c1609388 [ 7551.870927] 1f80: d9254c80 00000001 00000001 becee880 00000036 c0100244 d81d0000 00000036 [ 7551.879117] 1fa0: 00000000 c0100080 00000001 00000001 00000003 40045613 becee7b0 0003c3d8 [ 7551.887307] 1fc0: 00000001 00000001 becee880 00000036 0003c2a8 beceeb44 00000000 00000000 [ 7551.895497] 1fe0: 0003c0cc becee7a4 00013b9c b6ed2ae8 600f0030 00000003 00000000 00000000 [ 7551.903697] [<c0196d44>] (__lock_acquire) from [<c019a414>] (lock_acquire+0xe0/0x528) [ 7551.911545] [<c019a414>] (lock_acquire) from [<c0e944b0>] (_raw_spin_lock_irqsave+0x40/0x54) [ 7551.920004] [<c0e944b0>] (_raw_spin_lock_irqsave) from [<c09c70e0>] (vb2_buffer_done+0x98/0x34c) [ 7551.928822] [<c09c70e0>] (vb2_buffer_done) from [<bf0009a4>] (mx6s_stop_streaming+0xf4/0x1b0 [mx6s_capture]) [ 7551.938676] [<bf0009a4>] (mx6s_stop_streaming [mx6s_capture]) from [<c09c73bc>] (__vb2_queue_cancel+0x28/0x24c) [ 7551.948782] [<c09c73bc>] (__vb2_queue_cancel) from [<c09c7ad8>] (vb2_core_streamoff+0x18/0xac) [ 7551.957416] [<c09c7ad8>] (vb2_core_streamoff) from [<bf0004d4>] (mx6s_vidioc_streamoff+0x3c/0xc4 [mx6s_capture]) [ 7551.967615] [<bf0004d4>] (mx6s_vidioc_streamoff [mx6s_capture]) from [<c0998a5c>] (__video_do_ioctl+0x214/0x44c) [ 7551.977805] [<c0998a5c>] (__video_do_ioctl) from [<c0999448>] (video_usercopy+0x140/0x860) [ 7551.986087] [<c0999448>] (video_usercopy) from [<c02db0a4>] (sys_ioctl+0xec/0xb8c) [ 7551.993676] [<c02db0a4>] (sys_ioctl) from [<c0100080>] (ret_fast_syscall+0x0/0x28) [ 7552.001254] Exception stack(0xd81d1fa8 to 0xd81d1ff0) [ 7552.006318] 1fa0: 00000001 00000001 00000003 40045613 becee7b0 0003c3d8 [ 7552.014508] 1fc0: 00000001 00000001 becee880 00000036 0003c2a8 beceeb44 00000000 00000000 [ 7552.022695] 1fe0: 0003c0cc becee7a4 00013b9c b6ed2ae8 [ 7552.027761] Code: 83a05001 85823488 93a05001 ea0001e0 (e5908000) [ 7552.033869] ---[ end trace ede3c18666562d95 ]--- [ 7552.038498] note: v4l2_capture_em[1133] exited with preempt_count 2 ... the root cause is, for the discard buffer, it's not queued for v4l2 buffer, thus can't call vb2_buffer_done() on it. The patch is to check if it's the discard buffer before call vb2_buffer_done(), and do proper action accordingly. Signed-off-by: Robby Cai <robby.cai@nxp.com> Reviewed-by: G.n. Zhou <guoniu.zhou@nxp.com> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>