From patchwork Thu Jan 12 03:22:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9511943 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 35313601E5 for ; Thu, 12 Jan 2017 03:23:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2962F28663 for ; Thu, 12 Jan 2017 03:23:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D6C82868B; Thu, 12 Jan 2017 03:23:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B91D28663 for ; Thu, 12 Jan 2017 03:23:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751658AbdALDXU (ORCPT ); Wed, 11 Jan 2017 22:23:20 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:53653 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750996AbdALDXN (ORCPT ); Wed, 11 Jan 2017 22:23:13 -0500 Received: from svr-orw-mbx-02.mgc.mentorg.com ([147.34.90.202]) by relay1.mentorg.com with esmtp id 1cRVyc-00053g-PG from Steve_Longerbeam@mentor.com ; Wed, 11 Jan 2017 19:22:58 -0800 Received: from [172.30.88.90] (147.34.91.1) by svr-orw-mbx-02.mgc.mentorg.com (147.34.90.202) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 11 Jan 2017 19:22:54 -0800 Subject: Re: [PATCH v3 00/24] i.MX Media Driver To: Tim Harvey , Steve Longerbeam References: <1483755102-24785-1-git-send-email-steve_longerbeam@mentor.com> CC: Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , Fabio Estevam , Russell King - ARM Linux , , Hans Verkuil , , , Philipp Zabel , , , , Arnd Bergmann , , , , , Simon Horman , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , , , , Greg Kroah-Hartman , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , linux-media , From: Steve Longerbeam Message-ID: Date: Wed, 11 Jan 2017 19:22:54 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: X-ClientProxiedBy: svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) To svr-orw-mbx-02.mgc.mentorg.com (147.34.90.202) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Tim, On 01/11/2017 03:14 PM, Tim Harvey wrote: > > > > Hi Steve, > > I took a stab at testing this today on a gw51xx which has an adv7180 > hooked up as follows: > - i2c3@0x20 > - 8bit data bus from DAT12 to DAT19, HSYNC, VSYNC, PIXCLK on CSI0 pads > (CSI0_IPU1) > - PWRDWN# on MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20 > - IRQ# on MX6QDL_PAD_CSI0_DAT5__GPIO5_IO23 > - all three analog inputs available to off-board connector > > My patch to the imx6qdl-gw51xx dtsi is: As long as you used the patch to imx6qdl-sabreauto.dtsti that adds the adv7180 support as a guide, you should be ok here. > > > > > On an IMX6Q I'm getting the following when the adv7180 module loads: > [ 12.862477] adv7180 2-0020: chip found @ 0x20 (21a8000.i2c) > [ 12.907767] imx-media: Registered subdev adv7180 2-0020 > [ 12.907793] imx-media soc:media@0: Entity type for entity adv7180 > 2-0020 was not initialized! > [ 12.907867] imx-media: imx_media_create_link: adv7180 2-0020:0 -> > ipu1_csi0_mux:1 > > Is the warning that adv7180 was not initialized expected and or an issue? Yeah it's still a bug in the adv7180 driver, needs fixing. > > Now that your driver is hooking into the current media framework, I'm > not at all clear on how to link and configure the media entities. It's all documented at Documentation/media/v4l-drivers/imx.rst. Follow the SabreAuto pipeline setup example. > > > > Additionally I've found that on an IMX6S/IMX6DL we crash while > registering the media-ic subdev's: > [ 3.975473] imx-media: Registered subdev ipu1_csi1_mux > [ 3.980921] imx-media: Registered subdev ipu1_csi0_mux > [ 4.003205] imx-media: Registered subdev ipu1_ic_prpenc > [ 4.025373] imx-media: Registered subdev ipu1_ic_prpvf > [ 4.037944] ------------[ cut here ]------------ > [ 4.042571] Kernel BUG at c06717dc [verbose debug info unavailable] > [ 4.048845] Internal error: Oops - BUG: 0 [#1] SMP ARM > [ 4.053990] Modules linked in: > [ 4.057076] CPU: 1 PID: 1 Comm: swapper/0 Not tainted > 4.9.0-rc6-00524-g84dad6e-dirty #446 > [ 4.065260] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) > ... > [ 4.296250] [] (v4l2_subdev_init) from [] > (imx_ic_probe+0x94/0x1ac) > [ 4.304271] [] (imx_ic_probe) from [] > (platform_drv_probe+0x54/0xb8) > [ 4.312373] r9:c0d5e858 r8:00000000 r7:fffffdfb r6:c0e5dbf8 > r5:da603810 r4:c16738d8 > [ 4.320129] [] (platform_drv_probe) from [] > (driver_probe_device+0x20c/0x2c0) > [ 4.329010] r7:c0e5dbf8 r6:00000000 r5:da603810 r4:c16738d8 > [ 4.334681] [] (driver_probe_device) from [] > (__driver_attach+0xc8/0xcc) > [ 4.343129] r9:c0d5e858 r8:00000000 r7:00000000 r6:da603844 > r5:c0e5dbf8 r4:da603810 > [ 4.350889] [] (__driver_attach) from [] > (bus_for_each_dev+0x74/0xa8) > [ 4.359078] r7:00000000 r6:c0515a2c r5:c0e5dbf8 r4:00000000 > [ 4.364753] [] (bus_for_each_dev) from [] > (driver_attach+0x20/0x28) > > I assume there is an iteration that needs a test on a missing pointer > only available on chips with both IPU's or PRP Yep, I only have quad boards here so I haven't gotten around to testing on S/DL. But it looks like I forgot to clear out the csi subdev pointer array before passing it to imx_media_of_parse(). I think that might explain the OOPS above. Try this patch: Steve Tested-by: Tim Harvey --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c index 357654d..0cf2d61 100644 --- a/drivers/staging/media/imx/imx-media-dev.c +++ b/drivers/staging/media/imx/imx-media-dev.c @@ -379,7 +379,7 @@ static int imx_media_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *node = dev->of_node; - struct imx_media_subdev *csi[4]; + struct imx_media_subdev *csi[4] = {0}; struct imx_media_dev *imxmd; int ret;