Linux Media Controller development
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil+cisco@kernel.org>
To: linux-media@vger.kernel.org
Cc: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Subject: Re: [PATCHv2 15/19] media: samsung: s3c-camif: drop unnecessary vb2_queue_release
Date: Wed, 29 Jul 2026 09:48:03 +0200	[thread overview]
Message-ID: <79a00ba8-65f5-4f3b-afa4-bfd662dba156@kernel.org> (raw)
In-Reply-To: <c4696364bae6b1ac7c5a467e882af2218cb0fa5b.1785157986.git.hverkuil+cisco@kernel.org>

On 27/07/2026 15:13, Hans Verkuil wrote:
> The vb2_queue_release() function should not be called directly from a
> driver. Leave that to the helper functions.
> 
> Use _vb2_fop_release instead of vb2_queue_release/v4l2_fh_release.
> 
> No need to call camif_stop_capture: _vb2_fop_release will call
> the stop_streaming op if streaming is in progress, and that op
> calls camif_stop_capture.
> 
> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
> Cc: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
> ---
>  drivers/media/platform/samsung/s3c-camif/camif-capture.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/samsung/s3c-camif/camif-capture.c b/drivers/media/platform/samsung/s3c-camif/camif-capture.c
> index ed1a1d693293..3cbf58b2128e 100644
> --- a/drivers/media/platform/samsung/s3c-camif/camif-capture.c
> +++ b/drivers/media/platform/samsung/s3c-camif/camif-capture.c
> @@ -572,16 +572,11 @@ static int s3c_camif_close(struct file *file)
>  
>  	mutex_lock(&camif->lock);
>  
> -	if (vp->owner == file_to_v4l2_fh(file)) {
> -		camif_stop_capture(vp);
> -		vb2_queue_release(&vp->vb_queue);
> -		vp->owner = NULL;
> -	}
> +	ret = _vb2_fop_release(file, NULL);
>  
>  	sensor_set_power(camif, 0);
>  
>  	pm_runtime_put(camif->dev);
> -	ret = v4l2_fh_release(file);
>  
>  	mutex_unlock(&camif->lock);
>  	return ret;

I'm dropping this patch from the series: this driver doesn't set vdev->queue, which is
what _vb2_fop_release relies on.

It's probably just a matter of setting that field, but it needs a bit more research
than I have time for now.

Regards,

	Hans

  reply	other threads:[~2026-07-29  7:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27 13:12 [PATCHv2 00/19] media: clean up unnecessary vb2_queue_release calls Hans Verkuil
2026-07-27 13:12 ` [PATCHv2 01/19] media: videobuf2-v4l2.h: improve vb2_queue_release() documentation Hans Verkuil
2026-07-27 13:12 ` [PATCHv2 02/19] media: pci: hws: drop call to vb2_queue_release Hans Verkuil
2026-07-27 13:12 ` [PATCHv2 03/19] media: pci: ipu6: drop calls to vb2_video_unregister_device and vb2_queue_release Hans Verkuil
2026-07-27 13:12 ` [PATCHv2 04/19] media: pci: zoran: use vb2_video_unregister_device Hans Verkuil
2026-07-27 13:12 ` [PATCHv2 05/19] media: platform: amd: isp4: drop vb2_queue_release calls Hans Verkuil
2026-07-27 13:12 ` [PATCHv2 06/19] media: amlogic: c3: isp: " Hans Verkuil
2026-07-27 13:12 ` [PATCHv2 07/19] media: amphion: drop unnecessary vb2_queue_release call Hans Verkuil
2026-07-27 15:57   ` Frank Li
2026-07-28  1:30   ` [EXT] " Ming Qian
2026-07-27 13:12 ` [PATCHv2 08/19] media: arm: mali-c55: drop unnecessary vb2_queue_release calls Hans Verkuil
2026-07-27 13:12 ` [PATCHv2 09/19] media: imagination: e5010-jpeg-enc: drop vb2_queue_release Hans Verkuil
2026-07-27 13:12 ` [PATCHv2 10/19] media: nuvoton: drop unnecessary vb2_queue_release calls Hans Verkuil
2026-07-27 13:12 ` [PATCHv2 11/19] media: nxp: imx7-media-csi: use _vb2_fop_release/vb2_video_unregister_device Hans Verkuil
2026-07-27 15:56   ` Frank Li
2026-07-27 13:12 ` [PATCHv2 12/19] media: raspberrypi: pisp_be: use vb2_video_unregister_device Hans Verkuil
2026-07-27 13:13 ` [PATCHv2 13/19] media: renesas: rzv2h-cru: " Hans Verkuil
2026-07-27 13:13 ` [PATCHv2 14/19] media: renesas: rzv2h-ivc: drop unnecessary vb2_queue_release calls Hans Verkuil
2026-07-27 13:13 ` [PATCHv2 15/19] media: samsung: s3c-camif: drop unnecessary vb2_queue_release Hans Verkuil
2026-07-29  7:48   ` Hans Verkuil [this message]
2026-07-27 13:13 ` [PATCHv2 16/19] media: ti: j721e-csi2rx: use vb2_video_unregister_device Hans Verkuil
2026-07-28  6:00   ` Jai Luthra
2026-07-27 13:13 ` [PATCHv2 17/19] staging: media: imx: drop vb2_queue_release call Hans Verkuil
2026-07-27 15:55   ` Frank Li
2026-07-27 13:13 ` [PATCHv2 18/19] staging: media: ipu7: drop unnecessary cleanup calls Hans Verkuil
2026-07-27 13:13 ` [PATCHv2 19/19] media: renesas: rzg2l-cru: drop unnecessary vb2_queue_release Hans Verkuil

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=79a00ba8-65f5-4f3b-afa4-bfd662dba156@kernel.org \
    --to=hverkuil+cisco@kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=sylvester.nawrocki@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