On 10/7/22 23:33, David Tomaschik wrote:
Hi all,
It seems that any time the rtl8187 driver is detached from an rtl8187
interface, a USB device reset is triggered. This is not a problem in
the general case, but when working with libusb, calling
libusb_detach_kernel_driver
(https://libusb.sourceforge.io/api-1.0/group__libusb__dev.html#ga5e0cc1d666097e915748593effdc634a)
results in the device reset, which then causes the kernel driver to
re-attach to the device. This prevents, for example, forwarding the
device into a VM using QEMU/KVM. This seems to be due to
rtl8187_disconnect calling usb_reset_device.
The 8187 driver seems to be the only realtek driver unconditionally
resetting on disconnect -- is this technically necessary? I'm not
sure I would call this a bug, but it's definitely behavior that was
very puzzling to me and I only understood after enough debugging to
start reading kernel source.
David,
This behavior certainly is a bug. If one tries to attach the RTL8187 to a VM, it
crashes. I will be looking into this issue.
Larry