# USB troubles: keyboard and hotplugging [NOT SOLVED]

## Tanktalus

I think these are related, so I'm putting them in a single thread.

The first problem is intermittent loss of keyboard on boot.  The keyboard is a USB keyboard, and always works when dealing with the BIOS or grub (which, from what I gather, just gets it from the BIOS).  Then the kernel gets a hold of the system, and it's all up in the air as to whether the keyboard will be honoured or not.  Most of the time, it is not.  It generally takes me 3-6 reboots (ssh'ing in from another machine to trigger the boot) to get the keyboard working again.

I've not narrowed down when it will work after a reboot.  Generally, I need to perform at least one each of a soft-boot and a full shut-down of the machine, though the order doesn't appear to matter.

The second problem is, I think, related.  At any point after the system has booted, if I plug in a new USB device (external CD ROM, camera, thumb drive, whatever), the entire USB system stops responding.  That includes the keyboard (and mouse if I've started X).  Again, ssh'ing in works fine, and I can reboot (a number of times) to get the system responsive again.

Details:

```
lspci -v:

00:13.0 USB Controller: ATI Technologies Inc SB600 USB (OHCI0) (prog-if 10 [OHCI])

   Subsystem: ASUSTeK Computer Inc. Unknown device 81ef

   Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 16

   Memory at fe02e000 (32-bit, non-prefetchable) [size=4K]

   Kernel driver in use: ohci_hcd

00:13.1 USB Controller: ATI Technologies Inc SB600 USB (OHCI1) (prog-if 10 [OHCI])

   Subsystem: ASUSTeK Computer Inc. Unknown device 81ef

   Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 17

   Memory at fe02d000 (32-bit, non-prefetchable) [size=4K]

   Kernel driver in use: ohci_hcd

00:13.2 USB Controller: ATI Technologies Inc SB600 USB (OHCI2) (prog-if 10 [OHCI])

   Subsystem: ASUSTeK Computer Inc. Unknown device 81ef

   Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 18

   Memory at fe02c000 (32-bit, non-prefetchable) [size=4K]

   Kernel driver in use: ohci_hcd

00:13.3 USB Controller: ATI Technologies Inc SB600 USB (OHCI3) (prog-if 10 [OHCI])

   Subsystem: ASUSTeK Computer Inc. Unknown device 81ef

   Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 17

   Memory at fe02b000 (32-bit, non-prefetchable) [size=4K]

   Kernel driver in use: ohci_hcd

00:13.4 USB Controller: ATI Technologies Inc SB600 USB (OHCI4) (prog-if 10 [OHCI])

   Subsystem: ASUSTeK Computer Inc. Unknown device 81ef

   Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 18

   Memory at fe02a000 (32-bit, non-prefetchable) [size=4K]

   Kernel driver in use: ohci_hcd

00:13.5 USB Controller: ATI Technologies Inc SB600 USB Controller (EHCI) (prog-if 20 [EHCI])

   Subsystem: ASUSTeK Computer Inc. Unknown device 81ef

   Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 19

   Memory at fe029000 (32-bit, non-prefetchable) [size=256]

   Capabilities: [c0] Power Management version 2

   Capabilities: [e4] Debug port: BAR=1 offset=00e0

   Kernel driver in use: ehci_hcd

Kernel level:

Linux naboo 2.6.25-gentoo-r6 #4 SMP Mon Jul 14 08:16:56 MDT 2008 x86_64 AMD Phenom(tm) 9850 Quad-Core Processor AuthenticAMD GNU/Linux

```

The OHCI and EHCI drivers are built in (not modules).  Any insight would be appreciated  :Smile: Last edited by Tanktalus on Mon Jul 21, 2008 3:30 am; edited 2 times in total

----------

## NeddySeagoon

Tanktalus,

Rebuild your kernel with OHCI and EHCI support as modules.

If it is still a problem, ssh in and remove and reload the OHCI module only.

If you don't have any USB 2 devices, remove the EHCI module entirely. 

Google your ATI Technologies Inc SB600 USB Controller.

If it provides Transaction Translation, turn that on in the kernel (Under EHCI) and turn off the OHCI driver.

Trial and error is safe too.

----------

## Tanktalus

NeddySeagoon,

Thanks a lot.  That helped immensely.

I enabled the transaction translation flag, turned them into modules, and then started playing with them.  Eventually, I deleted the OHCI module - the EHCI module currently seems like it's enough to handle the system, and when the OHCI module is loaded, it plays havoc.

I'll probably convert it back to non-module to try that, too, because then I'll get my keyboard working just a tiny bit earlier in the boot sequence (which allows shift-pgup to work to page through what has happened so far).

I don't have USB2 devices currently hooked up, but that was largely because every time I did, all USB stopped working.  But now that even hotplugging is working, I'll start using my USB2 devices again (mainly new camera and DVD burner).

----------

## Tanktalus

Ok, it helped ... but not quite perfect.

I just tried to plug my camera in, and the kernel lost track of my USB status (only ehci_hcd was loaded), keyboard stopped working and everything.

Rebooted, and USB still wasn't working.

Unloaded/reloaded the ehci_hcd module.  Nothing.  A couple more of those, and then it started working again.

So, better, but ... not quite there yet  :Sad: 

----------

## SysGhost

I have just the same problem.

Crawling around on the net after a solution, or at least an answer, I have found out that the USB modules in the kernel do not work very well with Ati's/AMD's SB600 Southbridge chip.

There's even a rumor that it is a well known yet not solved hardware bug. ( but then... how comes USB works perfectly under Windows? )

Anyone with a solution where the USB randomly causes hangups?

----------

## eccerr0r

I have a machine where hotplugging in USB devices on the front/USB1 ports can cause the machine to freeze, crash, or reboot   :Shocked: 

(ECS K7S5A) - even has some issues in Windows.

I should soon be ridding myself of that poorly designed motherboard or possibly just the physical port connector...

----------

## SysGhost

Further testings and lots of reboots later I finally found the problem:

An USB hub that seemed to work just fine, caused lots of errors randomly, yet still operational.

To be more precise> a black 7 port USB 2.0 Hub made by ST/Lab. Workls but causes Linux EHCI crashing randomly due tons of "error -110"

Unplugging it and the USB system seems to be stable.

...but there is more to it:

It seems I cannot use lower speed devices at the same time as full speed devices. This also causes the same USB system hang up.

Tried to disable transactions in the kernel config under the EHCI module, no difference. 

Tried enable both transactions and the scheduler beneath, no difference.

Tried both transactions and scheduler disabled, no difference.

I cannot simply use low speed devices and full speed devices at the same time, and I cannot use that weird 7 port hub mentioned earlier, just the hub alone causes the USB system EHCI to crash.

To blaim the Linux kernel EHCI driver even more:

All the combinations mentioned above, including the hub, works just fine under Windows and stays stable: there's no noticeable performance drop either.

It seems we have to wait for the next kernel that fixes this rather unstable EHCI piece. Specially with SB600 Southbridge chip.

PS: One more thing: This hub that causes me so much trouble, works just fine and stays stable on other motherboards not using the notorious SB600 Chip

----------

## NeddySeagoon

SysGhost,

USB supports Low Speed, Full Speed and High Speed devices.

Low and Full speed devices are part of the USB 1 specification and provide data transfer rates of 1.5 Mbit/sec and 12Mbit/sec.

USB 2 provides for High Speed devices at 480 Mbit/sec.

This makes USB a bit of a mess but its the way its grown, like the rest of the PC.

1. When you connect a USB 2 device to a USB 1 root hub, its supposed to fall back to USB 1 speeds.

Many USB 2 devices don't do that properly and either fail totally or operate intermittently.

2. When you mix USB 2 and USB 1 on the same root hub, the root hub falls back to USB 1 operation with the effects in 1. above for the USB 2 devices.

3. USB hubs (splitters) are not root hubs, so everything on a USB hub must operate att either USB 1 or USB 2.

A USB root hub is the controller inside your PC. It normally exposes itself as a pair of USB connectors although at least one nVidia chipset design provides only a single root hub for all its USB connections.

```
emerge usbview
```

 and rearrange your USB devices into suitable groupings.

----------

## SysGhost

Ah... right. Thats why I wanted to use an external hub to put all my non full speed devices on it.

(why it's an 2.0 hub was simply because a slow one (USB 1.x) simply isn't available anywhere)

As soon I plug that hub in, no matter what usb port I use, it crashes the ehch_hcd module. and I have to unplug the hub, rmmod ehch_hcd, modprobe ehci_hcd to recover from this crash, sometimes only a reload of the kernel itself helps (i.e. a reboot or calling kexec) since that ehci module died a horrible death.

i.m.h.o ehci_hcd shouldn't crash no matter what I put into the usb-ports, but thats just me.

Anyhow I'm still looking for a solution, and wherever I look, it seems to be one thing in common: the famous SB600 Southbridge chip from AMD/ATI.

These problems didn't exist with my old motherboard based upon nForce 570 (I recently upgraded to Asus M3A32 MVP Deluxe, based upon AMD FX790 + SB600)

PS: At the moment I'm trying to collect logs and see if a kernel upgrade and where there are any patches available I'll try them out too... still crawling around the Internet, now a little deeper... I'll be back when I find some usable information.

----------

## NeddySeagoon

SysGhost,

2.6.25-gentoo-r6 is supposed to have some patches for USB on SB600. I didn't check the 2.6.25 vanilla change log to see if they made it or not.

Try 2.6.26-gentoo-r1, which is in testing

----------

## SysGhost

I'm right at it! 

At the moment configuring/compiling hitchhiker-sources-2.6.26-r2 from berkano-overlay (layman/subversion)

I needed Reiser4 support and UDF 2.5 reading support, and these patches where included on the hitchhiker sources, which is based upon gentoo-sources.

----------

## SysGhost

No success., it keep repeating those errors when I use any kind of external hubs:

usb 1-9: reset high speed USB device using ehci_hcd and address 4

usb 1-9: device descriptor read/64, error -110

It keeps repeating until I disconnect the hub. (and it doesn't matter which port they're connected to, same result)

Some devices I have have internal hubs and those causes these errors aswell. 

For example my keyboard has an internal hub where I can connect various devices. another one is one mobile phone docking station using an internal USB-hub.

USB-devices that doesn't use any hubs seems to work just fine, until ehci_hcd crashes causing those "usb 1-9: device descriptor read/64, error -110" where I either have to reload the module, or reboot. This only happens with the SB600 chip.

If I do move this harddrive to my old computer (using nForce 570), boot it up and connect everything that causes these errors, it works just fine.

In short: SB600 causes ehci_hcd crash, hang or other ways, behave strange with tons of "usb 1-9: device descriptor read/64, error -110" if used with external hubs or devices with internal hubs. (Devices that don't utilise hubs seems to work fine)

EDIT: I got a tip from someone that those errors -110 means bad cabling. I don't believe it's the case, because it works fine elsewhere not using SB600. and I also tried change cabling, shorter cables, longer cables, extremely expensive shielded industrial class cabling.. .no difference...

----------

