From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Hans de Goede <hansg@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Edwin Gatier <edwin.gatier@protonmail.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Subject: Re: [PATCH v3 2/5] media: uvcvideo: Use uvc_warn_once when it make sense
Date: Mon, 28 Sep 2026 15:10:13 +0300 [thread overview]
Message-ID: <20260928121013.GD4406@killaraus.ideasonboard.com> (raw)
In-Reply-To: <20260911-uvc-version-v3-2-604328d8a0dd@chromium.org>
On Fri, Sep 11, 2026 at 01:22:26PM +0000, Ricardo Ribalda wrote:
> If there are multiple cameras in the system affected by a compliance
> error now we only show an error message for one of them.
>
> Use uvc_warn_once() to print an error message per device.
>
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
> drivers/media/usb/uvc/uvc_video.c | 2 +-
> drivers/media/usb/uvc/uvcvideo.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
> index fc3536a4399f..2a3b7431cc68 100644
> --- a/drivers/media/usb/uvc/uvc_video.c
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -95,7 +95,7 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
> */
> if (ret > 0 && query != UVC_GET_INFO) {
> memset(data + ret, 0, size - ret);
> - dev_warn_once(&dev->intf->dev,
> + uvc_warn_once(dev, UVC_WARN_QUERY_CTRL,
I thought about submitting a patch for this when I read 1/5 :-)
The only other usage of dev_warn_once() in the driver logs bad access to
the privacy control from userspace, which doesn't need to be logged per
device.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> "UVC non compliance: %s control %u on unit %u returned %d bytes when we expected %u.\n",
> uvc_query_name(query), cs, unit, ret, size);
> return 0;
> diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
> index a80406f20beb..abcafd929c9e 100644
> --- a/drivers/media/usb/uvc/uvcvideo.h
> +++ b/drivers/media/usb/uvc/uvcvideo.h
> @@ -661,6 +661,7 @@ static inline struct uvc_fh *to_uvc_fh(struct file *filp)
> #define UVC_WARN_MINMAX 0
> #define UVC_WARN_PROBE_DEF 1
> #define UVC_WARN_XU_GET_RES 2
> +#define UVC_WARN_QUERY_CTRL 3
>
> extern unsigned int uvc_clock_param;
> extern unsigned int uvc_no_drop_param;
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2026-09-28 12:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 13:22 [PATCH v3 0/5] media: uvcvideo: Automatically handle invalid uvc_versions Ricardo Ribalda
2026-09-11 13:22 ` [PATCH v3 1/5] media: uvcvideo: uvc_warn should warn not info Ricardo Ribalda
2026-09-28 11:07 ` Hans de Goede
2026-09-28 12:08 ` Laurent Pinchart
2026-09-11 13:22 ` [PATCH v3 2/5] media: uvcvideo: Use uvc_warn_once when it make sense Ricardo Ribalda
2026-09-28 11:07 ` Hans de Goede
2026-09-28 12:10 ` Laurent Pinchart [this message]
2026-09-11 13:22 ` [PATCH v3 3/5] media: uvcvideo: Automatically handle cameras with invalid uvc_version Ricardo Ribalda
2026-09-28 11:13 ` Hans de Goede
2026-09-28 12:52 ` Laurent Pinchart
2026-09-28 13:22 ` Ricardo Ribalda
2026-09-28 13:35 ` Laurent Pinchart
2026-09-28 13:56 ` Ricardo Ribalda
2026-09-28 13:44 ` Ricardo Ribalda
2026-09-11 13:22 ` [PATCH v3 4/5] media: uvcvideo: Do not parse bmVideoStandards Ricardo Ribalda
2026-09-28 11:33 ` Hans de Goede
2026-09-11 13:22 ` [PATCH v3 5/5] media: uvcvideo: Force UVC version for Avermedia GC515 Ricardo Ribalda
2026-09-28 12:37 ` Hans de Goede
2026-09-28 12:38 ` Laurent Pinchart
2026-09-28 12:40 ` Ricardo Ribalda
2026-09-28 12:56 ` Laurent Pinchart
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=20260928121013.GD4406@killaraus.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=edwin.gatier@protonmail.com \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab+huawei@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 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.