Linux USB
 help / color / mirror / Atom feed
From: "Michał Pecio" <michal.pecio@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org
Subject: Re: Forcing re-enumeration of a chosen USB device from userspace?
Date: Fri, 9 Aug 2024 11:02:06 +0200	[thread overview]
Message-ID: <20240809110206.4b43c1f2@foxbook> (raw)
In-Reply-To: <f46dc174-2f23-4a19-a9f6-5ae6e4e2d304@rowland.harvard.edu>

> You can reset the device by using the usbreset program, which is part
> of the usbutils package.  Some distributions (such as Ubuntu) include
> it whereas others (such as Fedora) don't.  But if you don't have it,
> you can get the source code from https://github.com/gregkh/usbutils/
> and build it yourself.
> 
> If the reset causes some descriptors to change, the kernel will 
> re-enumerate the device.

Thanks for the suggestion. I compiled the tool fom Greg's repository
and ran it 100 times in a loop, but the descriptors remained unchanged.

I only got "reset USB device" messages in dmesg and class driver noise.


I had no luck playing with sysfs entries of the device, but I found
that the parent hub allows me to disable/enable individual ports. There
is some subtlely in USB 3.0 as the associated 2.0 port must be disabled
first to prevent downgrading to high speed, but it works.

Curiously though, it doesn't have the same effect as reloading the host
driver. My buggy device randomly comes back with good descriptors, with
the same bad descriptors, or most often it doesn't come back at all.

Regards,
Michal

  reply	other threads:[~2024-08-09  9:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08  6:39 Forcing re-enumeration of a chosen USB device from userspace? Michał Pecio
2024-08-08 19:54 ` Alan Stern
2024-08-09  9:02   ` Michał Pecio [this message]
2024-08-09 13:53     ` Alan Stern

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=20240809110206.4b43c1f2@foxbook \
    --to=michal.pecio@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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