Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I had a problem with my Ubuntu 12.04 waking up immediately after going into suspend. I solved the problem by changing the settings in /proc/acpi/wakeup, as suggested in this question: How do I prevent immediate wake up from suspend?.

After changing the settings, the system goes flawlessly into suspend and stays suspended, but after I wake it back up, the settings in /proc/acpi/wakeup are different from what I set them to.

Before going to suspend:

cat /proc/acpi/wakeup
Device  S-state   Status   Sysfs node
SMB0      S4    *disabled  pci:0000:00:03.2
PBB0      S4    *disabled  pci:0000:00:09.0
HDAC      S4    *disabled  pci:0000:00:08.0
XVR0      S4    *disabled  pci:0000:00:0c.0
XVR1      S4    *disabled  
P0P5      S4    *disabled  
P0P6      S4    *disabled  pci:0000:00:15.0
GLAN      S4    *enabled   pci:0000:03:00.0
P0P7      S4    *disabled  pci:0000:00:16.0
P0P8      S4    *disabled  
P0P9      S4    *disabled  
USB0      S3    *disabled  pci:0000:00:04.0
USB2      S3    *disabled  pci:0000:00:04.1
US15      S3    *disabled  pci:0000:00:06.0
US12      S3    *disabled  pci:0000:00:06.1
PWRB      S4    *enabled   
SLPB      S4    *enabled

I tell the system to suspend, and it works as it should. But later after waking it up, the settings are changed to either:

USB0      S3    *disabled  pci:0000:00:04.0
USB2      S3    *enabled   pci:0000:00:04.1
US15      S3    *disabled  pci:0000:00:06.0
US12      S3    *enabled   pci:0000:00:06.1

or

USB0      S3    *enabled   pci:0000:00:04.0
USB2      S3    *enabled   pci:0000:00:04.1
US15      S3    *enabled   pci:0000:00:06.0
US12      S3    *enabled   pci:0000:00:06.1

Any ideas?


Thank you for your response. Unfortunately it did not solve my problem.

all of

/sys/bus/usb/devices/usb1/power/wakeup
/sys/bus/usb/devices/usb2/power/wakeup
/sys/bus/usb/devices/usb3/power/wakeup
/sys/bus/usb/devices/usb4/power/wakeup

as well as

/sys/bus/usb/devices/3-1/power/wakeup

are set to disabled, and the notebook still wakes up by itself right after going to sleep. The only thing it seems to react to are the settings in /proc/acpi/wakeup, which keep changing (resetting) every time i power off/restart my notebook.

share|improve this question

2 Answers 2

Perhaps http://forum.xbmc.org/showthread.php?tid=121158 will help?

This is what it says:

For those who are updating to the 3.2 kernel (which should be everyone due to the recent root exploit), you'll notice your USB wakeup is probably broken. They changed the default wakeup policy (http://www.spinics.net/lists/linux-usb/msg53661.html), so you'll need to make a couple of changes:

  • you no longer need to enable wakeup in /proc/acpi/wakeup, it's enabled by default
  • you need to enable wakeup for the USB hub in addition to the device in /sys/bus/usb/devices/*/power/wakeup

So, this:

echo USB1 > /proc/acpi/wakeup
echo enabled > /sys/bus/usb/devices/3-1/power/wakeup

Becomes:

echo enabled > /sys/bus/usb/devices/usb3/power/wakeup
echo enabled > /sys/bus/usb/devices/3-1/power/wakeup

Hopefully this saves others from troubleshooting the same problem.

share|improve this answer

I ran into this problem again on Ubuntu 12.10. The suggestions from user MTS unfortunately also did not work for me. However, you can write a script to automatically set the usb properties in /proc/acpi/wakeup right before every suspend.

The solution is based on creating a suspend hook (based on this Archwiki article). Save the following as /usr/lib/pm-utils/sleep.d/45fixusbwakeup, and make sure to make it executable (chmod +x /usr/lib/pm-utils/sleep.d/45fixusbwakeup).

#!/bin/bash
case $1 in
    hibernate)
            echo "Going to suspend to disk!"
            ;;
    suspend)
            echo "Fixing acpi settings."
            for usb in `cat /proc/acpi/wakeup | grep USB | cut -f1`;
            do
                    state=`cat /proc/acpi/wakeup | grep $usb | cut -f3 | cut -d' ' -f1 | tr -d '*'`
                    echo "device = $usb, state = $state"
                    if [ "$state" == "enabled" ]
                    then
                            echo $usb > /proc/acpi/wakeup
                    fi
            done
            echo "Suspending to RAM."
            ;;
    thaw)
            echo "Suspend to disk is now over!"
            ;;
    resume)
            echo "We are now resuming."
            ;;
    *)
            echo "Somebody is callin me totally wrong."
            ;;
esac

What this does is change the status of every USB device that is currently enabled to disabled. If you only want to change specific USB devices, change the for loop in the script. For example to change only USB1 and USB3 change

for usb in `cat /proc/acpi/wakeup | grep USB | cut -f1`;

to

for usb in 'USB1' 'USB3';

Hopefully this helps someone else who has the same problem. This approach solved the issue for me.

share|improve this answer
    
Thanks! I modified this script to disable wakup from USB devices on my Sony Vaio laptop: gist.github.com/rutsky/1ed8e9779f0b2941c5a6 –  Vladimir Rutsky Jun 8 at 19:26
    
I modified your script to disable wakeup on LID open (really stupid and annoying feature from my point of view). Thank you! –  gumkins Jul 5 at 22:09

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.