Skip to contentSkip to conversation

About usb passthru and speed mismatch

Qemu-devel Lin Ma 2 participants 2 messages Jun 11, 2015 – Jun 16, 2015

lore
Share & tools
lore

Lin Ma

author
#0 lore raw

Hi Gerd,

Based on the current implementation of 'usb_host_open' in hw/usb/host-libusb.c,

When user performs usb_add, The usb device will be detached from kernel first, Then be checked for speed mismatch second. If it found speed mismatch, The usb device isn't attached to guest, But the usb device can't be reattached to kernel either.

I'd like to write patch to add 'usb_check_attach' before detaching the device from kernel _or_ add 'usb_host_attach_kernel' under 'fail:' of usb_host_open, (the latter doesn't make sense I think). May I have your thoughts?

BTW, Have you missed a patch: "usb: Use usb_bus_find(-1) instead of usb_enabled() in usb_device_add/usb_device_del" which sending on June 4th ? May I have your thoughts about that patch as well?

Thanks,
Lin

#1 lore raw
Quoted 5 lines · Lin Ma

Hi Gerd,

Based on the current implementation of 'usb_host_open' in hw/usb/host-libusb.c,

Quoted 8 lines

When user performs usb_add, The usb device will be detached from kernel first, Then be checked for speed mismatch second.
If it found speed mismatch, The usb device isn't attached to guest, But the usb device can't be reattached to kernel either.

I'd like to write patch to add 'usb_check_attach' before detaching the device from kernel _or_ add 'usb_host_attach_kernel' under 'fail:' of usb_host_open, (the latter doesn't make sense I think).

Re-attach to the kernel when open fails (for whatever reasons) makes perfect sense to me.

cheers,
Gerd