From: "Michał Pecio" <michal.pecio@gmail.com>
To: laycookie <laycookie@proton.me>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: USB device enumeration failure after a certain amount of uptime
Date: Tue, 25 Mar 2025 23:36:11 +0100 [thread overview]
Message-ID: <20250325233611.118e3a33@foxbook> (raw)
In-Reply-To: <MNPMsZnv8AXRyS4mqWaolXZkblyzndGqRmVitU7e5Z4HakEyOse4qfahFpSuU0ApYetf8S34NF26rGgBbwKb-39FBI3Z8o6ElQnzozl_Fkk=@proton.me>
> > Is this a complete log? And the device was really working during
> > those six minutes before "setup address" failure? Usually, address
> > setup happens once immediately after device connection, not sure
> > what would lead to it being repeated later.
Nevermind, it looks like address setup is also done on device reset,
so that's what may be happening here.
Although now I'm not sure what would request a reset of an idle device
and why. Apparently not uvcvideo/snd-usb-audio drivers because they
only ever seem to reset a few specific USB IDs. Maybe USB core did it
for some reason.
You could try enabling usbcore dynamic debug:
echo 'module usbcore +p' >/proc/dynamic_debug/control
and see if there is some noise in dmesg when the device is idle or
shortly before it fails. Note that this enables debug logging on all
USB buses in the system. Change +p to -p to turn it off.
> I also discovered that apparently if I stream from the capture card
> to some application it never disconnects, or at least I have never
> encountered it disconnecting.
I guess a simple test is to leave it running overnight with some webcam
viewer software or similar. If it survives, and then fails shortly
after turning off the software, that looks like an idle state problem.
Maybe autosuspend is involved? Totally guessing. It can be disabled:
echo -1 >/sys/bus/usb/devices/4-1/power/autosuspend_delay_ms
This is quite unlikely, I think, but sometimes those USB controllers
can break and stop performing transfers correctly. You could see if
things return to normal after re-initializing the controller:
echo 0000:08:00.0 >/sys/bus/pci/drivers/xhci_hcd/unbind
echo 0000:08:00.0 >/sys/bus/pci/drivers/xhci_hcd/bind
assuming that this card is 08:00.0 and not 09:00.0 (or something else).
Michal
prev parent reply other threads:[~2025-03-25 22:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-22 13:19 USB device enumeration failure after a certain amount of uptime laycookie
2025-03-25 8:32 ` Michał Pecio
2025-03-25 9:46 ` laycookie
2025-03-25 22:36 ` Michał 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=20250325233611.118e3a33@foxbook \
--to=michal.pecio@gmail.com \
--cc=laycookie@proton.me \
--cc=linux-usb@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