linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Figa <tfiga@chromium.org>
To: Jonathan Bakker <xc-racer2@live.ca>
Cc: linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	kgene@kernel.org, Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	"list@263.net:IOMMU DRIVERS <iommu@lists.linux-foundation.org>,
	Joerg Roedel <joro@8bytes.org>,
	" <linux-arm-kernel@lists.infradead.org>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH 10/11] media: exynos4-is: Prevent duplicate call to media_pipeline_stop
Date: Mon, 20 Jul 2020 15:10:07 +0200	[thread overview]
Message-ID: <CAAFQd5ABvEnt7QQHmwwFyCqRLMabE=Vs_e7FrG3fMmrAWgD_bQ@mail.gmail.com> (raw)
In-Reply-To: <BN6PR04MB0660C1942C3738F9F9D1AAAFA3620@BN6PR04MB0660.namprd04.prod.outlook.com>

On Sat, Jul 11, 2020 at 8:17 PM Jonathan Bakker <xc-racer2@live.ca> wrote:
>
> Hi Tomasz,
>
> On 2020-07-07 11:44 a.m., Tomasz Figa wrote:
> > Hi Jonathan,
> >
> > On Sat, Apr 25, 2020 at 07:26:49PM -0700, Jonathan Bakker wrote:
> >> media_pipeline_stop can be called from both release and streamoff,
> >> so make sure they're both protected under the streaming flag and
> >> not just one of them.
> >
> > First of all, thanks for the patch.
> >
> > Shouldn't it be that release calls streamoff, so that only streamoff
> > is supposed to have the call to media_pipeline_stop()?
> >
>
> I can't say that I understand the whole media subsystem enough to know :)
> Since media_pipeline_start is called in streamon, it makes sense that streamoff
> should have the media_pipeline_stop call.  However, even after removing the call
> in fimc_capture_release I'm still getting a backtrace such as
>
> [   73.843117] ------------[ cut here ]------------
> [   73.843251] WARNING: CPU: 0 PID: 1575 at drivers/media/mc/mc-entity.c:554 media_pipeline_stop+0x20/0x2c [mc]
> [   73.843265] Modules linked in: s5p_fimc v4l2_fwnode exynos4_is_common videobuf2_dma_contig pvrsrvkm_s5pv210_sgx540_120 videobuf2_memops v4l2_mem2mem brcmfmac videobuf2_v4l2 videobuf2_common hci_uart sha256_generic libsha256 btbcm bluetooth cfg80211 brcmutil ecdh_generic ecc ce147 libaes s5ka3dfx videodev atmel_mxt_ts mc pwm_vibra rtc_max8998
> [   73.843471] CPU: 0 PID: 1575 Comm: v4l2-ctl Not tainted 5.7.0-14534-g2b33418b254e-dirty #669
> [   73.843487] Hardware name: Samsung S5PC110/S5PV210-based board
> [   73.843562] [<c010c7c4>] (unwind_backtrace) from [<c010a120>] (show_stack+0x10/0x14)
> [   73.843613] [<c010a120>] (show_stack) from [<c0117038>] (__warn+0xbc/0xd4)
> [   73.843661] [<c0117038>] (__warn) from [<c01170b0>] (warn_slowpath_fmt+0x60/0xb8)
> [   73.843734] [<c01170b0>] (warn_slowpath_fmt) from [<bf00c20c>] (media_pipeline_stop+0x20/0x2c [mc])
> [   73.843867] [<bf00c20c>] (media_pipeline_stop [mc]) from [<bf145c48>] (fimc_cap_streamoff+0x38/0x48 [s5p_fimc])
> [   73.844109] [<bf145c48>] (fimc_cap_streamoff [s5p_fimc]) from [<bf03cbf4>] (__video_do_ioctl+0x220/0x448 [videodev])
> [   73.844308] [<bf03cbf4>] (__video_do_ioctl [videodev]) from [<bf03d600>] (video_usercopy+0x114/0x498 [videodev])
> [   73.844438] [<bf03d600>] (video_usercopy [videodev]) from [<c0205024>] (ksys_ioctl+0x20c/0xa10)
> [   73.844484] [<c0205024>] (ksys_ioctl) from [<c0100060>] (ret_fast_syscall+0x0/0x54)
> [   73.844505] Exception stack(0xe5083fa8 to 0xe5083ff0)
> [   73.844546] 3fa0:                   0049908d bef8f8c0 00000003 40045613 bef8d5ac 004c1d16
> [   73.844590] 3fc0: 0049908d bef8f8c0 bef8f8c0 00000036 bef8d5ac 00000000 b6d6b320 bef8faf8
> [   73.844620] 3fe0: 004e3ed4 bef8c718 004990bb b6f00d0a
> [   73.844642] ---[ end trace e6a4a8b2f20addd4 ]---
>
> The command I'm using for testing is
>
> v4l2-ctl --verbose -d 1 --stream-mmap=3 --stream-skip=2 --stream-to=./test.yuv --stream-count=1
>
> Since I noticed that the streaming flag was being checked fimc_capture_release
> but not in fimc_cap_streamoff, I assumed that it was simply a missed check.  Comparing
> with other drivers, they seem to call media_pipeline_stop in their vb2_ops stop_streaming
> callback.

