On Tue, Aug 09, 2022 at 07:27:11PM +0200, Bastien Nocera wrote: > On Tue, 2022-08-09 at 18:33 +0200, Greg Kroah-Hartman wrote: > > On Tue, Aug 09, 2022 at 04:31:04PM +0200, Bastien Nocera wrote: > > > On Tue, 2022-08-09 at 12:38 +0200, Greg Kroah-Hartman wrote: > > > > Now if you really really want to disable a device from under a > > > > user, > > > > without the file handle present, you can do that today, as root, > > > > by > > > > doing the 'unbind' hack through userspace and sysfs. It's so > > > > common > > > > that this seems to be how virtual device managers handle virtual > > > > machines, so it should be well tested by now. > > > > > > The only thing I know that works that way is usbip, and it requires > > > unbinding each of the interfaces: > > > > > > https://sourceforge.net/p/usbip/git-windows/ci/master/tree/trunk/userspace/src/bind-driver.c#l157 > > > > virtio devices also use the api from what I recall. > > I can't find any code that would reference > /sys/bus/usb/drivers/usbfs/unbind or /sys/bus/usb/drivers/usbfs wrt > virtio. Where's the host side code for that? I mean the virtio code uses bind/unbind for it's devices, nothing to do with USB other than the userspace interface involved. thanks, greg k-h