Re: USB devices dead after APM suspend on kernel 2.6.14-2-686
Paulo M C Aragão <yagpaulo-listas@yahoo.com> writes:
> I have Debian sid, kernel 2.6.14-2-686, installed on a Fujitsu
> Lifebook E342 laptop. When it comes back from APM suspend, the USB
> devices (a 4-port hub and a mouse) are not brought up
Paulo,
I've attached my /etc/apm/event.d/local file. You should be able to
simply drop it in place and edit the portions that don't apply to you
(like stop-networks and esd commands). You'll probably replace
uhci_hcd with ehci_hcd unless you've blacklisted ehci_hcd too.
--8<---------------cut here---------------start------------->8---
#! /bin/sh
# The ath_pci (used with the wireless network) and uhci_hcd (used with
# USB devices on docking station and Bluetooth) modules don't recover
# after suspending under 2.6 and udev. So, take down all networks upon
# suspend. Remove and insert uhci_hcd upon resume. The networking
# scripts will handle resetting the ath_pci module.
#
# Finally, esd gets hosed after a suspend and resume, so kill it
# before suspending and start it on resume. Starting it as wohler is
# ugly, but works.
#
# See apmd(8) for a description of the parameters passed to this script.
case "$1,$2" in
suspend,*)
stop-networks
killall esd
;;
resume,*)
modprobe -r uhci_hcd
modprobe uhci_hcd
su wohler esd &
;;
change,power)
#if [ `awk '{print $8}' /proc/apm` -gt 0 ]; then
# # Battery
# killall -STOP setiathome
#else
# # AC Power
# killall -CONT setiathome
#fi
;;
esac
exit 0
--8<---------------cut here---------------end--------------->8---
And stop-networks, which I put in /usr/local/sbin.
--8<---------------cut here---------------start------------->8---
#! /bin/sh
# Stop all normal networks.
networks=`ifconfig -s|egrep '(eth0|ath0|ppp0)'|awk '{print $1}'`
for i in $networks; do
echo "Stopping $i"
sudo ifdown --force $i
done
--8<---------------cut here---------------end--------------->8---
--
Bill Wohler <wohler@newt.com> http://www.newt.com/wohler/ GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.
Reply to: