Red Hat Bugzilla – Bug 728120
print error on usb speed mismatch between device and bus/port
Last modified: 2013-01-09 19:11:31 EST
Description of problem: Can't find usb-tablet device in guest under EHCI adapter Version-Release number of selected component (if applicable): qemu-kvm-0.12.1.2-2.175.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1.Boot guest with usb-tablet and -device usb-ehci,id=ehci #/usr/libexec/qemu-kvm -M rhel6.2.0 -enable-kvm -m 2G -smp 2,cores=2,threads=1,sockets=1 -name RHEL6.1_32 -uuid 50eba0fa-c3bc-4634-9c87-e46fc4dafab9 -rtc base=utc,clock=host,driftfix=slew -boot menu=on -drive file=/root/zhangjunyi/RHEL6.1_64-copy-2.qcow2,if=none,id=drive-ide-0-0,media=disk,format=qcow2,cache=none,werror=stop,index=0 -device virtio-blk-pci,drive=drive-ide-0-0,id=ide0-0-0,bootindex=1 -netdev tap,id=hostnet1 -device virtio-net-pci,netdev=hostnet1,id=net1,mac=78:2B:CB:AF:11:11 -vnc :10 -monitor stdio -balloon none / -device usb-ehci,id=ehci -device usb-tablet,bus=ehci.0 2.check usb in qemu #(qemu) info usb Device 0.1, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet 3.In guest #lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub #dmesg hub 1-0:1.0: Cannot enable port 1. Maybe the USB cable is bad? hub 1-0:1.0: Cannot enable port 1. Maybe the USB cable is bad? hub 1-0:1.0: Cannot enable port 1. Maybe the USB cable is bad? hub 1-0:1.0: Cannot enable port 1. Maybe the USB cable is bad? #usb-devices T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 4 D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1d6b ProdID=0002 Rev=02.06 S: Manufacturer=Linux 2.6.32-131.0.15.el6.x86_64 ehci_hcd S: Product=EHCI Host Controller S: SerialNumber=0000:00:05.0 C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub Actual results: can't find usb-tablet device,in addition,saw error message about usb "hub 1-0:1.0: Cannot enable port 1. Maybe the USB cable is bad?" Expected results: 1.if we support usb-tablet work under EHCI adapter usb-tablet works well 2.if we don't support usb-tablet&EHCI adapter should not let guest boot and promote friendly message. Additional info: 1. usb-tablet doesn't work under UHCI adapter,can find usb-tablet and no error message in dmesg. #/usr/libexec/qemu-kvm -M rhel6.2.0 -enable-kvm -m 2G -smp 2,cores=2,threads=1,sockets=1 -name RHEL6.1_32 -uuid 50eba0fa-c3bc-4634-9c87-e46fc4dafab9 -rtc base=utc,clock=host,driftfix=slew -boot menu=on -drive file=/root/zhangjunyi/RHEL6.1_64-copy-2.qcow2,if=none,id=drive-ide-0-0,media=disk,format=qcow2,cache=none,werror=stop,index=0 -device virtio-blk-pci,drive=drive-ide-0-0,id=ide0-0-0,bootindex=1 -netdev tap,id=hostnet1 -device virtio-net-pci,netdev=hostnet1,id=net1,mac=78:2B:CB:AF:11:11 -vnc :10 -monitor stdio -balloon none / -usb -device usb-tablet,bus=usb.0 2.(qemu) info usb Device 0.2, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet 3.in guest 1.lsusb Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 2. usb-devices T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1d6b ProdID=0001 Rev=02.06 S: Manufacturer=Linux 2.6.32-131.0.15.el6.x86_64 uhci_hcd S: Product=UHCI Host Controller S: SerialNumber=0000:00:01.2 C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0627 ProdID=0001 Rev=00.00 S: Manufacturer=QEMU 0.12.1 S: Product=QEMU USB Tablet S: SerialNumber=42 C: #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=02 Driver=usbhid
HID devices are lowspeed devices and thus by design don't work on the highspeed EHCI adapter. It is possible to add companion UHCI controllers to the EHCI adapter, so the guest can ask EHCI to hand off the lowspeed devices which it can't handle itself to the UHCI companion. The easiest way to do this is "qemu [ ... ] -readconfig ich9-ehci-uhci.cfg -device usb-tablet,bus=ehci.0"
Created attachment 517994 [details] ich9-ehci-uhci.cfg
Forgot to mention: qemu-kvm-0.12.1.2-2.180.el6.x86_64 or newer is required.
(In reply to comment #1) > HID devices are lowspeed devices and thus by design don't work on the highspeed > EHCI adapter. > Would you please tell me can promote more friendly messages when do operations like these. and like bz728167 and bz723760,maybe better :)
Oh, looks like some patches slipped though when backporting. upstream complains on speed mismatch whereas rhel6 doesn't indeed ...
Reproduced on qemu-kvm-0.12.1.2-2.172.el6, and verified pass on qemu-kvm-0.12.1.2-2.195.el6. Steps: Boot a guest with the speed mismatch devices. /usr/libexec/qemu-kvm -M rhel6.2.0 -enable-kvm -m 2G -smp 2,cores=2,threads=1,sockets=1 -name RHEL6.1_32 -uuid 50eba0fa-c3bc-4634-9c87-e46fc4dafab9 -rtc base=utc,clock=host,driftfix=slew -boot menu=on -drive file=/home/RHEL6.1-64-virtio.qcow2,if=none,id=drive-ide-0-0,media=disk,format=qcow2,cache=none,werror=stop,index=0 -device virtio-blk-pci,drive=drive-ide-0-0,id=ide0-0-0,bootindex=1 -netdev tap,id=hostnet1 -device virtio-net-pci,netdev=hostnet1,id=net1,mac=78:2B:CB:AF:11:11 -vnc :10 -monitor stdio -balloon none -device usb-ehci,id=ehci -device usb-tablet,bus=ehci.0 For the qemu-kvm-0.12.1.2-2.172.el6, the result is the same as bug description. For qemu-kvm-0.12.1.2-2.195.el6, it prompts: *** EHCI support is under development *** qemu-kvm: -device usb-tablet,bus=ehci.0: Warning: speed mismatch trying to attach usb device QEMU USB Tablet to bus ehci.0 qemu-kvm: -device usb-tablet,bus=ehci.0: Device 'usb-tablet' could not be initialized Also boot with "-device usb-ehci,id=ehci -device usb-hub,bus=ehci.0,port=1 -device usb-hub,bus=ehci.0,port=2 -device usb-hub,bus=ehci.0,port=3 -device usb-hub,bus=ehci.0,port=4 -device usb-storage,bus=ehci.0,port=1.1,drive=usbstick1 -drive if=none,id=usbstick1,file=disk.qcow2" The error prompts are the same. Guest can not boot up, so this issue if fixed.
Moving to ON_QA because Errata Tool did not do it
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2011-1531.html