# USB/input Seriously Irritating bug hunt

## Shanachie

I've had this annoying bug with my laptop since I bought it, switching to gentoo and the 2.6 kernel solved some problems but this one still remains.

Whenever a usb device is active the keyboard starts to repeat a random key  (usually b,q,R-Ctrl) it stops when I press that button.

This bug occurs most of the time when my MP3-player (usb-storage) or bluetooth-adapter is plugged in (seems kernel related).

Very rarely it happens when only the usbmouse is plugged in.

Sometimes the usbmouse stops working to at the same moment the keyboard repeats, but when I switch to a VT and back to X it moves again. That would suggest an xorg bug.

So I don't know if it's a kernel or a X bug. I do know there's something wrong with my usb controller, some hardware-bug that requires a reset in the usb-stack to correct. Via has a special usb-filter driver for winXP to correct this problem but on windows the effects of the reset are even worse than on linux.

The device is a VT82xxxxx UHCI USB 1.1 controller (pci-id 1106:3038) although it's identified by lspci as the VT6202 USB2.0 controller.

Any help finding the source of the problem will be very welcome.

----------

## dj_choco

Shanachie,

What is the output of 

```
dmesg | grep -i usb
```

Do you have (compiled in or loaded as modules) the OHCI and EHCI USB drivers?

OHCI = usb 1.0

UHCI = usb 1.1

EHCI = usb 2.0

[The usb mappings above are my understanding and subject to the scrutiny of those more experienced and knowledgable in the workings the USB bus and its associated devices.]

You could also (if available) toggle the Legacy USB support in your BIOS: not sure I am what this actually does.

----------

## Shanachie

Actually UHCI is for intel and via chipsets, OHCI for the others. The difference is that OHCI does more in hardware. But thats not the point.

UHCI is compiled in the kernel, EHCI and OHCI are not configured.

```
CONFIG_USB_UHCI_HCD=y

# CONFIG_USB_OHCI_HCD is not set

# CONFIG_USB_EHCI_HCD is not set

```

I also have usb debug configured.

```
CONFIG_USB_DEBUG=y
```

Anyway here is a the dmesg output when the mouse and mp3 jukebox are plugged in, qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

as you can see, the q repeated, so did the " at some point.

