# USB device connecting and disconnecting continuosly

## charon

I'm dealing with weird behavior when connecting PDA with PC via USB cradle. When I put PDA into the cradle, kernel detects new USB device correctly and loads correct modules (usb-serial, ipaq). But after about 5 seconds the device is disconnected by kernel. Then new device is connected right after disconnect, device is sucessfully reconnected ... and so on, again and again. See the log (log with usb debugging turned on bellow):

```

Oct  9 12:56:20 [kernel] usb 2-1: new full speed USB device using uhci_hcd and address 5

Oct  9 12:56:20 [kernel] usbcore: registered new driver usbserial

Oct  9 12:56:20 [kernel] drivers/usb/serial/usb-serial.c: USB Serial support registered for PocketPC PDA

Oct  9 12:56:20 [kernel] ipaq 2-1:1.0: PocketPC PDA converter detected

Oct  9 12:56:20 [kernel] usb 2-1: PocketPC PDA converter now attached to ttyUSB0

Oct  9 12:56:20 [kernel] usbcore: registered new driver ipaq

Oct  9 12:56:32 [kernel] usb 2-1: USB disconnect, address 5

Oct  9 12:56:38 [kernel] usb 2-1: new full speed USB device using uhci_hcd and address 6

Oct  9 12:56:38 [kernel] ipaq 2-1:1.0: PocketPC PDA converter detected

Oct  9 12:56:38 [kernel] usb 2-1: PocketPC PDA converter now attached to ttyUSB0

Oct  9 12:56:50 [kernel] usb 2-1: USB disconnect, address 6

Oct  9 12:56:55 [kernel] usb 2-1: new full speed USB device using uhci_hcd and address 7

Oct  9 12:56:55 [kernel] ipaq 2-1:1.0: PocketPC PDA converter detected

Oct  9 12:56:55 [kernel] usb 2-1: PocketPC PDA converter now attached to ttyUSB0

Oct  9 12:57:08 [kernel] usb 2-1: USB disconnect, address 7

```

Other USB devices (drives, mouse, bluetooth module) work OK. Tried different PC hardware and even different PDA/cradle and got always same output. And the weirdest thing is ... I did have it working once a couple of months ago! It was with the hardware I also tried now and it doesn't work on it now anymore. I remember I had older kernel there like 2.6.8 or .7, but I can't try that.

By playing with usbcore parametrs I was able to produce more different messages like:

```

device descriptor read/64, error -71

device not accepting address XX, error -71 

```

My kernel is 2.6.13 (older 2.6 versions tried also), PDA is Dell Axim X30, USB is:

```

0000:00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)

0000:00:10.3 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 82)

```

Anyone experienced this ? Any clues where to go ... kernel USB bug, hardware problem ? 

Any help appreciated.

Ch.

P.S. Promised debug log ...

```

hub 1-0:1.0: state 5 ports 6 chg 0000 evt 0008

ehci_hcd 0000:00:10.3: GetStatus port 3 status 001803 POWER sig=j CSC CONNECT

hub 1-0:1.0: port 3, status 0501, change 0001, 480 Mb/s

hub 1-0:1.0: debounce: port 3: total 100ms stable 100ms status 0x501

ehci_hcd 0000:00:10.3: port 3 full speed --> companion

ehci_hcd 0000:00:10.3: GetStatus port 3 status 003801 POWER OWNER sig=j CONNECT

uhci_hcd 0000:00:10.1: wakeup_rh (auto-start)

hub 1-0:1.0: port_wait_reset: err = -107

hub 3-0:1.0: state 5 ports 2 chg 0000 evt 0002

uhci_hcd 0000:00:10.1: port 1 portsc 0093,00

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

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

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

usb 3-1: ep0 maxpacket = 16

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

usb 3-1: hotplug

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

usb 3-1:1.0: hotplug

usbcore: registered new driver usbserial

drivers/usb/serial/usb-serial.c: USB Serial Driver core v2.0

drivers/usb/serial/usb-serial.c: USB Serial support registered for PocketPC PDA

drivers/usb/serial/ipaq.c: USB PocketPC PDA driver v0.5

ipaq 3-1:1.0: usb_probe_interface

ipaq 3-1:1.0: usb_probe_interface - got id

ipaq 3-1:1.0: PocketPC PDA converter detected

usb 3-1: PocketPC PDA converter now attached to ttyUSB0

usbcore: registered new driver ipaq

hub 3-0:1.0: state 5 ports 2 chg 0000 evt 0002

uhci_hcd 0000:00:10.1: port 1 portsc 008a,00

hub 3-0:1.0: port 1, status 0100, change 0003, 12 Mb/s

usb 3-1: USB disconnect, address 2

usb 3-1: usb_disable_device nuking all URBs

usb 3-1: unregistering interface 3-1:1.0

PocketPC PDA ttyUSB0: PocketPC PDA converter now disconnected from ttyUSB0

ipaq 3-1:1.0: device disconnected

usb 3-1:1.0: hotplug

usb 3-1: unregistering device

usb 3-1: hotplug

hub 3-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x100

```

----------

## kyron

Thought I'd add my two cents since I am having the same problem with an external HDD driver (Maxtor OneTouche USB2.0 drive) and have been searching for quite a few hours for a solution. I get repeated errors like:

