usb mouse dead on resume

Asked by garyr on 2011-05-02

New with Natty Narwahl is that the usb mouse frequently does not work coming back from the screensaver or suspend. Unplugging and replugging it works to bring it back to life. Has also happened once or twice with usb keyboard, but never both at the same time.

sudo usb-devices

T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 6
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0002 Rev=02.06
S: Manufacturer=Linux 2.6.38-8-generic ehci_hcd
S: Product=EHCI Host Controller
S: SerialNumber=0000:00:12.2
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub

T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 6
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0002 Rev=02.06
S: Manufacturer=Linux 2.6.38-8-generic ehci_hcd
S: Product=EHCI Host Controller
S: SerialNumber=0000:00:13.2
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub

T: Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 3
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0001 Rev=02.06
S: Manufacturer=Linux 2.6.38-8-generic ohci_hcd
S: Product=OHCI Host Controller
S: SerialNumber=0000:00:12.0
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub

T: Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 3
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0001 Rev=02.06
S: Manufacturer=Linux 2.6.38-8-generic ohci_hcd
S: Product=OHCI Host Controller
S: SerialNumber=0000:00:12.1
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub

T: Bus=04 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 2 Spd=12 MxCh= 4
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0451 ProdID=1446 Rev=01.10
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub

T: Bus=04 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=045e ProdID=00dd Rev=01.73
S: Manufacturer=Microsoft
S: Product=Comfort Curve Keyboard 2000
C: #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=01 Driver=usbhid
I: If#= 1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid

T: Bus=04 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#= 6 Spd=1.5 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=045e ProdID=0040 Rev=03.00
S: Manufacturer=Microsoft
S: Product=Microsoft 3-Button Mouse with IntelliEye(TM)
C: #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbhid

T: Bus=04 Lev=02 Prnt=02 Port=03 Cnt=03 Dev#= 5 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=ff(vend.) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1385 ProdID=5f01 Rev=00.01
S: Manufacturer=Atheros Communications Inc
S: Product=WPN111
S: SerialNumber=1.0
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 4 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)

T: Bus=05 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 3
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0001 Rev=02.06
S: Manufacturer=Linux 2.6.38-8-generic ohci_hcd
S: Product=OHCI Host Controller
S: SerialNumber=0000:00:13.0
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub

T: Bus=06 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 3
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0001 Rev=02.06
S: Manufacturer=Linux 2.6.38-8-generic ohci_hcd
S: Product=OHCI Host Controller
S: SerialNumber=0000:00:13.1
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub

T: Bus=07 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0001 Rev=02.06
S: Manufacturer=Linux 2.6.38-8-generic ohci_hcd
S: Product=OHCI Host Controller
S: SerialNumber=0000:00:14.5
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu acpi Edit question
Assignee:
No assignee Edit question
Solved by:
garyr
Solved:
2011-05-06
Last query:
2011-05-06
Last reply:
2011-05-06

Can you give the output of:

lsusb

When the mouse works.
Thanks

garyr (garyrich) said : #2

lsusb
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 008: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical
Bus 004 Device 005: ID 1385:5f01 Netgear, Inc WPN111 (no firmware)
Bus 004 Device 003: ID 045e:00dd Microsoft Corp. Comfort Curve Keyboard 2000 V1.0
Bus 004 Device 002: ID 0451:1446 Texas Instruments, Inc. TUSB2040/2070 Hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

ok and the output of:

lsmod

This will be long

garyr (garyrich) said : #4

Possibly related, coming back from screensaver or suspend I'm also seeing 3 of the cores on my Phenon II X4 inactive. sometimes they come online in a few seconds, sometimes cores 2-4 show a flatline in System Monitor and sometimes it only shows one core in /proc/cpuinfo

Anyway, here's lsmod, it's not that long:

Module Size Used by
snd_hrtimer 12784 1
binfmt_misc 17565 1
ipmi_devintf 17747 0
ibmaem 18133 0
ibmpex 13328 0
ipmi_msghandler 45498 3 ipmi_devintf,ibmaem,ibmpex
parport_pc 36959 0
ppdev 17113 0
vesafb 13761 1
snd_hda_codec_hdmi 28103 1
snd_hda_codec_via 62470 1
fglrx 2739144 66
snd_hda_intel 33211 1
snd_hda_codec 103804 3 snd_hda_codec_hdmi,snd_hda_codec_via,snd_hda_intel
snd_hwdep 13604 1 snd_hda_codec
snd_seq_midi 13324 0
hwmon_vid 12746 0
edac_core 53845 0
snd_rawmidi 30486 1 snd_seq_midi
snd_pcm 96625 3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
asus_atk0110 17976 0
psmouse 73535 0
snd_seq_midi_event 14899 1 snd_seq_midi
shpchp 37297 0
sp5100_tco 13744 0
serio_raw 13166 0
edac_mce_amd 23464 0
k10temp 13119 0
i2c_piix4 13303 0
lp 17825 0
snd_seq 61621 3 snd_seq_midi,snd_seq_midi_event
joydev 17606 0
snd_timer 29602 3 snd_hrtimer,snd_pcm,snd_seq
snd_seq_device 14462 3 snd_seq_midi,snd_rawmidi,snd_seq
snd 67382 13 snd_hda_codec_hdmi,snd_hda_codec_via,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_rawmidi,snd_pcm,snd_seq,snd_timer,snd_seq_device
soundcore 12680 1 snd
snd_page_alloc 18529 2 snd_hda_intel,snd_pcm
parport 46458 3 parport_pc,ppdev,lp
usbhid 46956 0
hid 91020 1 usbhid
firewire_ohci 40370 0
atl1e 37715 0
firewire_core 62646 1 firewire_ohci
ahci 25951 3
crc_itu_t 12707 1 firewire_core
pata_atiixp 13165 0
libahci 26642 1 ahci

