Fix sluggish mouse in Ubuntu 12.04 LTS

For some time now i have the problem with my Dell Latitude E6510 Laptop that when I plug in a USB mouse the mouse is really slow and sluggish. Usually a reboot fixes this, but this is very inconvenient. Today I tried some googleing again and found at least a workaround to restart the usb-services without rebooting. This usually helps to fix the mouse.

Find with lspci the device ids of your usb hubs:

lspci | grep -i usb
00:1a.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)
00:1d.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)

I wrote this little script, but of course you can also execute the commands directly on the commandline. In this case just be sure, that you have another keyboard than the one that is connected to usb, as of course after the unbind it will not work anymore until the rebind. (If you execute the commands by script or in one line, separated with ; it should be no problem as rebind is triggered directly after unbind without further keyboard involment).

switch the device numbers according to your lspci listing

#!/bin/bash
echo -n '0000:00:1a.0' > /sys/bus/pci/drivers/ehci_hcd/unbind 
echo -n '0000:00:1a.0' > /sys/bus/pci/drivers/ehci_hcd/bind 
echo -n '0000:00:1d.0' > /sys/bus/pci/drivers/ehci_hcd/unbind 
echo -n '0000:00:1d.0' > /sys/bus/pci/drivers/ehci_hcd/bind
pixelstats trackingpixel

Comments (9)

RonnieFebruary 11th, 2013 at %I:%M %p

Oh THANK YOU SO MUCH for sharing this!!
It did fix this SO ANNOYING problem..

Thanks again..

RamunasFebruary 18th, 2013 at %I:%M %p

Same problem after installing 12.04 on MacBook Pro: Mouse and keyboard gets sluggish to the point of killing any desire to use Ubuntu, and extensive googling and all the complains people write about graphics drivers and simplifications of Unity did not work . The trick you post solves it, but only for a minute or so. So I run this in a separate terminal:

watch -n 60 sudo bash usbfix.sh &

I hope to increase the value 60 and somehow automate this on a system level eventually so that every time I boot the Ubuntu it executes this automatically, but too bad I cannot set the number of seconds to a small value because rebinding introduces visible pauses (takes a second or two). But Ubuntu works now!

BTW, on my computer some USB drivers were ehci, but others were also “xhci” and “ohci” and that adjustment was needed.

Anyway, thanks a lot for posting this, this is the first time I actually write a blog comment on web, so you can appreciate the pain I’ve been having with this bug.

JanJuly 23rd, 2013 at %I:%M %p

I had the same problem on a Dell Latitude E4310, and your little trick solved it. In the old times, one would have just unloaded/reloaded the ehci kernel modules – but nowadays, they are always built in (Ubuntu, 13.04). So this is how you do it without modules 🙂

Thank you!

Frank de Groot - SchoutenAugust 30th, 2013 at %I:%M %p

Super!
In my case (Ubuntu 13.04 64-bit) the path had \’ehci-pci\’ instead of \’ehci_hcd\’ but other than that it works great.

seruJanuary 22nd, 2014 at %I:%M %p

Worked like a charm. Thank you!

subbiaJanuary 25th, 2014 at %I:%M %p

Still working workaround on ubuntu 13.10 and dell latitude e6410. Thanks!

João CésarFebruary 12th, 2014 at %I:%M %p

Thank you very much for halping solving this annoying problem!

MardoniApril 23rd, 2015 at %I:%M %p

Thank from Ubuntu 14.04 LTS 🙂

Tony den HaanJune 14th, 2016 at %I:%M %p

lspci | grep -i usb| awk ‘{ print $1 }’ | while read ID;do ID=”0000:$ID”;DR=`find /sys/bus/pci/drivers/ -name $ID`;P=${DR%%$ID};echo -n $ID > $P/unbind;echo -n $ID > $P/bind;done

Leave a comment

Your comment

Time limit is exhausted. Please reload the CAPTCHA.