```
usb 1-3.3: new high speed USB device using ehci_hcd and address 5

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

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

usb 1-3.3: new high speed USB device using ehci_hcd and address 6

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

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

usb 1-3.3: new high speed USB device using ehci_hcd and address 7

usb 1-3.3: device descriptor read/8, error -110

usb 1-3.3: device descriptor read/8, error -110

usb 1-3.3: new high speed USB device using ehci_hcd and address 8

usb 1-3.3: device descriptor read/8, error -110

usb 1-3.3: device descriptor read/8, error -110
```

 ...and on and on... I tried this recommendation without success and will try after seeing  this one  but I doubt it will help. I tried connecting my drive directly to my motherboard (without a hub) but it changes nothing to my problem. I am starting to think there is something wrong with the USB drivers somewhere (my printer/scanner HP PSC 2110 is also acting weird, requiering a reboot (!!!) to fall back and start scanning/printing again).

...As I was editing this post... I remembered that the kernel really didn't seem to like it when I powercycle the drive (to try to get it to be recognized). I get one of those "Mystical" Oops!

```
usb 1-5: reset high speed USB device using ehci_hcd and address 19

usb 1-5: device descriptor read/8, error -110

usb 1-5: device descriptor read/8, error -110

usb 1-5: USB disconnect, address 19

scsi: Device offlined - not ready after error recovery: host 2 channel 0 id 0 lun 0

Unable to handle kernel NULL pointer dereference at virtual address 00000000

 printing eip:

c0364ad3

*pde = 00000000

Oops: 0002 [#1]

SMP

Modules linked in: nvidia smbfs usblp usbhid uhci_hcd ehci_hcd evdev vfat fat usb_storage visor usbserial usbcore snd_hda_intel snd_hda_codec snd_pcm snd_timer snd soundcore snd_page_alloc tulip

CPU:    1

EIP:    0060:[<c0364ad3>]    Tainted: P      VLI

EFLAGS: 00010292   (2.6.13-gentoo-r3_KyRoN)

EIP is at _spin_lock+0x0/0xf

eax: 00000000   ebx: d96cfe20   ecx: d96cfe04   edx: 00000286

esi: 00000000   edi: 00000286   ebp: dfcd7808   esp: f75efe48

ds: 007b   es: 007b   ss: 0068

Process khubd (pid: 5528, threadinfo=f75ee000 task=f7f0ba40)

Stack: c0362ad1 d96cfe14 dfcd78f0 c0284feb d96cfe14 d96cfe00 c02b9dc4 dfcd7804

       dfcd7800 dfcd7804 c02bade6 dfcd7800 dfcd7800 f893cf80 f7f94254 c02b46dc

       dfcd7a78 dfcd7800 f893878b 00000000 c943d200 f893cf60 f891c0de c943d284

Call Trace:

 [<c0362ad1>] klist_del+0x15/0x2d

 [<c0284feb>] device_del+0x13/0x57

 [<c02b9dc4>] scsi_target_reap+0x85/0x9d

 [<c02bade6>] scsi_forget_host+0x33/0x56

 [<c02b46dc>] scsi_remove_host+0x11/0x60

 [<f893878b>] storage_disconnect+0x5c/0x76 [usb_storage]

 [<f891c0de>] usb_unbind_interface+0x60/0x62 [usbcore]

 [<c02863ac>] __device_release_driver+0x7f/0x9e

 [<c02863e7>] device_release_driver+0x1c/0x2b

 [<c0285c99>] bus_remove_device+0x4e/0x5a

 [<c0284ffc>] device_del+0x24/0x57

 [<f8923468>] usb_disable_device+0x99/0xfe [usbcore]

 [<f891e33c>] usb_disconnect+0xa6/0x13f [usbcore]

 [<f891f5a9>]<7>usb-storage: device scan complete

 hub_port_connect_change+0x2dd/0x399 [usbcore]

 [<f891e72b>] hub_port_status+0x1e/0x9a [usbcore]

 [<f891f848>] hub_events+0x1e3/0x38a [usbcore]

 [<f891fa08>] hub_thread+0x19/0xe9 [usbcore]

 [<c012daaa>] autoremove_wake_function+0x0/0x43

 [<c012daaa>] autoremove_wake_function+0x0/0x43

 [<f891f9ef>] hub_thread+0x0/0xe9 [usbcore]

 [<c012d63e>] kthread+0xa0/0xd4

 [<c012d59e>] kthread+0x0/0xd4

 [<c0100ff9>] kernel_thread_helper+0x5/0xb

Code: 81 28 00 00 00 01 74 05 e8 0b e5 ff ff c3 ba 00 e0 ff ff 21 e2 81 42 14 00 01 00 00 f0 81 28 00 00 00 01 74 05 e8 ee e4 ff ff c3 <f0> fe 08 79 09 f3 90 80 38 00 7e f9 eb f2 c3 f0 81 28 00 00 00
```

----------

## kyron

Okay...some update to my own post. Turns out this external drive I have been attempting to use (which did work for a while) is definately defective (after cross-testing with different system/platform).

----------

## lysergicacid

i had a lot of that when i was plugging several high power draining devices into my old asus board (via usb chipset) think its a via underpowered usb thing i swapped to an nforce2 board and never seen it since, had issues powering my old webcam to ages ago wen other things were plugged in. Via supposed to of sorted the low power to their usb buss out but i dont think they ever really did, i bet if u plug several high power draining usb devices in and start compiling then look at the output of dmesg it'll be doing it tons, replace ur via chipset board with nforce or buy a standalone self powered usb hub thing that doesnt drain too much power off ur m/b.

----------

## olger901

I had the problem once, that my pc would hang ocasionally, when booting the kernel, when too many USB devices were attached to my system, I soon found out my problem was my PSU wasn't strong enough, I upgraded to a Tagen TG480-U22 4800Watt PSU and all my problems were solved.

----------

