# USB Mouse Disconnects Every Minute

## blugendoo

Sorry for necropost but I have the same problem, found this thread (no real answer) and I have some more info:

This is a very common problem, the search gives a huge number of various reports of the same kernel USB disconnect/reconnect events:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/243707

http://www.spinics.net/lists/linux-usb/msg88965.html

( This one is buying new mouse, same problem: )

http://comments.gmane.org/gmane.linux.lfs.support/34035

http://forums.fedoraforum.org/showthread.php?t=292825

( disable auto-suspend: )

http://forums.debian.net/viewtopic.php?f=7&t=104919

And...

https://bbs.archlinux.org/viewtopic.php?id=150114

2nd page: Simply installing the tlp utility and running the command sudo tlp usb resolved the problem.

Best answer and solution : - EDIT: well, this is what I thought at the moment

http://hamwaves.com/usb.autosuspend/en/

(shall we copy this here in case the page become unavailable?)Last edited by blugendoo on Fri Apr 15, 2016 11:05 pm; edited 1 time in total

----------

## charles17

 *blugendoo wrote:*   

> Best answer and solution :
> 
> http://hamwaves.com/usb.autosuspend/en/
> 
> (shall we copy this here in case the page become unavailable?)
> ...

 

IMHO worth to be added to the wiki

----------

## blugendoo

 *charles17 wrote:*   

>  *blugendoo wrote:*   Best answer and solution :
> 
> http://hamwaves.com/usb.autosuspend/en/
> 
> (shall we copy this here in case the page become unavailable?)
> ...

 

Err... not too fast:

There  might be a typo on that page: ATTRS vs ATTR for the first id.   :Rolling Eyes: 

So I tried: (EDITED)

```
vi /etc/udev/rules.d/usb-power.rules

#Microsoft Corp. Wheel Mouse Optical

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0x045e", ATTR{idProduct}=="0x0084", ATTR{power/control}="on"
```

But that wasn't better.

Actually I already had "on" for power/control on that mouse  :Neutral:  , I discovered that on the way. It still disconnect every minute.   :Crying or Very sad: 

The same hardware with Linux Mint 17.3 doesn't have this behavior. So it isn't an hardware issue.   :Surprised: 

Since my mouse (1-1.4.4) is on the integrated USB hub of my monitor, I also checked the upper bus levels (1-1.4 and 1-1) : power control = "auto". I managed to set "on" manually after boot but mouse still disconnect every minute.

And I couldn't set those hub power/control values with udev rules as he does on that page for the mouse.

I'll get back to this later (zzzzz) because I definitely can't have a system with a mouse freezing 1s every 60s and with increasing device number.

My next moves:

1- plug mouse directly on motherboard USB port (not the hub), for investigation

 and

2- more comparison with Linux Mint successful setup.

Any suggestion welcome for that second point.   :Wink: 

----------

## blugendoo

Comparison with a Linux Mint where there isn't this issue:

I use 

```
DEVNUMS=1-8.4

udevadm info --attribute-walk /sys/bus/usb/devices/$DEVNUMS
```

then I sort properties in each section and I compare output between Mint and Gentoo.

Note: Mint has kernel 3.19.0 + BIOS boot + initrc and Gentoo has kernel 4.5 + EFI boot + systemd (BIOS compat still activated on motherboard)

What I've found with udevadm isn't suspicious, is it?

```
Mint

/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.4

parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-8'

    ATTRS{removable}=="unknown"

parent device '/devices/pci0000:00/0000:00:14.0/usb1'

parent device '/devices/pci0000:00/0000:00:14.0'

    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000f"

Gentoo

/devices/pci0000:00/0000:00:14.0/usb3/3-8/3-8.4

parent device '/devices/pci0000:00/0000:00:14.0/usb3/3-8

    ATTRS{removable}=="removable"

parent device '/devices/pci0000:00/0000:00:14.0/usb3'

    ATTRS{interface_authorized_default}=="1"

parent device '/devices/pci0000:00/0000:00:14.0':

    ATTRS{local_cpus}=="f"

```

EDITED above (it was ehci in Gentoo, now xhci as in Mint)

----------

## Chiitoo

Split from [Solved] USB devices keep disconnecting and reconnecting where the original author abandoned the issue more than few years ago, marking the topic solved that way.

I remember an udev autosuspend-bug affecting eudev as well, which made my keyboard do some... interesting things, and rendered my machine unable to shut down/reboot.

This might have been related to it: github.com/systemd — Autosuspend incorrecty enabled for USB keyboards

I know nothing about systemd, however, so I can't really help with that.  ^^;

----------

## tlix

though not have tested the udev rules, but it should work ( unplug you usb mouse and plug it again after modify the configuration)

for me, I use laptop-mode-tool, in the 

```
/etc/laptop-mode/conf.d/runtime-pm.conf
```

, add your usb bus ID to the blacklist and start laptop-mode.service, it works.

----------

