qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] USB continuous reset / unplug cleanup not done properly


From: erik . rull
Subject: [Qemu-devel] USB continuous reset / unplug cleanup not done properly
Date: Wed, 14 Dec 2011 15:29:54 +0100

Hi all,

I experience several problems using the usb-host USB routing feature to the
guest.

1) Devices get resetted again and again on the host side and do not work
properly on the guest side - they work fine on the host side outside qemu.
2) Unplugged devices remain in the "info usb" list

I start up qemu-kvm-1.0

(qemu) info usb
  Device 0.1, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet
(qemu) info usbhost
husb: using sys file-system with /dev/bus/usb
  Bus 1, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0020
  Bus 2, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0020

plug in a usb key

[ 3681.562935] usb 2-1.4: new high speed USB device using ehci_hcd and
address 16
[ 3681.651168] usb 2-1.4: configuration #1 chosen from 1 choice
[ 3681.651485] scsi37 : SCSI emulation for USB Mass Storage devices
[ 3681.651645] usb-storage: device found at 16
[ 3681.651758] usb-storage: waiting for device to settle before scanning
[ 3687.579074] scsi 37:0:0:0: Direct-Access     USB      DISK 2.0        
0604 PQ: 0 ANSI: 0 CCS
[ 3687.579371] sd 37:0:0:0: Attached scsi generic sg1 type 0
[ 3687.580601] usb-storage: device scan complete
[ 3687.581516] sd 37:0:0:0: [sdb] 3981312 512-byte logical blocks: (2.03
GB/1.89 GiB)
[ 3687.582688] sd 37:0:0:0: [sdb] Write Protect is off
[ 3687.582806] sd 37:0:0:0: [sdb] Mode Sense: 43 00 00 00
[ 3687.582886] sd 37:0:0:0: [sdb] Assuming drive cache: write through
[ 3687.585932] sd 37:0:0:0: [sdb] Assuming drive cache: write through
[ 3687.586019]  sdb: sdb1
[ 3687.588551] sd 37:0:0:0: [sdb] Assuming drive cache: write through
[ 3687.588643] sd 37:0:0:0: [sdb] Attached SCSI removable disk
[ 3749.074062] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 16
[ 3749.384065] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 16
[ 3749.666806] usb 2-1.4: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1

(qemu) info usb
  Device 0.1, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet
(qemu) info usbhost
  Bus 1, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0020
  Bus 2, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0020
  Bus 2, Addr 16, Port 1.4, Speed 480 Mb/s
    Class 00: USB device 090c:1000, DISK 2.0
(qemu)

add it to qemu

(qemu) device_add usb-host,hostbus=2,hostport=1.4

(qemu) info usb
  Device 0.1, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet
  Device 1.1, Port 1, Speed 480 Mb/s, Product DISK 2.0
(qemu) info usbhost
  Bus 1, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0020
  Bus 2, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0020
  Bus 2, Addr 16, Port 1.4, Speed 480 Mb/s
    Class 00: USB device 090c:1000, DISK 2.0
  Auto filters:
    Bus 2, Addr *, Port 1.4, ID *:*
(qemu)
up to here is everything fine
now unplugging the usb device

[ 3812.970174] usb 2-1.4: USB disconnect, address 16

plugging in another USB key

[ 3893.786934] usb 2-1.4: new high speed USB device using ehci_hcd and
address 17
[ 3893.880414] usb 2-1.4: configuration #1 chosen from 1 choice
[ 3893.880776] scsi38 : SCSI emulation for USB Mass Storage devices
[ 3893.880941] usb-storage: device found at 17
[ 3893.881019] usb-storage: waiting for device to settle before scanning
[ 3894.588808] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 17
[ 3908.951434] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 17
[ 3909.117433] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 17
[ 3909.277436] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 17
[ 3909.366994] usb-storage: device scan complete
[ 3909.539434] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 17
[ 3915.918311] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 17

doesn't work properly with qemu, removing it

[ 4009.066172] usb 2-1.4: USB disconnect, address 17

(qemu) info usb
  Device 0.1, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet
  Device 1.1, Port 1, Speed 480 Mb/s, Product DISK 2.0