```
drivers/usb/input/hid-core.c: input irq status -84 received

drivers/usb/input/hid-core.c: input irq status -84 received

drivers/usb/input/hid-core.c: input irq status -84 received

drivers/usb/input/hid-core.c: input irq status -84 received

uhci_hcd 0000:00:11.3: port 2 portsc 058a

hub 2-0:1.0: port 2, status 0308, change 0003, 1.5 Mb/s

usb 2-2: USB disconnect, address 2

usb 2-2: usb_disable_device nuking all URBs

uhci_hcd 0000:00:11.3: shutdown urb cdddab60 pipe 40408280 ep1in-intr

usb 2-2: unregistering interface 2-2:1.0

usb 2-2:1.0: hotplug

usb 2-2: unregistering device

usb 2-2: hotplug

hub 2-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x308

uhci_hcd 0000:00:11.3: suspend_hc

uhci_hcd 0000:00:11.3: wakeup_hc

uhci_hcd 0000:00:11.3: port 2 portsc 05a3

hub 2-0:1.0: port 2, status 0309, change 0001, 1.5 Mb/s

hub 2-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x309

usb 2-2: new low speed USB device using address 3

usb 2-2: skipped 1 descriptor after interface

usb 2-2: new device strings: Mfr=0, Product=0, SerialNumber=0

usb 2-2: hotplug

usb 2-2: adding 2-2:1.0 (config #1, interface 0)

usb 2-2:1.0: hotplug

usbhid 2-2:1.0: usb_probe_interface

usbhid 2-2:1.0: usb_probe_interface - got id

input: USB HID v1.10 Mouse [062a:0001] on usb-0000:00:11.3-2

spurious 8259A interrupt: IRQ7.

uhci_hcd 0000:00:11.2: port 2 portsc 0093

hub 1-0:1.0: port 2, status 0101, change 0001, 12 Mb/s

uhci_hcd 0000:00:11.2: wakeup_hc

hub 1-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x101

usb 1-2: new full speed USB device using address 2

uhci_hcd 0000:00:11.2: uhci_result_control: failed with status 440000

[c1310240] link (013101e2) element (01311040)

  0: [c1311040] link (01311080) e0 Stalled CRC/Timeo Length=7 MaxLen=7 DT0 EndPt=0 Dev=0, PID=2d(SETUP) (buf=0179c740)

  1: [c1311080] link (00000001) e3 IOC Active Length=0 MaxLen=7ff DT1 EndPt=0 Dev=0, PID=69(IN) (buf=00000000)

usb 1-2: new device strings: Mfr=73, Product=93, SerialNumber=115

usb 1-2: default language 0x0409

usb 1-2: Product: iRiver iHP-100 Series

usb 1-2: Manufacturer: iRiver             

usb 1-2: SerialNumber: 0123456789AB

usb 1-2: hotplug

usb 1-2: adding 1-2:2.0 (config #2, interface 0)

usb 1-2:2.0: hotplug

ub: sizeof ub_scsi_cmd 60 ub_dev 924

ub 1-2:2.0: usb_probe_interface

ub 1-2:2.0: usb_probe_interface - got id

uba: device 2 capacity nsec 78126048 bsize 512

uba: was not changed

 uba: uba1

usbcore: registered new driver ub

uba: was not changed

atkbd.c: Unknown key pressed (translated set 2, code 0xbf on isa0060/serio0).

atkbd.c: Use 'setkeycodes e03f <keycode>' to make it known.

atkbd.c: Unknown key pressed (translated set 2, code 0x5b on isa0060/serio0).

atkbd.c: Use 'setkeycodes 5b <keycode>' to make it known.

atkbd.c: Unknown key pressed (translated set 2, code 0x69 on isa0060/serio0).

atkbd.c: Use 'setkeycodes 69 <keycode>' to make it known.

atkbd.c: Unknown key released (translated set 2, code 0x69 on isa0060/serio0).

atkbd.c: Use 'setkeycodes 69 <keycode>' to make it known.

atkbd.c: Unknown key pressed (translated set 2, code 0x68 on isa0060/serio0).

atkbd.c: Use 'setkeycodes 68 <keycode>' to make it known.

atkbd.c: Unknown key released (translated set 2, code 0x68 on isa0060/serio0).

atkbd.c: Use 'setkeycodes 68 <keycode>' to make it known.

atkbd.c: Unknown key pressed (translated set 2, code 0x5a on isa0060/serio0).

atkbd.c: Use 'setkeycodes 5a <keycode>' to make it known.

atkbd.c: Unknown key released (translated set 2, code 0x5a on isa0060/serio0).

atkbd.c: Use 'setkeycodes 5a <keycode>' to make it known.

atkbd.c: Unknown key pressed (translated set 2, code 0x68 on isa0060/serio0).

atkbd.c: Use 'setkeycodes 68 <keycode>' to make it known.

atkbd.c: Unknown key released (translated set 2, code 0x68 on isa0060/serio0).

atkbd.c: Use 'setkeycodes 68 <keycode>' to make it known.

atkbd.c: Unknown key pressed (translated set 2, code 0x68 on isa0060/serio0).

atkbd.c: Use 'setkeycodes 68 <keycode>' to make it known.

atkbd.c: Unknown key released (translated set 2, code 0x68 on isa0060/serio0).

atkbd.c: Use 'setkeycodes 68 <keycode>' to make it known.

```

----------

## dj_choco

Shanachie,

From the Gentoo-2.6.9-r6 Kernel:

 *Quote:*   

>   CONFIG_USB_EHCI_HCD:                                                                        
> 
> The Enhanced Host Controller Interface (EHCI) is standard for USB 2.0
> 
>  "high speed" (480 Mbit/sec, 60 Mbyte/sec) host controller hardware.
> ...

 

Just guessing that you might need the UHCI drivers, as you originally stated that  *Quote:*   

