mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 01:54:44 +00:00
DM USB: modify disconnecting logic to support Windows 10
The Windows 10 feeds back quicker than Linux OS when error occured due to device disconnecting, it will quickly reset the xHCI controller before the DM starts to emulate disconnect event and it may cause some unexpected errors such as crash. This patch will do one more check when error happens, if the error is induced by device disconnecting, the DM will not report error and just wait until the disconnect event is reported to the guest. This change could produce the correct hehavior as we expected. Tracked-On: #3628 Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
@@ -214,6 +214,14 @@ usb_dev_comp_cb(struct libusb_transfer *trn)
|
||||
xfer->status = USB_ERR_SHORT_XFER;
|
||||
goto out;
|
||||
case LIBUSB_TRANSFER_ERROR:
|
||||
/*
|
||||
* If this error happened due to device disconnecting, there is
|
||||
* nothing should do and just wait usb_dev_native_sys_disconn_cb
|
||||
* to do the 'unplugging process'.
|
||||
*/
|
||||
if (usb_native_is_device_existed(&info->path) == 0)
|
||||
goto cancel_out;
|
||||
|
||||
is_stalled = 1;
|
||||
xfer->status = USB_ERR_STALLED;
|
||||
goto stall_out;
|
||||
|
||||
Reference in New Issue
Block a user