From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
Arthur Marsh <arthur.marsh@internode.on.net>
Subject: Re: [PATCH for v6.14] media: rtl2832_sdr: assign vb2 lock before vb2_queue_init
Date: Wed, 12 Mar 2025 16:39:59 +0100 [thread overview]
Message-ID: <20250312163959.5c081bf8@sal.lan> (raw)
In-Reply-To: <51010d80-56a6-4803-82bb-6632ca7f1ae2@xs4all.nl>
Em Mon, 24 Feb 2025 15:40:58 +0100
Hans Verkuil <hverkuil@xs4all.nl> escreveu:
> Commit c780d01cf1a6 ("media: vb2: vb2_core_queue_init(): sanity check lock and
> wait_prepare/finish") added a sanity check to ensure that if there are no
> wait_prepare/finish callbacks set by the driver, then the vb2_queue lock must
> be set, since otherwise the vb2 core cannot do correct locking.
>
> The rtl2832_sdr.c triggered this warning: it turns out that while the driver
> does set this lock, it sets it too late. So move it up to before the
> vb2_queue_init() call.
>
> Reported-by: Arthur Marsh <arthur.marsh@internode.on.net>
> Fixes: 8fcd2795d22a ("media: rtl2832_sdr: drop vb2_ops_wait_prepare/finish")
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Patch looks good to me. As Arthur already tested, it sounds ready to go.
Feel free to pick it and merge if you want:
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Otherwise, I'll try to do it later this week.
> ---
> Arthur, it would be great if you can test this patch!
>
> Regards,
>
> Hans
> ---
> diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c
> index 05254d8717db..0357624968f1 100644
> --- a/drivers/media/dvb-frontends/rtl2832_sdr.c
> +++ b/drivers/media/dvb-frontends/rtl2832_sdr.c
> @@ -1363,6 +1363,7 @@ static int rtl2832_sdr_probe(struct platform_device *pdev)
> dev->vb_queue.ops = &rtl2832_sdr_vb2_ops;
> dev->vb_queue.mem_ops = &vb2_vmalloc_memops;
> dev->vb_queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
> + dev->vb_queue.lock = &dev->vb_queue_lock;
> ret = vb2_queue_init(&dev->vb_queue);
> if (ret) {
> dev_err(&pdev->dev, "Could not initialize vb2 queue\n");
> @@ -1421,7 +1422,6 @@ static int rtl2832_sdr_probe(struct platform_device *pdev)
> /* Init video_device structure */
> dev->vdev = rtl2832_sdr_template;
> dev->vdev.queue = &dev->vb_queue;
> - dev->vdev.queue->lock = &dev->vb_queue_lock;
> video_set_drvdata(&dev->vdev, dev);
>
> /* Register the v4l2_device structure */
>
prev parent reply other threads:[~2025-03-12 15:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 14:40 [PATCH for v6.14] media: rtl2832_sdr: assign vb2 lock before vb2_queue_init Hans Verkuil
2025-03-03 1:10 ` Arthur Marsh
2025-03-12 15:39 ` Mauro Carvalho Chehab [this message]
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=20250312163959.5c081bf8@sal.lan \
--to=mchehab+huawei@kernel.org \
--cc=arthur.marsh@internode.on.net \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.