Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935333AbdCLTV5 (ORCPT ); Sun, 12 Mar 2017 15:21:57 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:34933 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934858AbdCLTVv (ORCPT ); Sun, 12 Mar 2017 15:21:51 -0400 Subject: Re: [PATCH v5 00/39] i.MX Media Driver To: Russell King - ARM Linux References: <1489121599-23206-1-git-send-email-steve_longerbeam@mentor.com> <20170312175118.GP21222@n2100.armlinux.org.uk> Cc: robh+dt@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org, kernel@pengutronix.de, fabio.estevam@nxp.com, mchehab@kernel.org, hverkuil@xs4all.nl, nick@shmanahar.org, markus.heiser@darmarIT.de, p.zabel@pengutronix.de, laurent.pinchart+renesas@ideasonboard.com, bparrot@ti.com, geert@linux-m68k.org, arnd@arndb.de, sudipm.mukherjee@gmail.com, minghsiu.tsai@mediatek.com, tiffany.lin@mediatek.com, jean-christophe.trotin@st.com, horms+renesas@verge.net.au, niklas.soderlund+renesas@ragnatech.se, robert.jarzmik@free.fr, songjun.wu@microchip.com, andrew-ct.chen@mediatek.com, gregkh@linuxfoundation.org, shuah@kernel.org, sakari.ailus@linux.intel.com, pavel@ucw.cz, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, Steve Longerbeam From: Steve Longerbeam Message-ID: <191ef88d-2925-2264-6c77-46647394fc72@gmail.com> Date: Sun, 12 Mar 2017 12:21:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170312175118.GP21222@n2100.armlinux.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6959 Lines: 104 On 03/12/2017 10:51 AM, Russell King - ARM Linux wrote: > I've just looked at my test system's dmesg, and spotted this in the log. > It's been a while since these popped out of the kernel, so I don't know > what caused them (other than the obvious, a media-ctl command.) > > My script which sets this up only enables links, and then configures the > formats etc, and doesn't disable them, so I don't see why the power > count should be going negative. There's actually nothing preventing userland from disabling a link multiple times, and imx_media_link_notify() complies, and so csi_s_power(OFF) gets called multiple times, and so that WARN_ON() in there is silly, I borrowed this from other MC driver examples, but it makes no sense to me, I'll remove it and prevent the power count from going negative. Steve > > ------------[ cut here ]------------ > WARNING: CPU: 1 PID: 1889 at drivers/staging/media/imx/imx-media-csi.c:806 csi_s_power+0x9c/0xa8 [imx_media_csi] > Modules linked in: caam_jr uvcvideo snd_soc_imx_sgtl5000 snd_soc_fsl_asoc_card snd_soc_imx_spdif imx_media_csi(C) imx6_mipi_csi2(C) snd_soc_imx_audmux snd_soc_sgtl5000 imx219 imx_media_ic(C) imx_media_capture(C) imx_media_vdic(C) caam video_multiplexer imx_sdma coda v4l2_mem2mem videobuf2_v4l2 imx2_wdt imx_vdoa videobuf2_dma_contig videobuf2_core videobuf2_vmalloc videobuf2_memops snd_soc_fsl_ssi > imx_thermal snd_soc_fsl_spdif imx_pcm_dma imx_media(C) imx_media_common(C) nfsd > rc_pinnacle_pctv_hd dw_hdmi_ahb_audio dw_hdmi_cec etnaviv > CPU: 1 PID: 1889 Comm: media-ctl Tainted: G C 4.11.0-rc1+ #2125 > Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) > Backtrace: > [] (dump_backtrace) from [] (show_stack+0x18/0x1c) > r6:600e0013 r5:ffffffff r4:00000000 r3:00000000 > [] (show_stack) from [] (dump_stack+0xa4/0xdc) > [] (dump_stack) from [] (__warn+0xdc/0x108) > r6:bf124014 r5:00000000 r4:00000000 r3:c09ea4a8 > [] (__warn) from [] (warn_slowpath_null+0x28/0x30) > r10:ede00010 r8:ede4a348 r7:d039501c r6:d0395140 r5:00000000 r4:d0395010 > [] (warn_slowpath_null) from [] (csi_s_power+0x9c/0xa8 [imx_media_csi]) > [] (csi_s_power [imx_media_csi]) from [] (imx_media_set_power+0x3c/0x108 [imx_media_common]) > r7:d039501c r6:00000000 r5:00000000 r4:0000000c > [] (imx_media_set_power [imx_media_common]) from [] (imx_media_pipeline_set_power+0x38/0x40 [imx_media_common]) > r10:00000001 r9:00000001 r8:ede4a348 r7:ede00010 r6:ede4a348 r5:d039501c > r4:00000001 > [] (imx_media_pipeline_set_power [imx_media_common]) from [] (imx_media_link_notify+0xf0/0x144 [imx_media]) > r7:ede00010 r6:ed59f900 r5:00000000 r4:d039501c > [] (imx_media_link_notify [imx_media]) from [] (__media_entity_setup_link+0x110/0x1d8) > r10:c0347c03 r9:d7eb3dc8 r8:befe92b0 r7:ede00010 r6:00000000 r5:00000001 > r4:ed59f900 r3:bf052058 > [] (__media_entity_setup_link) from [] (media_device_setup_link+0x84/0x90) > r7:ede00010 r6:ede00010 r5:ef3fd810 r4:d7eb3dc8 > [] (media_device_setup_link) from [] (media_device_ioctl+0xa4/0x148) > r6:00000000 r5:d7eb3dc8 r4:c077b014 r3:c04f9b2c > [] (media_device_ioctl) from [] (media_ioctl+0x38/0x4c) > r10:ed5eca68 r9:d7eb2000 r8:befe92b0 r7:00000003 r6:00000003 r5:e82ca280 > r4:c0190304 > [] (media_ioctl) from [] (do_vfs_ioctl+0x98/0x9a0) > [] (do_vfs_ioctl) from [] (SyS_ioctl+0x3c/0x60) > r10:00000000 r9:d7eb2000 r8:befe92b0 r7:00000003 r6:c0347c03 r5:e82ca280 > r4:e82ca280 > [] (SyS_ioctl) from [] (ret_fast_syscall+0x0/0x1c) > r8:c000ff04 r7:00000036 r6:000261d0 r5:00000001 r4:009162e8 r3:00000001 > ---[ end trace 4fdd40e5adfc4485 ]--- > ------------[ cut here ]------------ > WARNING: CPU: 1 PID: 1889 at drivers/staging/media/imx/imx-media-csi.c:806 csi_s_power+0x9c/0xa8 [imx_media_csi] > Modules linked in: caam_jr uvcvideo snd_soc_imx_sgtl5000 snd_soc_fsl_asoc_card snd_soc_imx_spdif imx_media_csi(C) imx6_mipi_csi2(C) snd_soc_imx_audmux snd_soc_sgtl5000 imx219 imx_media_ic(C) imx_media_capture(C) imx_media_vdic(C) caam video_multiplexer imx_sdma coda v4l2_mem2mem videobuf2_v4l2 imx2_wdt imx_vdoa videobuf2_dma_contig videobuf2_core videobuf2_vmalloc videobuf2_memops snd_soc_fsl_ssi > imx_thermal snd_soc_fsl_spdif imx_pcm_dma imx_media(C) imx_media_common(C) nfsd > rc_pinnacle_pctv_hd dw_hdmi_ahb_audio dw_hdmi_cec etnaviv > CPU: 1 PID: 1889 Comm: media-ctl Tainted: G WC 4.11.0-rc1+ #2125 > Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) > Backtrace: > [] (dump_backtrace) from [] (show_stack+0x18/0x1c) > r6:600e0013 r5:ffffffff r4:00000000 r3:00000000 > [] (show_stack) from [] (dump_stack+0xa4/0xdc) > [] (dump_stack) from [] (__warn+0xdc/0x108) > r6:bf124014 r5:00000000 r4:00000000 r3:c09ea4a8 > [] (__warn) from [] (warn_slowpath_null+0x28/0x30) > r10:ede00010 r8:ede4a348 r7:ee000800 r6:d0395140 r5:00000000 r4:d0395010 > [] (warn_slowpath_null) from [] (csi_s_power+0x9c/0xa8 [imx_media_csi]) > [] (csi_s_power [imx_media_csi]) from [] (imx_media_set_power+0x3c/0x108 [imx_media_common]) > r7:ee000800 r6:00000000 r5:00000000 r4:0000000c > [] (imx_media_set_power [imx_media_common]) from [] (imx_media_pipeline_set_power+0x38/0x40 [imx_media_common]) > r10:00000001 r9:00000001 r8:ede4a348 r7:ede00010 r6:ede4a348 r5:ee000800 > r4:00000001 > [] (imx_media_pipeline_set_power [imx_media_common]) from [] (imx_media_link_notify+0xf0/0x144 [imx_media]) > r7:ede00010 r6:d0320480 r5:ee000800 r4:ee000800 > [] (imx_media_link_notify [imx_media]) from [] (__media_entity_setup_link+0x110/0x1d8) > r10:c0347c03 r9:d7eb3dc8 r8:befe92b0 r7:ede00010 r6:00000000 r5:00000001 > r4:d0320480 r3:bf052058 > [] (__media_entity_setup_link) from [] (media_device_setup_link+0x84/0x90) > r7:ede00010 r6:ede00010 r5:d039501c r4:d7eb3dc8 > [] (media_device_setup_link) from [] (media_device_ioctl+0xa4/0x148) > r6:00000000 r5:d7eb3dc8 r4:c077b014 r3:c04f9b2c > [] (media_device_ioctl) from [] (media_ioctl+0x38/0x4c) > r10:ed5eca68 r9:d7eb2000 r8:befe92b0 r7:00000003 r6:00000003 r5:e82ca500 > r4:c0190304 > [] (media_ioctl) from [] (do_vfs_ioctl+0x98/0x9a0) > [] (do_vfs_ioctl) from [] (SyS_ioctl+0x3c/0x60) > r10:00000000 r9:d7eb2000 r8:befe92b0 r7:00000003 r6:c0347c03 r5:e82ca500 > r4:e82ca500 > [] (SyS_ioctl) from [] (ret_fast_syscall+0x0/0x1c) > r8:c000ff04 r7:00000036 r6:000261d0 r5:00000001 r4:0091737c r3:00000001 > ---[ end trace 4fdd40e5adfc4486 ]--- >