Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

From time to time opensuse 12.3 starts to wake up from sleep immediately. I have created a service in /etc/init.d be able to wake up from keyboard and mouse with the following code:

echo enabled > /sys/bus/usb/devices/usb5/power/wakeup
echo enabled > /sys/bus/usb/devices/5-1/power/wakeup
echo enabled > /sys/bus/usb/devices/5-2/power/wakeup

I've also added this option in grub:

usbcore.autosuspend=-1

I have nvidia card with 319.32 drivers installed. Most of the time going to sleep and resuming works fine, but after some period of time it just keeps waking up immediately and only rebooting the system helps.

share|improve this question
add comment

1 Answer

Copy this script in:

/etc/pm/sleep.d/10unbindusb

and make it executable.

# Revision: 21.12.2009
# Author: Sandro Mani


function unbind_usb {
    for driver in ehci ohci uhci; do
        cd "/sys/bus/pci/drivers/${driver}_hcd";
        ids=$(ls | grep :);
        echo $ids > /tmp/DISABLED_$driver;
        for id in $ids; do
            echo -n "$id" > unbind;
        done;
    done;
}

function bind_usb {
    for driver in ehci ohci uhci; do
        cd "/sys/bus/pci/drivers/${driver}_hcd";
        for id in $(cat /tmp/DISABLED_$driver); do
            echo -n "$id" > bind;
        done;
        rm /tmp/DISABLED_$driver;
    done;
}


case "$1" in
    hibernate|suspend)
        unbind_usb;
    ;;
    thaw|resume)
        bind_usb;
    ;;
    *)
    exit 1;
    ;;
esac;
exit 0;

http://ubuntuforums.org/showthread.php?t=1168204

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.