mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hansg@kernel.org>
To: Ostashow Constantine <ostashow@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] media: uvcvideo: Add quirk to retry SET_INTERFACE for SVBONY SV105C
Date: Wed, 21 Oct 2026 12:26:13 +0200	[thread overview]
Message-ID: <f4c591d0-304a-49d6-8892-d28124767a55@kernel.org> (raw)
In-Reply-To: <CAAquLuBW3MaBZgxQt_Kr7L2jGQf6mXarRtKi729-44DqwC=CnA@mail.gmail.com>

Hi,

On 19-Oct-26 14:20, Ostashow Constantine wrote:
> To: Hans de Goede <hansg@kernel.org>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Mauro
> Carvalho Chehab <mchehab@kernel.org>, linux-media@vger.kernel.org,
> linux-kernel@vger.kernel.org, stable@vger.kernel.org
> Subject: Re: [PATCH] media: uvcvideo: Add quirk to retry SET_INTERFACE
> for SVBONY SV105C
> In-Reply-To: <20261019123803.GA855235@killaraus.ideasonboard.com>
> 
> Hi Hans, Laurent,
> 
> On Mon, Oct 19, 2026 at 02:33:11PM +0200, Hans de Goede wrote:
>> When you say "then queurs the control transfer", you mean the control
>> transfer for the SET_INTERFACE, right ?
> 
> Yes. On Windows the order is: COMMIT completes, Configure Endpoint
> command (about 3 ms), then the SET_INTERFACE control transfer.
> 
>> I wonder if the problem is that Linux is missing this Configure Endpoint
>> command ?
> 
> It isn't. I traced the xhci-hcd events on the Pi for 20 stream starts
> (MJPEG 1920x1080, auto exposure). Linux does the same thing in the same
> order, because usb_set_interface() calls usb_hcd_alloc_bandwidth()
> before it sends the request:
> 
>   COMMIT status stage           Success
>   +0.07-0.46 ms  Configure Endpoint (Add: slot 1in, Isoc IN, maxp 1024,
>                  burst 2, ESIT 3072)   0.23-0.26 ms, Success

I wonder if it helps if you insert a fsleep(3000) here on the RPi case?

So that is sleep between the Configure Endpoint and the actual SET_INTERFACE
ctrl urb being send out.

Maybe for some reason the RPi XHCI controller reports ready here too
soon (or Linux XHCI code is missing some check to wait for something) ?

The reason I'm looking at this is because you say that on Windows
this takes 3 ms, so it feels suspiciously quick here.


>   +0.06-0.11 ms  SET_INTERFACE alt 6 queued, doorbell
>   +0.9 ms        Transfer Event 'USB Transaction Error' on the Status
>                  Stage TRB
>                  Reset Endpoint, Set TR Dequeue, Configure Endpoint
>                  (Drop 1in), Configure Endpoint (Add 1in)
>   retry          SET_INTERFACE alt 6, Success after 259-295 ms
> 
> The first SET_INTERFACE failed in 17 of the 20 starts, more often than
> the roughly 15% I see without tracing, and the retry succeeded every
> time. When the first attempt succeeds, it takes
> 260-262 ms. The error event always points at the Status Stage TRB, so
> the Setup stage was accepted and the transaction error happens in the
> status stage. That fits the guess in my previous mail.
> 
> Configure Endpoint itself is faster on the VL805: about 0.25 ms, against
> 2.7-3 ms on the AMD controller (see below, the same under Linux and
> Windows). I don't think the timing explains the failure, though. The
> fsleep() test in my previous mail put 1 to 300 ms between COMMIT and
> SET_INTERFACE and did not help. On the AMD controller under Linux, the
> gap between Configure Endpoint completion and the SETUP is even
> shorter than on the Pi (0.02 ms), and nothing fails there.
> 
> On Mon, Oct 19, 2026 at 03:38:03PM +0300, Laurent Pinchart wrote:
>>> Have you tried reproducing this on a different XHCI controller then
>>> the one found in the Raspberry Pi 4 ?
>>
>> In particular the same one as the system running windows.
> 
> Yes, now. I booted Ubuntu 26.04 (kernel 7.0.0-30-generic, stock
> uvcvideo, no patch) from a live USB stick on the Windows PC. The camera
> was on the same AMD chipset xHCI (1022:43ee), behind the onboard GL850G
> USB 2.0 hub (see below). The test was MJPEG 1920x1080 with auto exposure
> and v4l2-ctl --stream-mmap:

Ok thank you for trying this. It is good to know this is a problem
specific to the RPi XHCI controller or USB2 hub.

Can you try the camera on the RPi without involving the USB2 hub, or
are all ports routed through the hub ?

Regards,

Hans




      reply	other threads:[~2026-10-21 10:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 11:07 Ostashow Constantine via B4 Relay
2026-10-19 11:17 ` Laurent Pinchart
2026-10-19 11:21   ` Hans de Goede
2026-10-19 11:27     ` Laurent Pinchart
2026-10-19 11:58       ` Константин Осташов
2026-10-19 12:33         ` Hans de Goede
2026-10-19 12:38           ` Laurent Pinchart
2026-10-19 12:20             ` Ostashow Constantine
2026-10-21 10:26               ` Hans de Goede [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=f4c591d0-304a-49d6-8892-d28124767a55@kernel.org \
    --to=hansg@kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ostashow@gmail.com \
    --cc=stable@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 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®