mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ricardo Ribalda <ribalda@chromium.org>
Subject: Re: [PATCH 1/1] media: uvcvideo: Increase UVC_CTRL_CONTROL_TIMEOUT to 5 seconds.
Date: Mon, 15 Nov 2021 11:30:20 +0200	[thread overview]
Message-ID: <YZIorH8D7NPB3w5B@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20211114085236.2345589-1-james.hilliard1@gmail.com>

Hi James,

Thank you for the patch.

On Sun, Nov 14, 2021 at 01:52:36AM -0700, James Hilliard wrote:
> Some uvc devices appear to require the maximum allowed USB timeout
> for GET_CUR/SET_CUR requests.

Could you list the devices that you know about which require this change
?

> So lets just bump the UVC control timeout to 5 seconds which is the
> same as the usb ctrl get/set defaults:
> USB_CTRL_GET_TIMEOUT 5000
> USB_CTRL_SET_TIMEOUT 5000

The USB specification (section 9.2.6.4) requires the device to send the
first data packet within 500ms of reception of the request. A 500ms
timeout may thus be a bit too short for compliant devices, but 5000ms
seems to be a very large margin. I'm wondering if it would make sense to
go for a lower value.

> Fixes:
> Failed to query (GET_CUR) UVC control 11 on unit 2: -110 (exp. 1).
> Failed to query (SET_CUR) UVC control 3 on unit 2: -110 (exp. 2).
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>  drivers/media/usb/uvc/uvcvideo.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
> index fd4f5ef47dfb..583c51ac3eec 100644
> --- a/drivers/media/usb/uvc/uvcvideo.h
> +++ b/drivers/media/usb/uvc/uvcvideo.h
> @@ -189,7 +189,7 @@
>  /* Maximum status buffer size in bytes of interrupt URB. */
>  #define UVC_MAX_STATUS_SIZE	16
>  
> -#define UVC_CTRL_CONTROL_TIMEOUT	500
> +#define UVC_CTRL_CONTROL_TIMEOUT	5000
>  #define UVC_CTRL_STREAMING_TIMEOUT	5000
>  
>  /* Maximum allowed number of control mappings per device */

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2021-11-15  9:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-14  8:52 James Hilliard
2021-11-15  9:30 ` Laurent Pinchart [this message]
2021-11-15 13:16   ` James Hilliard
2021-11-15 13:31     ` Laurent Pinchart
2021-11-15 17:34       ` James Hilliard

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=YZIorH8D7NPB3w5B@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=james.hilliard1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.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®