Bug 195745

Summary: usb to ps2 dongle USB_ERR_TIMEOUT
Product: Base System Reporter: rdunkle
Component: usbAssignee: freebsd-usb mailing list <usb>
Status: Open ---    
Severity: Affects Only Me CC: hselasky
Priority: ---    
Version: 10.1-STABLE   
Hardware: amd64   
OS: Any   

Description rdunkle 2014-12-06 14:33:03 UTC
I have a usb to ps2 dongle with ps2 keyboard and mouse attached. This works fine for a random time.  It will stop responding at some point (usually after several hours of working). When I try to replug the dongle, the usb ports appear dead.  After a reboot functionality is restored and cycle repeats itself.  This never happens if I use a usb keyboard and mouse.

from /var/log/messages:
Nov 30 15:10:19 <kern.crit> smp5 kernel: ukbd0: at uhub3, port 6, addr 3 (disconnected)
Nov 30 15:10:19 <kern.crit> smp5 kernel: ums0: at uhub3, port 6, addr 3 (disconnected)
Nov 30 15:10:19 <user.notice> smp5 devd: Executing '/etc/rc.d/syscons setkeyboard /dev/kbd0'
Nov 30 15:10:19 <user.notice> smp5 devd: Executing '/etc/rc.d/moused stop ums0'
Nov 30 15:10:21 <kern.crit> smp5 kernel: usbd_req_re_enumerate: addr=3, set address failed! (USB_ERR_TIMEOUT, ignored)
Nov 30 15:10:27 <kern.crit> smp5 kernel: usbd_setup_device_desc: getting device descriptor at addr 3 failed, USB_ERR_TIMEOUT
Nov 30 15:10:29 <kern.crit> smp5 kernel: usbd_req_re_enumerate: addr=3, set address failed! (USB_ERR_TIMEOUT, ignored)
Nov 30 15:10:35 <kern.crit> smp5 kernel: usbd_setup_device_desc: getting device descriptor at addr 3 failed, USB_ERR_TIMEOUT
------------------------------------------------
# usbconfig
ugen1.1: <EHCI root HUB Intel> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.1: <XHCI root HUB 0x8086> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen2.1: <EHCI root HUB Intel> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen2.2: <product 0x8001 vendor 0x8087> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.2: <product 0x8009 vendor 0x8087> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen2.3: <Generic USB KB vendor 0x13ba> at usbus2, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA)
-------------------------------------------
# pciconf -lv
hostb0@pci0:0:0:0:	class=0x060000 card=0x85341043 chip=0x0c008086 rev=0x06 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Haswell DRAM Controller'
    class      = bridge
    subclass   = HOST-PCI
pcib1@pci0:0:1:0:	class=0x060400 card=0x85341043 chip=0x0c018086 rev=0x06 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = 'Haswell PCI Express x16 Controller'
    class      = bridge
    subclass   = PCI-PCI
xhci0@pci0:0:20:0:	class=0x0c0330 card=0x85341043 chip=0x8cb18086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = serial bus
    subclass   = USB
none0@pci0:0:22:0:	class=0x078000 card=0x85341043 chip=0x8cba8086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = simple comms
em0@pci0:0:25:0:	class=0x020000 card=0x85c41043 chip=0x15a18086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = network
    subclass   = ethernet
ehci0@pci0:0:26:0:	class=0x0c0320 card=0x85341043 chip=0x8cad8086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = serial bus
    subclass   = USB
hdac1@pci0:0:27:0:	class=0x040300 card=0x860b1043 chip=0x8ca08086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = multimedia
    subclass   = HDA
pcib2@pci0:0:28:0:	class=0x060400 card=0x85341043 chip=0x8c908086 rev=0xd0 hdr=0x01
    vendor     = 'Intel Corporation'
    class      = bridge
    subclass   = PCI-PCI
pcib3@pci0:0:28:3:	class=0x060401 card=0x85341043 chip=0x244e8086 rev=0xd0 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801 PCI Bridge'
    class      = bridge
    subclass   = PCI-PCI
ehci1@pci0:0:29:0:	class=0x0c0320 card=0x85341043 chip=0x8ca68086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = serial bus
    subclass   = USB
isab0@pci0:0:31:0:	class=0x060100 card=0x85341043 chip=0x8cc48086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = bridge
    subclass   = PCI-ISA
ahci0@pci0:0:31:2:	class=0x010601 card=0x85341043 chip=0x8c828086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = mass storage
    subclass   = SATA
none1@pci0:0:31:3:	class=0x0c0500 card=0x85341043 chip=0x8ca28086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = serial bus
    subclass   = SMBus
vgapci0@pci0:1:0:0:	class=0x030000 card=0x84bb1043 chip=0x138010de rev=0xa2 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    class      = display
    subclass   = VGA
hdac0@pci0:1:0:1:	class=0x040300 card=0x84bb1043 chip=0x0fbc10de rev=0xa1 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    class      = multimedia
    subclass   = HDA
pcib4@pci0:3:0:0:	class=0x060401 card=0x84891043 chip=0x10801b21 rev=0x04 hdr=0x01
    vendor     = 'ASMedia Technology Inc.'
    device     = 'ASM1083/1085 PCIe to PCI Bridge'
    class      = bridge
    subclass   = PCI-PCI
-------------------------------------
10.1-STABLE FreeBSD 10.1-STABLE #0 r274556
-------------------------------------

I have tried usbconfig  poweroff/on/reset   -- no luck
tried hw.usb.xhci.xhci_port_route=-1 into /boot/loader.conf   --no luck

The only method to connect back dongle is a reboot.
Comment 1 Hans Petter Selasky freebsd_committer 2014-12-06 14:38:50 UTC
Hi,

Can you compile XHCI as a module and kldload/kldunload it when the problem appears or try to suspend/resume the computer.

Try collection the log from the keyboard using "usbdump -i usbusX -f Y -s65536 -vvv". Note: all keypresses will be in the log, so only send the last few lines of messages, especially those which have "ERR=" different from "0".

Sounds like a hardware related problem and not a software one.

--HPS
Comment 2 rdunkle 2014-12-07 02:17:59 UTC
I compiled ehci and xhci as modules.
I was able to duplicate the usb disconnect after 6h:52m uptime.

Dec  6 17:25:21 <kern.crit> smp5 kernel: ukbd0: at uhub4, port 8, addr 3 (disconnected)
Dec  6 17:25:21 <kern.crit> smp5 kernel: ums0: at uhub4, port 8, addr 3 (disconnected)
Dec  6 17:25:21 <user.notice> smp5 devd: Executing '/etc/rc.d/syscons setkeyboard /dev/kbd0'
Dec  6 17:25:21 <user.notice> smp5 devd: Executing '/etc/rc.d/moused stop ums0'
Dec  6 17:25:24 <kern.crit> smp5 kernel: usbd_req_re_enumerate: addr=3, set address failed! (USB_ERR_TIMEOUT, ignored)
Dec  6 17:25:30 <kern.crit> smp5 kernel: usbd_setup_device_desc: getting device descriptor at addr 3 failed, USB_ERR_TIMEOUT
Dec  6 17:25:32 <kern.crit> smp5 kernel: usbd_req_re_enumerate: addr=3, set address failed! (USB_ERR_TIMEOUT, ignored)
Dec  6 17:25:38 <kern.crit> smp5 kernel: usbd_setup_device_desc: getting device descriptor at addr 3 failed, USB_ERR_TIMEOUT

I did kldunload and kldload on ehci.ko

The keyboard and mouse were then functioning again.