mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Ricardo Ribalda <ribalda@chromium.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 5/5] media: uvcvideo: Flush the control cache when we get an event
Date: Mon, 2 Dec 2024 15:45:57 +0100	[thread overview]
Message-ID: <67f78128-dcc0-4253-a6f7-5905ca375b06@redhat.com> (raw)
In-Reply-To: <20241202-uvc-fix-async-v5-5-6658c1fe312b@chromium.org>

Hi,

On 2-Dec-24 3:24 PM, Ricardo Ribalda wrote:
> Asynchronous controls trigger an event when they have completed their
> operation.
> 
> This can make that the control cached value does not match the value in
> the device.
> 
> Let's flush the cache to be on the safe side.
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
>  drivers/media/usb/uvc/uvc_ctrl.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
> index e90bf2aeb5e4..75d534072f50 100644
> --- a/drivers/media/usb/uvc/uvc_ctrl.c
> +++ b/drivers/media/usb/uvc/uvc_ctrl.c
> @@ -1672,6 +1672,9 @@ bool uvc_ctrl_status_event_async(struct urb *urb, struct uvc_video_chain *chain,
>  	struct uvc_device *dev = chain->dev;
>  	struct uvc_ctrl_work *w = &dev->async_ctrl;
>  
> +	/* Flush the control cache, the data might have changed. */
> +	ctrl->loaded = 0;
> +
>  	if (list_empty(&ctrl->info.mappings))
>  		return false;
>  
>


Thank you for the patch.

I'm not familiar enough with UVC yet to really have an opinion on this one,
so I'll defer reviewing this one to Laurent.

Regards,

Hans




  reply	other threads:[~2024-12-02 14:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-02 14:24 [PATCH v5 0/5] media: uvcvideo: Two +1 fixes for async controls Ricardo Ribalda
2024-12-02 14:24 ` [PATCH v5 1/5] media: uvcvideo: Only save async fh if success Ricardo Ribalda
2024-12-02 14:33   ` Hans de Goede
2024-12-03 20:21   ` Laurent Pinchart
2024-12-02 14:24 ` [PATCH v5 2/5] media: uvcvideo: Remove dangling pointers Ricardo Ribalda
2024-12-02 14:44   ` Hans de Goede
2024-12-02 14:49     ` Ricardo Ribalda
2024-12-02 14:56       ` Hans de Goede
2024-12-03 20:35   ` Laurent Pinchart
2024-12-03 21:21     ` Ricardo Ribalda
2024-12-02 14:24 ` [PATCH v5 3/5] media: uvcvideo: Annotate lock requirements for uvc_ctrl_set Ricardo Ribalda
2024-12-02 14:44   ` Hans de Goede
2024-12-02 14:24 ` [PATCH v5 4/5] media: uvcvideo: Remove redundant NULL assignment Ricardo Ribalda
2024-12-02 14:44   ` Hans de Goede
2024-12-03 20:27     ` Laurent Pinchart
2024-12-02 14:24 ` [PATCH v5 5/5] media: uvcvideo: Flush the control cache when we get an event Ricardo Ribalda
2024-12-02 14:45   ` Hans de Goede [this message]
2024-12-03 20:37     ` Laurent Pinchart
2024-12-03 21:10       ` Ricardo Ribalda

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=67f78128-dcc0-4253-a6f7-5905ca375b06@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=guennadi.liakhovetski@intel.com \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ribalda@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®