(qemu) info usbhost
  Bus 1, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0020
  Bus 2, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0020
  Auto filters:
    Bus 2, Addr *, Port 1.4, ID *:*
(qemu) 

why is the usb key still present?
in the guest it is no longer visible

plugging in another usb device

(qemu) info usb
  Device 0.1, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet
  Device 1.0, Port 1, Speed 480 Mb/s, Product Imation
(qemu) info usbhost
  Bus 1, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0020
  Bus 2, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0020
  Bus 2, Addr 17, Port 1.4, Speed 480 Mb/s
    Class 00: USB device 0718:0064, Imation
  Auto filters:
    Bus 2, Addr *, Port 1.4, ID *:*
(qemu)
device get reset from time to time, runs perfect in plain linux host
environment, not usable on guest side, gets only detected but the file
access is impossible

[ 4018.203063] usb 2-1.4: new high speed USB device using ehci_hcd and
address 18
[ 4038.291913] usb 2-1.4: configuration #1 chosen from 1 choice
[ 4038.292171] scsi39 : SCSI emulation for USB Mass Storage devices
[ 4038.292251] usb-storage: device found at 18
[ 4038.292252] usb-storage: waiting for device to settle before scanning
[ 4039.422559] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4039.732558] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4040.012456] usb 2-1.4: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1
[ 4074.701937] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4074.787803] scsi40 : SCSI emulation for USB Mass Storage devices
[ 4074.788436] usb-storage: device found at 18
[ 4074.788437] usb-storage: waiting for device to settle before scanning
[ 4075.012936] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4075.223815] usb 2-1.4: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1
[ 4094.730811] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4094.816665] scsi41 : SCSI emulation for USB Mass Storage devices
[ 4094.817316] usb-storage: device found at 18
[ 4094.817318] usb-storage: waiting for device to settle before scanning
[ 4095.040685] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4095.252501] usb 2-1.4: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1
[ 4114.758561] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4114.844418] scsi42 : SCSI emulation for USB Mass Storage devices
[ 4114.845067] usb-storage: device found at 18
[ 4114.845069] usb-storage: waiting for device to settle before scanning
[ 4115.069555] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4115.281310] usb 2-1.4: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1
[ 4134.786310] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4134.872208] scsi43 : SCSI emulation for USB Mass Storage devices
[ 4134.876182] usb-storage: device found at 18
[ 4134.876185] usb-storage: waiting for device to settle before scanning
[ 4135.097313] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4135.318192] usb 2-1.4: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1
[ 4148.806062] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4148.891676] scsi44 : SCSI emulation for USB Mass Storage devices
[ 4148.892341] usb-storage: device found at 18
[ 4148.892343] usb-storage: waiting for device to settle before scanning
[ 4149.117056] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4149.327979] usb 2-1.4: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1
[ 4162.825814] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4162.911422] scsi45 : SCSI emulation for USB Mass Storage devices
[ 4162.912124] usb-storage: device found at 18
[ 4162.912126] usb-storage: waiting for device to settle before scanning
[ 4163.136811] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4163.347622] usb 2-1.4: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1
[ 4173.842060] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4173.927664] scsi46 : SCSI emulation for USB Mass Storage devices
[ 4173.928301] usb-storage: device found at 18
[ 4173.928302] usb-storage: waiting for device to settle before scanning
[ 4174.152060] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4174.364862] usb 2-1.4: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1
[ 4184.857310] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4184.942917] scsi47 : SCSI emulation for USB Mass Storage devices
[ 4184.943573] usb-storage: device found at 18
[ 4184.943575] usb-storage: waiting for device to settle before scanning
[ 4185.167308] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4185.379196] usb 2-1.4: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1
[ 4195.872561] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4195.958042] scsi48 : SCSI emulation for USB Mass Storage devices
[ 4195.958653] usb-storage: device found at 18
[ 4195.958654] usb-storage: waiting for device to settle before scanning
[ 4196.183560] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4196.395198] usb 2-1.4: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1
[ 4206.888811] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4206.974290] scsi49 : SCSI emulation for USB Mass Storage devices
[ 4206.974933] usb-storage: device found at 18
[ 4206.974935] usb-storage: waiting for device to settle before scanning
[ 4207.198810] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4207.409684] usb 2-1.4: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1
[ 4545.364689] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4545.450172] scsi50 : SCSI emulation for USB Mass Storage devices
[ 4545.450917] usb-storage: device found at 18
[ 4545.450996] usb-storage: waiting for device to settle before scanning
[ 4545.675561] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4545.886437] usb 2-1.4: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1
[ 4556.379937] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4556.465422] scsi51 : SCSI emulation for USB Mass Storage devices
[ 4556.466178] usb-storage: device found at 18
[ 4556.466256] usb-storage: waiting for device to settle before scanning
[ 4556.690808] usb 2-1.4: reset high speed USB device using ehci_hcd and
address 18
[ 4556.902625] usb 2-1.4: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1
[ 4563.305886] usb 2-1.4: USB disconnect, address 18

