Cannot suspend or hibernate Asus N61J Laptop
Recently got a new laptop for work, an Asus N61J, and I installed Ubuntu 9.10 on it. For whatever reason, the laptop will not suspend. I have no idea why, as it looks like it is going to, but ultimately dumps me back at the Unlock screen, as though I had just locked the computer, rather than suspending it.
However, it does kick me off my wireless network, so I think it *does* suspend, but only for a second or so.
Looking at /var/log/pm-suspend.log, I see
Code:
Initial commandline parameters:
Fri Apr 2 12:25:45 NZDT 2010: Running hooks for suspend.
/usr/lib/pm-utils/sleep.d/000record suspend suspend: success.
/usr/lib/pm-utils/sleep.d/00auto-quirk suspend suspend: Adding quirks from HAL: --quirk-dpms-on --quirk-dpms-suspend --quirk-vbe-post --quirk-vbemode-restore --quirk-vbestate-restore --quirk-vga-mode-3
success.
/usr/lib/pm-utils/sleep.d/00logging suspend suspend: Linux andrew-laptop 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12 04:38:19 UTC 2010 x86_64 GNU/Linux
Module Size Used by
tun 17056 2
nls_iso8859_1 5280 1
nls_cp437 6976 1
vfat 13184 1
fat 59832 1 vfat
cbc 4224 315
cryptd 8008 0
aes_x86_64 8992 318
aes_generic 28480 1 aes_x86_64
binfmt_misc 10220 1
ppdev 8232 0
bridge 56384 0
stp 3012 1 bridge
bnep 15168 2
dm_crypt 14888 0
usb_storage 66304 1
snd_hda_codec_atihdmi 4320 1
snd_hda_codec_realtek 277860 1
ipt_REJECT 3584 1
ipt_LOG 6404 1
xt_limit 3236 2
xt_tcpudp 3616 7
xt_state 2432 6
ipt_addrtype 2912 4
arc4 2144 2
ecb 3296 3
ath9k 278176 0
mac80211 210040 1 ath9k
ath 10304 1 ath9k
ip6table_filter 3968 1
ip6_tables 22608 1 ip6table_filter
nf_nat_irc 2688 0
nf_conntrack_irc 6552 1 nf_nat_irc
nf_nat_ftp 3584 0
nf_nat 22452 2 nf_nat_irc,nf_nat_ftp
nf_conntrack_ipv4 16376 8 nf_nat
nf_defrag_ipv4 2400 1 nf_conntrack_ipv4
snd_hda_intel 31880 2
snd_seq_dummy 3460 0
snd_hda_codec 87584 3 snd_hda_codec_atihdmi,snd_hda_codec_realtek,snd_hda_intel
nf_conntrack_ftp 9016 1 nf_nat_ftp
snd_hwdep 9352 1 snd_hda_codec
nf_conntrack 80800 7 xt_state,nf_nat_irc,nf_conntrack_irc,nf_nat_ftp,nf_nat,nf_conntrack_ipv4,nf_conntrack_ftp
snd_seq_oss 33440 0
iptable_filter 3872 1
snd_pcm_oss 44704 0
snd_seq_midi 8192 0
ip_tables 21200 1 iptable_filter
snd_mixer_oss 18976 1 snd_pcm_oss
snd_rawmidi 27296 1 snd_seq_midi
uvcvideo 65260 0
snd_pcm 93160 3 snd_hda_intel,snd_hda_codec,snd_pcm_oss
snd_seq_midi_event 8448 2 snd_seq_oss,snd_seq_midi
x_tables 25832 8 ipt_REJECT,ipt_LOG,xt_limit,xt_tcpudp,xt_state,ipt_addrtype,ip6_tables,ip_tables
snd_seq 60608 6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
videodev 43360 1 uvcvideo
v4l1_compat 16644 2 uvcvideo,videodev
v4l2_compat_ioctl32 13344 1 videodev
snd_timer 26992 2 snd_pcm,snd_seq
snd_seq_device 8308 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq
psmouse 57124 0
joydev 13088 0
serio_raw 6596 0
xhci 40772 0
btusb 14260 2
fglrx 2234552 32
snd 77096 16 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_seq_oss,snd_pcm_oss,snd_mixer_oss,snd_rawmidi,snd_pcm,snd_seq,snd_timer,snd_seq_device
atl1c 36516 0
cfg80211 109144 3 ath9k,mac80211,ath
soundcore 9088 1 snd
asus_laptop 21092 0
snd_page_alloc 10928 2 snd_hda_intel,snd_pcm
lp 11908 0
led_class 5256 2 ath9k,asus_laptop
parport 40528 2 ppdev,lp
video 23612 0
usbhid 43968 0
output 3680 1 video
total used free shared buffers cached
Mem: 3982980 1122480 2860500 0 54648 361724
-/+ buffers/cache: 706108 3276872
Swap: 11671180 0 11671180
success.
/usr/lib/pm-utils/sleep.d/00powersave suspend suspend: success.
/usr/lib/pm-utils/sleep.d/01PulseAudio suspend suspend: success.
/etc/pm/sleep.d/10_grub-common suspend suspend: success.
/etc/pm/sleep.d/10_unattended-upgrades-hibernate suspend suspend: success.
/usr/lib/pm-utils/sleep.d/49bluetooth suspend suspend: not applicable.
/usr/lib/pm-utils/sleep.d/55NetworkManager suspend suspend: success.
/usr/lib/pm-utils/sleep.d/75modules suspend suspend: success.
/usr/lib/pm-utils/sleep.d/90clock suspend suspend: not applicable.
/usr/lib/pm-utils/sleep.d/94cpufreq suspend suspend: success.
/usr/lib/pm-utils/sleep.d/95anacron suspend suspend: stop: Unknown instance:
success.
/usr/lib/pm-utils/sleep.d/95led suspend suspend: not applicable.
/usr/lib/pm-utils/sleep.d/96laptop-mode suspend suspend: success.
/usr/lib/pm-utils/sleep.d/98smart-kernel-video suspend suspend: success.
/usr/lib/pm-utils/sleep.d/99video suspend suspend: kernel.acpi_video_flags = 0
success.
/etc/pm/sleep.d/action_wpa suspend suspend: success.
Fri Apr 2 12:25:47 NZDT 2010: performing suspend
Fri Apr 2 12:25:53 NZDT 2010: Awake.
Fri Apr 2 12:25:53 NZDT 2010: Running hooks for resume
/etc/pm/sleep.d/action_wpa resume suspend: success.
/usr/lib/pm-utils/sleep.d/99video resume suspend: success.
/usr/lib/pm-utils/sleep.d/98smart-kernel-video resume suspend: success.
/usr/lib/pm-utils/sleep.d/96laptop-mode resume suspend: success.
/usr/lib/pm-utils/sleep.d/95led resume suspend: not applicable.
/usr/lib/pm-utils/sleep.d/95anacron resume suspend: success.
/usr/lib/pm-utils/sleep.d/94cpufreq resume suspend: success.
/usr/lib/pm-utils/sleep.d/90clock resume suspend: not applicable.
/usr/lib/pm-utils/sleep.d/75modules resume suspend: success.
/usr/lib/pm-utils/sleep.d/55NetworkManager resume suspend: success.
/usr/lib/pm-utils/sleep.d/49bluetooth resume suspend: not applicable.
/etc/pm/sleep.d/10_unattended-upgrades-hibernate resume suspend: success.
/etc/pm/sleep.d/10_grub-common resume suspend: success.
/usr/lib/pm-utils/sleep.d/01PulseAudio resume suspend: success.
/usr/lib/pm-utils/sleep.d/00powersave resume suspend: success.
/usr/lib/pm-utils/sleep.d/00logging resume suspend: success.
/usr/lib/pm-utils/sleep.d/00auto-quirk resume suspend: success.
/usr/lib/pm-utils/sleep.d/000record resume suspend: success.
Fri Apr 2 12:25:53 NZDT 2010: Finished.
The two important lines seem to be
Code:
Fri Apr 2 12:25:47 NZDT 2010: performing suspend
Fri Apr 2 12:25:53 NZDT 2010: Awake.
Which indicates that yes, it did suspend - for 6 seconds. Which isn't terribly useful.
Does anyone have any ideas on what's going wrong, and how can I fix it?
Is it possible the laptop is just a little too new, and is missing some hardware drivers or something?
For what its worth, I'm using the Proprietary ATi Drivers, but otherwise have a fairly clean install of Ubuntu 9.10.
EDIT: I'm running the 64bit Version of Ubuntu.
Re: Cannot suspend or hibernate Asus N61J Laptop
Little more information: It also, for some bizarre reason, unmutes my sound when it 'resumes' from suspend, which is kind of odd. Doesn't seem to touch anything else, though I think it may have killed or failed to restart my Open VPN process once. Testing again, that doesn't seem to be happening, so maybe I was just imagining it.
Re: Cannot suspend or hibernate Asus N61J Laptop
Ok, it would seem to be a problem with one of the internal USB devices - I disabled all external ports in the BIOS, and it suspended! Yay!
However, I can't selectively disable them one by one in the BIOS - it's an all or nothing thing. So I need to tell Ubuntu to either not load the drivers for this particular USB device, or to completely disable it or something. Trouble is, I'm not sure how to go about doing that. Suggestions would be strongly appreciated.
Re: Cannot suspend or hibernate Asus N61J Laptop
Ok, here's the output from /var/log/syslog regarding why it doesn't want to go to sleep:
Code:
Apr 3 19:49:08 andrew-laptop NetworkManager: <info> Sleeping...
Apr 3 19:49:08 andrew-laptop NetworkManager: <info> (wlan0): now unmanaged
Apr 3 19:49:08 andrew-laptop NetworkManager: <info> (wlan0): device state change: 8 -> 1 (reason 37)
Apr 3 19:49:08 andrew-laptop NetworkManager: <info> (wlan0): deactivating device (reason: 37).
Apr 3 19:49:08 andrew-laptop NetworkManager: <info> (wlan0): canceled DHCP transaction, dhcp client pid 2206
Apr 3 19:49:08 andrew-laptop kernel: [ 51.001203] wlan0: disassociating by local choice (reason=3)
Apr 3 19:49:08 andrew-laptop wpa_supplicant[1042]: CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Apr 3 19:49:08 andrew-laptop NetworkManager: <WARN> check_one_route(): (wlan0) error -34 returned from rtnl_route_del(): Sucess#012
Apr 3 19:49:08 andrew-laptop dnsmasq[1208]: reading /etc/resolv.conf
Apr 3 19:49:08 andrew-laptop dnsmasq[1208]: using nameserver 192.168.0.1#53
Apr 3 19:49:08 andrew-laptop avahi-daemon[873]: Withdrawing address record for 192.168.0.105 on wlan0.
Apr 3 19:49:08 andrew-laptop avahi-daemon[873]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.105.
Apr 3 19:49:08 andrew-laptop avahi-daemon[873]: Interface wlan0.IPv4 no longer relevant for mDNS.
Apr 3 19:49:08 andrew-laptop NetworkManager: <info> (wlan0): cleaning up...
Apr 3 19:49:08 andrew-laptop NetworkManager: <info> (wlan0): taking down device.
Apr 3 19:49:08 andrew-laptop wpa_supplicant[1042]: CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Apr 3 19:49:08 andrew-laptop kernel: [ 51.132498] wlan0: deauthenticating by local choice (reason=3)
Apr 3 19:49:08 andrew-laptop NetworkManager: <info> (eth0): now unmanaged
Apr 3 19:49:08 andrew-laptop NetworkManager: <info> (eth0): device state change: 2 -> 1 (reason 37)
Apr 3 19:49:08 andrew-laptop NetworkManager: <info> (eth0): cleaning up...
Apr 3 19:49:08 andrew-laptop NetworkManager: <info> (eth0): taking down device.
Apr 3 19:49:08 andrew-laptop avahi-daemon[873]: Withdrawing address record for fe80::225:d3ff:fece:c8c1 on wlan0.
Apr 3 19:49:10 andrew-laptop kernel: [ 52.929213] PM: Syncing filesystems ... done.
Apr 3 19:49:10 andrew-laptop kernel: [ 52.930188] PM: Preparing system for mem sleep
Apr 3 19:49:10 andrew-laptop kernel: [ 52.930191] Freezing user space processes ... (elapsed 0.00 seconds) done.
Apr 3 19:49:10 andrew-laptop kernel: [ 52.930589] Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
Apr 3 19:49:10 andrew-laptop kernel: [ 52.930624] PM: Entering mem sleep
Apr 3 19:49:10 andrew-laptop kernel: [ 52.930639] Suspending console(s) (use no_console_suspend to debug)
Apr 3 19:49:10 andrew-laptop kernel: [ 52.998478] pm_op(): usb_dev_suspend+0x0/0x10 returns -2
Apr 3 19:49:10 andrew-laptop kernel: [ 52.998487] PM: Device usb3 failed to suspend: error -2
Apr 3 19:49:10 andrew-laptop kernel: [ 52.998488] PM: Some devices failed to suspend
Apr 3 19:49:10 andrew-laptop kernel: [ 53.097539] PM: resume devices took 0.100 seconds
Apr 3 19:49:10 andrew-laptop kernel: [ 53.097756] PM: Finishing wakeup.
Apr 3 19:49:10 andrew-laptop kernel: [ 53.097758] Restarting tasks ... done.
As you can see, the lines
Code:
Apr 3 19:49:10 andrew-laptop kernel: [ 52.998478] pm_op(): usb_dev_suspend+0x0/0x10 returns -2
Apr 3 19:49:10 andrew-laptop kernel: [ 52.998487] PM: Device usb3 failed to suspend: error -2
Apr 3 19:49:10 andrew-laptop kernel: [ 52.998488] PM: Some devices failed to suspend
are what is causing the laptop to fail to suspend.
Output from lsusb:
Code:
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 13d3:5122 IMC Networks
Bus 001 Device 004: ID 0b05:1788 ASUSTek Computer, Inc.
Bus 001 Device 002: ID 8087:0020
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 004: ID 046d:c510 Logitech, Inc. Cordless Mouse
Bus 002 Device 002: ID 8087:0020
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Now, I'm not sure whether it's referring to bus 3, device 1 or bus 1 device 3 (I would assume bus 3, but I could be wrong).
Assuming it is Bus 3, then here is the sudo lusb -v output for it:
Code:
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 3
bMaxPacketSize0 9
idVendor 0x1d6b Linux Foundation
idProduct 0x0002 2.0 root hub
bcdDevice 2.06
iManufacturer 3 Linux 2.6.31-20-generic xhci_hcd
iProduct 2 xHCI Host Controller
iSerial 1 0000:07:00.0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 25
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 12
Hub Descriptor:
bLength 9
bDescriptorType 41
nNbrPorts 4
wHubCharacteristic 0x0009
Per-port power switching
Per-port overcurrent protection
TT think time 8 FS bits
bPwrOn2PwrGood 10 * 2 milli seconds
bHubContrCurrent 0 milli Ampere
DeviceRemovable 0x00
PortPwrCtrlMask 0xff
Hub Port Status:
Port 1: 0000.0100 power
Port 2: 0000.0100 power
Port 3: 0000.0100 power
Port 4: 0000.0100 power
Device Status: 0x0003
Self Powered
Remote Wakeup Enabled
What I would really like is some way to tell Linux that the USB Device(s) that are failing to suspend don't exist. I can't go into the case and unplug them, and I really, really would like to be able to suspend/hibernate this laptop.
As I said above, disabling all USB devices fixes this problem, but that in turn prevents me from using a USB keyboard and/or mouse, so that to is not an option.
Googling around, I can't seem to find any instructions for actually doing this, but it's possible I'm using the wrong search terms.
Re: Cannot suspend or hibernate Asus N61J Laptop
If anyone is reading this, this is just a quick reply because I'm hungry and tired, but it seems I was wrong (:O), and that usb3 may actually refer to USB 3.0.
Blacklisting the XHCI driver seems to support this theory, as things work differently when it tries to suspend or hibernate. Unfortunately, it still doesn't work but at least the behaviour is different!
Actually, Hibernate technically works. Very, very technically. Not something I'd use every day.
Hibernate spits out a bunch of messages when I select it, and starts eating the hard drive. Eventually it stops and does nothing else, leaving the text on the screen with a blinking underscore. If I manually power off and power back on, it does actually restore from the hibernate file! Only downside is my wireless doesn't like that (and I imagine there are a few other things that don't either), and it just seems like a really bad idea. But it does work.
Re: Cannot suspend or hibernate Asus N61J Laptop
On my HP 8540w I have created the following script
/etc/pm/sleep.d/05_xhci
The content of this file is
Code:
#!/bin/sh
# Fix some issues with USB3
if [ "$1" = "suspend" ]
then
modprobe -r xhci
fi
if [ "$1" = "resume" ]
then
modprobe xhci
fi
chmod 755 /etc/pm/sleep.d/05_xhci
And now I can use my USB3 devices and go in suspend mode.
(Perhaps you need to change the script to hibernate)
Note that I use Lucid, version 10.4 beta 2
Perhaps you'll need to store this file on a folder called suspend.d
Thank you for the tips helping me to understand the issue.
Regards
Gab
Re: Cannot suspend or hibernate Asus N61J Laptop
Hi ipsi,
I'm Brazilian, so my english....
I have the same problem of you with an Asus n71Jq-x1. I'm pretty sure you're succeed like me. I try with this versions of Ubuntu, and all worked fine:
* Ubuntu 9.10 64bits
* Ubuntu 10.4 R3 64bits
* Ubuntu Studio 10.4 R3 64bits
The problem is about the ehci builtin controller and xhci module.
The better solutions is to disable all devices that uses ehci_hcd from Kernel, and to unload module xhci, before suspend/hibernate. For the last, you can use the nuage6's solution, but I prefer to use the "config.d", as I describe in section 2. Another solution is to complete disable usb support in BIOS, but I guess you don't need to do this.
1. Unbind ehci_hcd from kernel:
First, verify what devices you need to unload from kernel. Simple list the directory "/sys/bus/pci/drivers/ehci_hcd/" and pick all devices id that has names like "0000:00:1a.0". You may have more than one device listed.
Code:
# ls /sys/bus/pci/drivers/ehci_hcd/
0000:00:1a.0 bind new_id uevent
0000:00:1d.0 module remove_id unbind
I picked "0000:00:1a.0" and "0000:00:1d.0".
Because newer version of Ubuntu came with ehci_hcd builtin kernel, you have to unbind all devices. For this, create a file "/etc/pm/sleep.d/20_custom-ehci_hcd", with the following content:
Code:
#!/bin/sh
# File: "/etc/pm/sleep.d/20_custom-ehci_hcd".
case "${1}" in
hibernate|suspend)
# Unbind ehci_hcd for first device XXXX:XX:XX.X:
echo -n "XXXX:XX:XX.X" | tee /sys/bus/pci/drivers/ehci_hcd/unbind
# Unbind ehci_hcd for second device XXXX:XX:XX.X:
echo -n "XXXX:XX:XX.X" | tee /sys/bus/pci/drivers/ehci_hcd/unbind
;;
resume|thaw)
# Bind ehci_hcd for first device XXXX:XX:XX.X:
echo -n "XXXX:XX:XX.X" | tee /sys/bus/pci/drivers/ehci_hcd/bind
# Bind ehci_hcd for second device XXXX:XX:XX.X:
echo -n "XXXX:XX:XX.X" | tee /sys/bus/pci/drivers/ehci_hcd/bind
;;
esac
Obs.: For this work for you, you have to substitue "XXXX:XX:XX.X" with your settings.
2. Unload modelue xhci (usb3):
Create a file "/etc/pm/config.d/usb3-suspend-workaround", with the following content:
Code:
#File: "/etc/pm/config.d/usb3-suspend-workaround".
SUSPEND_MODULES="xhci"
Done. Good luck!:P
Re: Cannot suspend or hibernate Asus N61J Laptop
Holy crap. That worked! Thanks a lot! That is going to make my life so, so much easier. Thus far everything works as expected after a resume, with the one (very minor!) annoyance that it unmutes my sound, and sets it to the lowest volume. Since I almost never use my work laptop for anything sound-related (not even IM notifications or anything), that's not actually a problem.
The only thing you missed in your instructions is that you need to make the "/etc/pm/sleep.d/20_custom-ehci_hcd" file executable (or, at least, I believe you do - the other files in that directory were), so it would be wise to execute the following command:
Code:
sudo chmod +x /etc/pm/sleep.d/20_custom-ehci_hcd
For others wondering, I just followed steps 1 & 2 in the above post, and everything worked.
Re: Cannot suspend or hibernate Asus N61J Laptop
AWESOME !! . thanks man !! ... i can confirm that this solution works also for Asus U30JC.
Re: Cannot suspend or hibernate Asus N61J Laptop
Works great for me too; don't forget to do the chmod step that ipsi said (Asus w5a here.)