Have you checked the system log files?
I think I'd start with comparing the output of dmesg after a short hibernate to the one after a long hibernate. (In other words, compare a hibernate that "broke" the mouse/keyboard to one that didn't)
One good way to compare the output of two logfiles is sdiff in combination with cut:
Code:
sdiff <(dmesg | cut -d']' -f 2) <(cut -d']' -f 2 /var/log/dmesg.0) | less
The cut command elliminates the time column at the beginning so you can actually look for differences in the log output.
The above example compares the current dmesg to the old dmesg.0 in /var/log/messages which may not be exactly what you want. You probably want to go into hibernate, put the laptop back on and do a
Code:
dmesg | tail -n 100 > ~/dmesg.ok.txt
Then go into a long hibernate that breaks mouse / keyboard. If possible at all, connect to the machine via ssh from another machine so you can directly grep the syslog with
Code:
dmesg | tail -n 100 > ~/dmesg.bad.txt
If you can't do that you will produce more logging while closing the lid and opening it again to get the keyboard working again, so you'll probably want to tail a bit more of the dmesg output. Maybe you can strip the unwanted part at the end manually.
Anyhow, once you have your good and bad output you can do (untested)
Code:
sdiff <(cut -d']' -f 2 ~/dmesg.bad.txt) <(cut -d']' -f 2 ~/dmesg.ok.txt) | less