Re: [RFC PATCH 2/4] rust: usb: add usb host interface and endpoint abstractions
From: Alan Stern
Date: Tue Jul 14 2026 - 15:03:30 EST
On Tue, Jul 14, 2026 at 07:57:21PM +0200, Oliver Neukum wrote:
> On 14.07.26 18:26, Alan Stern wrote:
> > At first I thought that we ought to have such a guarantee. But in fact
> > we don't, because the user can at any time write to a USB device's
> > bConfigurationValue sysfs attribute even if the device isn't bound to a
> > driver. This can create interfaces which may then be bound to drivers.
> > I just tried it and it worked.
> >
> > This wasn't the original intent, but I don't see any good reason to
> > prevent people from doing it.
>
> I hardly dare ask, but what happens if you unplug the device?
Exactly what you would expect: The interface driver is unbound and the
device and interface disappear. This line shows up in the dmesg log (I
didn't have dynamic debugging turned on):
[406254.947595] usb 3-1: USB disconnect, device number 15
You can try it for yourself; it's an easy experiment to do. I used a
USB mouse for the test.
Alan Stern