From: Johan Hovold <johan@kernel.org>
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Robert Foss <rfoss@kernel.org>, Todor Tomov <todor.too@gmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hansverk@cisco.com>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Milen Mitkov <quic_mmitkov@quicinc.com>,
linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
Johan Hovold <johan+linaro@kernel.org>,
stable@vger.kernel.org
Subject: Re: [PATCH v2 1/2] media: qcom: camss: Remove use_count guard in stop_streaming
Date: Wed, 17 Jul 2024 11:06:33 +0200 [thread overview]
Message-ID: <ZpeJmWTfZGUXsc7K@hovoldconsulting.com> (raw)
In-Reply-To: <20240716-linux-next-24-07-13-camss-fixes-v2-1-e60c9f6742f2@linaro.org>
On Tue, Jul 16, 2024 at 11:13:24PM +0100, Bryan O'Donoghue wrote:
> The use_count check was introduced so that multiple concurrent Raw Data
> Interfaces RDIs could be driven by different virtual channels VCs on the
> CSIPHY input driving the video pipeline.
>
> This is an invalid use of use_count though as use_count pertains to the
> number of times a video entity has been opened by user-space not the number
> of active streams.
>
> If use_count and stream-on count don't agree then stop_streaming() will
> break as is currently the case and has become apparent when using CAMSS
> with libcamera's released softisp 0.3.
>
> The use of use_count like this is a bit hacky and right now breaks regular
> usage of CAMSS for a single stream case. As an example the "qcam"
> application in libcamera will fail with an -EBUSY result on stream stop and
> cannot then subsequently be restarted.
No, stopping qcam results in the splat below, and then it cannot be
started again and any attempts to do so fails with -EBUSY.
> The kernel log for this fault looks like this:
>
> [ 1265.509831] WARNING: CPU: 5 PID: 919 at drivers/media/common/videobuf2/videobuf2-core.c:2183 __vb2_queue_cancel+0x230/0x2c8 [videobuf2_common]
> ...
> [ 1265.510630] Call trace:
> [ 1265.510636] __vb2_queue_cancel+0x230/0x2c8 [videobuf2_common]
> [ 1265.510648] vb2_core_streamoff+0x24/0xcc [videobuf2_common]
> [ 1265.510660] vb2_ioctl_streamoff+0x5c/0xa8 [videobuf2_v4l2]
> [ 1265.510673] v4l_streamoff+0x24/0x30 [videodev]
> [ 1265.510707] __video_do_ioctl+0x190/0x3f4 [videodev]
> [ 1265.510732] video_usercopy+0x304/0x8c4 [videodev]
> [ 1265.510757] video_ioctl2+0x18/0x34 [videodev]
> [ 1265.510782] v4l2_ioctl+0x40/0x60 [videodev]
> ...
> [ 1265.510944] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 0 in active state
> [ 1265.511175] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 1 in active state
> [ 1265.511398] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 2 in active st
Johan
next prev parent reply other threads:[~2024-07-17 9:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-16 22:13 [PATCH v2 0/2] media: qcom: camss: Fix two CAMSS bugs found by dogfooding with SoftISP Bryan O'Donoghue
2024-07-16 22:13 ` [PATCH v2 1/2] media: qcom: camss: Remove use_count guard in stop_streaming Bryan O'Donoghue
2024-07-17 9:06 ` Johan Hovold [this message]
2024-07-17 10:43 ` Bryan O'Donoghue
2024-07-17 11:04 ` Johan Hovold
2024-07-16 22:13 ` [PATCH v2 2/2] media: qcom: camss: Fix ordering of pm_runtime_enable Bryan O'Donoghue
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=ZpeJmWTfZGUXsc7K@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=hansverk@cisco.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=johan+linaro@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab+samsung@kernel.org \
--cc=mchehab@kernel.org \
--cc=quic_mmitkov@quicinc.com \
--cc=rfoss@kernel.org \
--cc=stable@vger.kernel.org \
--cc=todor.too@gmail.com \
/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