vb2 does a lot of state handling internally and makes sure that driver
ops are not called when unnecessary, preventing double calls for
example. I suppose it could be a better place to stop the pipeline
indeed. However, ...

>
> I'm willing to test various options
>

I think it could make sense to add something like WARN_ON(1) inside
media_pipeline_stop() and then check where the first call came from.

Best regards,
Tomasz

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-07-20 13:12 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200426022650.10355-1-xc-racer2@live.ca>
2020-04-26  2:26 ` [PATCH 01/11] media: exynos4-is: Remove static driver data for S5PV210 FIMC variants Jonathan Bakker
2020-07-07 17:33   ` Tomasz Figa
2020-07-08 14:45   ` Sylwester Nawrocki
2020-04-26  2:26 ` [PATCH 02/11] media: exynos4-is: Request syscon only if ISP writeback is present Jonathan Bakker
2020-07-07 17:34   ` Tomasz Figa
2020-07-08 14:47   ` Sylwester Nawrocki
2020-04-26  2:26 ` [PATCH 03/11] media: exynos4-is: Fix nullptr when no CSIS device present Jonathan Bakker
2020-07-07 17:55   ` Tomasz Figa
2020-07-08 15:11     ` Sylwester Nawrocki
2020-07-11 16:27       ` Jonathan Bakker
2020-07-08 14:49   ` Sylwester Nawrocki
2020-04-26  2:26 ` [PATCH 04/11] media: exynos4-is: Correct missing entity function initialization Jonathan Bakker
2020-07-07 18:09   ` Tomasz Figa
2020-07-08 15:34     ` Sylwester Nawrocki
2020-07-11 16:35       ` Jonathan Bakker
2020-04-26  2:26 ` [PATCH 05/11] media: exynos4-is: Improve support for sensors with multiple pads Jonathan Bakker
2020-07-07 18:13   ` Tomasz Figa
2020-07-11 18:21     ` Jonathan Bakker
2020-04-26  2:26 ` [PATCH 06/11] media: exynos4-is: Properly set JPEG options when not using CSIS Jonathan Bakker
2020-07-07 18:23   ` Tomasz Figa
2020-07-08 15:45     ` Sylwester Nawrocki
2020-07-11 16:43       ` Jonathan Bakker
2020-07-08 15:46   ` Sylwester Nawrocki
2020-04-26  2:26 ` [PATCH 07/11] media: exynos4-is: Add support for multiple sensors on one port Jonathan Bakker
2020-07-07 18:36   ` Tomasz Figa
2020-07-11 16:48     ` Jonathan Bakker
2020-04-26  2:26 ` [PATCH 08/11] media: exynos4-is: Remove inh_sensor_ctrls Jonathan Bakker
2020-07-07 18:37   ` Tomasz Figa
2020-07-08 15:47   ` Sylwester Nawrocki
2020-04-26  2:26 ` [PATCH 09/11] media: exynos4-is: Remove unused struct member input_index Jonathan Bakker
2020-07-07 18:38   ` Tomasz Figa
2020-07-08 15:49   ` Sylwester Nawrocki
2020-04-26  2:26 ` [PATCH 10/11] media: exynos4-is: Prevent duplicate call to media_pipeline_stop Jonathan Bakker
2020-07-07 18:44   ` Tomasz Figa
2020-07-11 18:17     ` Jonathan Bakker
2020-07-20 13:10       ` Tomasz Figa [this message]
2020-07-24 23:46         ` Jonathan Bakker
2020-07-27 13:48           ` Tomasz Figa
2020-04-26  2:26 ` [PATCH 11/11] media: exynos4-is: Correct parallel port probing Jonathan Bakker
2020-07-07 18:48   ` Tomasz Figa
2020-07-08 16:15   ` Sylwester Nawrocki
2020-07-11 18:18     ` Jonathan Bakker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAFQd5ABvEnt7QQHmwwFyCqRLMabE=Vs_e7FrG3fMmrAWgD_bQ@mail.gmail.com' \
    --to=tfiga@chromium.org \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=xc-racer2@live.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).