on resume. If you run:

sudo modprobe -r psmouse; sleep 3; sudo modprobe psmouse

Does it work?

garyr (garyrich) said : #6

Curiouser and curiouser. The two are related. Back from screensaver CPU core #1 is at 100% and 2-4 are flat lined. They stay that until I unplug and replug the USB mouse.

garyr (garyrich) said : #7

Yes, that does work. Mouse works and CPU cores return to nominal values. I assume modprobe is triggered when I replug the mouse in anyway. As a workaround I could add it to the script that runs on resume, but that doesn't really fix the problem for the next guy.

FWIW, I could have replied a bit sooner but I found that doing "lock screen" to bring up the screensaver does not replicate the problem. It needs to do it on its own so I had to go away for a bit.

Wait - I spoke too soon. While I was typing this the mouse froze and the CPU cores went wrong. It's never done that while I was using it before. Modprobe did return things to normal, for now.

I found a similar report from someone back in '09 on Hardy, but this just started on upgrade to Natty.

no it's not. You need to make that command run when you resume the OS. I am too tired to advise more but there are guides around on how to make this kind of stuff happen

garyr (garyrich) said : #9

?? non sequitur. "it's not"what? Certainly "making that kind of stuff happen" when the OS resumes is trivial. But...it..should..not..do..that. It's a Steve Ballmer kind of answer, if that was acceptable we would all be running Vista or MS "Bob". Tired is as tired does but ask yorself tomorrow - is good enough; good enough?

garyr (garyrich) said : #10

And now I have only one CPU core running despite modprobe and plugging/unplugging the USB and cpuinfo reports "cpu cores : 1" If I reboot it will probably return to normal - maybe. Is the Ubuntu new motto "just reboot several times a day and stuff will probably be kinda almost OK, or at least as good as Visa"?

Obviously for me personally the easiest thing to do is trash Natty and revert to Maverick, but who really thinks that's a perfect solution? Anyone?? Ballmer????

ok you have logged a bug but there is a VERY simple workaround. You can add items for the system to run when it wakes up. Your hardware clearly dislikes being hibernated under Ubuntu so you need to take extra steps.

If you run:

gksudo gedit /usr/bin/fixmouse; sudo chmod +x /usr/bin/fixmouse

add these 2 lines:

#!/bin/bash
modprobe -r psmouse; sleep 2; modprobe psmouse

Save the new file, close gedit and you now have the command 'fixmouse' which will fix the issue. All we need to do is add the command to the wake up instructions and it will work, simple stuff isn't it..

If you now run:

gksudo gedit /etc/pm/sleep.d/10_mouse; sudo chmod +x /etc/pm/sleep.d/10_mouse

add the below code:

#!/bin/sh
# Tell mouse to reload

case "$1" in
 resume|thaw)
  fixmouse
  ;;
esac

save the new file and close gedit, reboot then hibernate to test.

garyr (garyrich) said : #12

Thanks for the workaround. So far it works as well as unplugging the mouse (and is as you say, just as simple) and you saved me 15 minutes in figuring out where the sleep/wake scripts are stored.

still, in a perfect world, it really should be fixed. It's not an obscure piece of hardware, so it may happen to many others. It's a common Asus AM3 motherboard (M4A78T-E). It is indeed not a perfect hibernater - the auto wake system test fails and maybe 5% of the time it crashes on wakeup in the morning. AT least now there's somethng in place for the next person googling for it.

Definitely. This question is linked to your bug too so people will find it. Companies give a lot less love to Linux so you'll get issues like this. Some hardware works great, some not-so great but Linux is getting more attention and developers are no supporting Linux where they once refused to (Like ATi and Broadcom)

garyr (garyrich) said : #14

I found out that running cpufreq-info restarts cores 2-4 and also restarts the mouse. Since modprobe does not always restart the cores I may add cpufreq-info to the sleep.d scripts in addition to or instead of modprobe