finally, removed from the PC
device gets reset again and again, this piece of hardware was working on
qemu 0.14!

next thing is the DVD drive (via USB)
plugging it in (on another port):
(qemu) device_add usb-host,hostbus=2,hostport=1.2

[ 4601.626686] usb 2-1.2: new high speed USB device using ehci_hcd and
address 19
[ 4601.734419] usb 2-1.2: configuration #1 chosen from 1 choice
[ 4601.734863] scsi52 : SCSI emulation for USB Mass Storage devices
[ 4601.735022] usb-storage: device found at 19
[ 4601.735100] usb-storage: waiting for device to settle before scanning
[ 4606.769533] scsi 52:0:0:0: CD-ROM            HL-DT-ST DVDRRW GSA-2166D
1.01 PQ: 0 ANSI: 0
[ 4607.016936] sr0: scsi3-mmc drive: 48x/48x writer dvd-ram cd/rw xa/form2
cdda tray
[ 4607.017134] sr 52:0:0:0: Attached scsi CD-ROM sr0
[ 4607.017285] sr 52:0:0:0: Attached scsi generic sg1 type 5
[ 4607.017464] usb-storage: device scan complete
[ 4672.223312] usb 2-1.2: reset high speed USB device using ehci_hcd and
address 19
[ 4672.544308] usb 2-1.2: reset high speed USB device using ehci_hcd and
address 19
[ 4672.837083] usb 2-1.2: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1
[ 4676.549689] usb 2-1.2: reset high speed USB device using ehci_hcd and
address 19
[ 4676.644718] scsi53 : SCSI emulation for USB Mass Storage devices
[ 4676.645726] usb-storage: device found at 19
[ 4676.645805] usb-storage: waiting for device to settle before scanning
[ 4676.869558] usb 2-1.2: reset high speed USB device using ehci_hcd and
address 19
[ 4677.092409] usb 2-1.2: usbfs: interface 0 claimed by usb-storage while
'qemu-system-x86' sets config #1

(qemu) info usb
  Device 0.1, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet
  Device 1.1, Port 1, Speed 480 Mb/s, Product Imation
  Device 1.2, Port 2, Speed 480 Mb/s, Product Super Multi DVD Rewriter
(qemu) info usbhost
  Bus 1, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0020
  Bus 2, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0020
  Bus 2, Addr 19, Port 1.2, Speed 480 Mb/s
    Class 00: USB device 152e:2507, Super Multi DVD Rewriter
  Auto filters:
    Bus 2, Addr *, Port 1.4, ID *:*
    Bus 2, Addr *, Port 1.2, ID *:*
(qemu)

again - why is the USB key still present?
it was remove before!

Disconnecting the DVD drive:

[ 9540.202181] usb 2-1.2: USB disconnect, address 19

(qemu) info usb
  Device 0.1, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet
  Device 1.1, Port 1, Speed 480 Mb/s, Product Imation
  Device 1.2, Port 2, Speed 480 Mb/s, Product Super Multi DVD Rewriter
(qemu) info usbhost
  Bus 1, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0020
  Bus 2, Addr 2, Port 1, Speed 480 Mb/s
    Hub: USB device 8087:0020
  Auto filters:
    Bus 2, Addr *, Port 1.4, ID *:*
    Bus 2, Addr *, Port 1.2, ID *:*
(qemu)

Finally - both DVD and USB key remain listed, why?


Best regards,

Erik





reply via email to

[Prev in Thread] Current Thread [Next in Thread]