Linux USB
 help / color / mirror / Atom feed
From: Michal Pecio <michal.pecio@gmail.com>
To: Kuangyi Chiang <ki.chiang65@gmail.com>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>,
	mathias.nyman@intel.com, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] xhci: Fix HIK camera control timeout on Etron hosts
Date: Tue, 3 Nov 2026 07:28:49 +0100	[thread overview]
Message-ID: <20261103072849.623325cd.michal.pecio@gmail.com> (raw)
In-Reply-To: <CAHN5xi3NY2AUQK2=M80RYkx1N-bA8=zPEE6Y5400EYyMv1=aCg@mail.gmail.com>

On Tue, 3 Nov 2026 09:01:50 +0800, Kuangyi Chiang wrote:
> However, we captured USB traces using a protocol analyzer and
> observed different behavior between the failing and successful
> cases.
> 
> In the failing case, the device ACKed the DATA stage but kept
> NAKing the STATUS stage until the transfer timed out.
> 
> In the successful case, the device initially NAKed the DATA stage,
> then ACKed it, and the STATUS stage completed successfully.
> 
> We haven't determined the root cause yet.
> 
> In our tests, adding a 1 ms delay to both the UAC and UVC
> control request paths prevented the timeouts.

Could it be a device bug triggered by timing? Some xHCI controllers
perform control transfers faster than others - we have seen anything
(IIRC) from complete transfer in a microframe, through one stage per
microframe, up to one stage per frame even for high-speed devices.
We are not aware of any way to influence this, besides delaying URB
submissions. I don't know how fast EHCI controllers are.

> > > So far, we have reproduced the issue with these xHCI hosts:
> > >
> > > ASMedia ASM1142 (1b21:1242)
> > > Etron EJ168 (1b6f:7023)
> > > Etron EJ188 (1b6f:7052)
> > > Intel xHCI (8086:8d31)  
> >
> > I don't know that Intel chip, but the others are quite buggy.
> >
> > Have you tried other HCs? Any successes?
> > IME, chips from NEC, Fresco, Renesas are more reliable.  
> 
> In our recent tests without the delay patches, we did not
> observe any timeouts on the following HCs:
> 
> AMD EHCI (1002:4396)
> AMD xHCI (1022:149c)
> ASMedia ASM1042A (1b21:1142)
> NEC xHCI (1033:0194)

ASM1042A surprises me, because ASMedia in general are among the fastest
ones, except AMD Promontory chipsets which are extremely slow. NEC was
slightly slower than the fastest chips IIRC. I'm not familiar with AMD
Matisse and have no idea what xHCI IP they put inside.

Purely out of curiosity, could you connect a USB 3.0 NIC like RTL8153
or AX88197 to Matisse and see if it breaks after a minute of:

  while :; do ifconfig <xxx> up ; ifconfig <xxx> down ; echo -n . ; done

I found this to be a 100% reliable way to detect ASMedia controllers,
including those in AMD Promontory chipsets. This is the periodic unlink
bug I mentioned, which is mostly mitigated by 7c0c31c66a7f9 in 7.3,
so the test is more effective on 7.2.

Regards,
Michal

      reply	other threads:[~2026-11-03  6:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14  1:30 [PATCH] xhci: Fix HIK camera control timeout on Etron hosts Kuangyi Chiang
2026-09-14 11:09 ` Michal Pecio
2026-09-16  1:33   ` Kuangyi Chiang
2026-09-16 12:18     ` Mathias Nyman
2026-09-18  1:58       ` Kuangyi Chiang
2026-10-29  2:25         ` Kuangyi Chiang
2026-10-29  5:03           ` Michal Pecio
2026-11-03  1:01             ` Kuangyi Chiang
2026-11-03  6:28               ` Michal Pecio [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=20261103072849.623325cd.michal.pecio@gmail.com \
    --to=michal.pecio@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ki.chiang65@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=mathias.nyman@linux.intel.com \
    /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