hypervisor: 0.871 virtual: 0.779 debug: 0.733 x86: 0.693 user-level: 0.414 TCG: 0.398 peripherals: 0.296 register: 0.222 PID: 0.116 device: 0.104 operating system: 0.091 i386: 0.089 arm: 0.081 files: 0.067 socket: 0.062 ppc: 0.051 performance: 0.029 risc-v: 0.026 architecture: 0.023 semantic: 0.022 boot: 0.020 VMM: 0.018 kernel: 0.017 assembly: 0.017 alpha: 0.014 vnc: 0.013 network: 0.012 permissions: 0.005 KVM: 0.005 graphic: 0.005 mistranslation: 0.002 [Qemu-devel] [BUG] qemu stuck when detach host-usb device Description of problem: The guest has a host-usb device(Kingston Technology DataTraveler 100 G3/G4/SE9 G2), which is attached to xhci controller(on host). Qemu will stuck if I detach it from guest. How reproducible: 100% Steps to Reproduce: 1. Use usb stick to copy files in guest , make it busy working. 2. virsh detach-device vm_name usb.xml Then qemu will stuck for 20s, I found this is because libusb_release_interface block for 20s. Dmesg prints: [35442.034861] usb 4-2.1: Disable of device-initiated U1 failed. [35447.034993] usb 4-2.1: Disable of device-initiated U2 failed. [35452.035131] usb 4-2.1: Set SEL for device-initiated U1 failed. [35457.035259] usb 4-2.1: Set SEL for device-initiated U2 failed. Is this a hardware error or software's bug? On Tue, Nov 27, 2018 at 01:26:24AM +0000, linzhecheng wrote: > Description of problem: > The guest has a host-usb device(Kingston Technology DataTraveler 100 > G3/G4/SE9 G2), which is attached > to xhci controller(on host). Qemu will stuck if I detach it from guest. > > How reproducible: > 100% > > Steps to Reproduce: > 1. Use usb stick to copy files in guest , make it busy working. > 2. virsh detach-device vm_name usb.xml > > Then qemu will stuck for 20s, I found this is because > libusb_release_interface block for 20s. > Dmesg prints: > > [35442.034861] usb 4-2.1: Disable of device-initiated U1 failed. > [35447.034993] usb 4-2.1: Disable of device-initiated U2 failed. > [35452.035131] usb 4-2.1: Set SEL for device-initiated U1 failed. > [35457.035259] usb 4-2.1: Set SEL for device-initiated U2 failed. > > Is this a hardware error or software's bug? I'd guess software error, could be is libusb or (host) linux kernel. Cc'ing libusb-devel. cheers, Gerd > -----Original Message----- > From: Gerd Hoffmann [ mailto:address@hidden > Sent: Tuesday, November 27, 2018 2:09 PM > To: linzhecheng > Cc: address@hidden; wangxin (U) ; > Zhoujian (jay) ; address@hidden > Subject: Re: [Qemu-devel] [BUG] qemu stuck when detach host-usb device > > On Tue, Nov 27, 2018 at 01:26:24AM +0000, linzhecheng wrote: > > Description of problem: > > The guest has a host-usb device(Kingston Technology DataTraveler 100 > > G3/G4/SE9 G2), which is attached to xhci controller(on host). Qemu will > > stuck > if I detach it from guest. > > > > How reproducible: > > 100% > > > > Steps to Reproduce: > > 1. Use usb stick to copy files in guest , make it busy working. > > 2. virsh detach-device vm_name usb.xml > > > > Then qemu will stuck for 20s, I found this is because > > libusb_release_interface > block for 20s. > > Dmesg prints: > > > > [35442.034861] usb 4-2.1: Disable of device-initiated U1 failed. > > [35447.034993] usb 4-2.1: Disable of device-initiated U2 failed. > > [35452.035131] usb 4-2.1: Set SEL for device-initiated U1 failed. > > [35457.035259] usb 4-2.1: Set SEL for device-initiated U2 failed. > > > > Is this a hardware error or software's bug? > > I'd guess software error, could be is libusb or (host) linux kernel. > Cc'ing libusb-devel. Perhaps it's usb driver's bug. Could you also reproduce it? > > cheers, > Gerd