> The device is a VT82xxxxx UHCI USB 1.1 controller.

  Also, are you enabling "Enforce USB bandwidth allocation"? Seems that would limit use of the USB bus for one device when several others are connected:

```
Device Drivers --->

USB support --->

[ ]     Enforce USB bandwidth allocation (EXPERIMENTAL)

```

----------

## dj_choco

According the an article on kerneltrap.org, you can follow the instructions the kernel is givining you:

 *Quote:*   

> atkbd.c: Unknown key pressed (translated set 2, code 0xbf on isa0060/serio0).
> 
> atkbd.c: Use 'setkeycodes e03f <keycode>' to make it known.
> 
> atkbd.c: Unknown key pressed (translated set 2, code 0x5b on isa0060/serio0).
> ...

 

 *Quote:*   

> Use the setkeycodes utility with the suggested
> 
> scncode value. For the keycode value, look into /usr/include/linux/input.h,
> 
> where is a list of all defined Linux keycodes.

 

```
# setkeycodes <Enter>

setkeycode: even number of arguments expected

usage: setkeycode scancode keycode ...

 (where scancode is either xx or e0xx, given in hexadecimal,

  and keycode is given in decimal)
```

Maybe there's an Xfree patch for this?

----------

## Shanachie

Thanks for helping me dj_choco but I don't think thats gonna help, let me explain why.

 *dj_choco wrote:*   

> Just guessing that you might need the UHCI drivers, as you originally stated that  *Quote:*   The device is a VT82xxxxx UHCI USB 1.1 controller.  Also, are you enabling "Enforce USB bandwidth allocation"? Seems that would limit use of the USB bus for one device when several others are connected:
> 
> ```
> Device Drivers --->
> 
> ...

 

Accualy I have UHCI compiled in, as mentioned in my second post and CONFIG_USB_BANDWIDTH is not set.

 *Quote:*   

> Use the setkeycodes utility with the suggested 
> 
> scancode value. For the keycode value, look into /usr/include/linux/input.h, 
> 
> where is a list of all defined Linux keycodes.

 

searched the /usr/include/linux/input.h for keycodes in my dmesg output:

 0xbf not found (KEY_F21 ?)

 #define FF_SAW_UP 0x5b in section "Force feedback periodic effect types"

 0x69 not found (could be KEY_LEFT)

 0x68 not found (KEY_PAGEUP ??)

 #define FF_SINE  0x5a aigain in section "Force feedback periodic effect types"

I don't know what forcefeedback has to do with my mp3 player but I think these are just random codes generated because Xorg (same as when I still had XFree) access the keyboard controller register which maybe is used by USB later. If the code for q or " is generated, it starts repeating, I think.

What to do next??

----------

## dj_choco

Shanachie,

Let's start with the least complex scenario. With only the keyboard and mouse connected, you still get the same behaviour, but less frequently.

Do you have another USB keyboard to test this with? (I've assumed that the Keyboard is USB)

I would start there, then move to trying both the UHCI and EHCI compiled in or both as modules.

----------

## Shanachie

Actually, it's a laptop, sorry should have mentioned that [edit] I have mentioned it  :Smile:  [/edit]. So no USB keyboard, it's connected through serial io. Also, the touchpad keeps working no mather what.

But your right, when only the mouse is connected the problem still happens but far less frequent.

I'm not gonna compile EHCI because I don't have hardware for it, as I mentioned, its not an USB2.0 controller despite the lspci output.

I am thinking of getting an USB2.O PC-card for the mp3-player, maybe the problem won't happen with that controller because it not so buggy. I'll keep you updated.

----------

## dj_choco

Yep... you did mention that...   :Embarassed: 

good luck

----------

## gentsquash

 *dj_choco wrote:*   

> ...  From the Gentoo-2.6.9-r6 Kernel:
> 
>  *Quote:*     CONFIG_USB_EHCI_HCD:                                                                        
> 
> The Enhanced Host Controller Interface (EHCI) is standard for USB 2.0 ...   
> ...

 

How does one read/access this information from the kernel, please?

----------

## Taladar

If you use "make config" you have press "?" instead of y/m/n to get this text when you are at the option in question. With "make menuconfig" you just use the help button.

----------

