Suspend to RAM doesn't recover

Hi,

I was tweaking my system and I discovered that the suspend to RAM recover partially.

First thing : laptop Acer Aspire nvidia GEForce 9600,4Gb RAM, openSUSE 11.3 KDE 4.5.4.

uname -r
2.6.34.7-0.5-desktop

Let me explain what happens. The suspend to RAM work, the laptop does suspend. Here’s the log :

cat /var/log/pm-suspend.log 
Initial commandline parameters: 
Wed Dec  8 21:08:02 EST 2010: Running hooks for hibernate.
/usr/lib/pm-utils/sleep.d/00logging hibernate hibernate:hibernate initiated: Wed Dec  8 21:08:02 EST 2010

Linux linux-gcjq.site 2.6.34.7-0.5-desktop #1 SMP PREEMPT 2010-10-25 08:40:12 +0200 x86_64 x86_64 x86_64 GNU/Linux
kernel command line: 'root=/dev/disk/by-id/ata-WDC_WD3200BEVT-22ZCT0_WD-WXE708KC8179-part8 resume=/dev/disk/by-id/ata-WDC_WD3200BEVT-22ZCT0_WD-WXE708KC8179-part7 splash=silent quiet nomodeset vga=0x314'
Module                  Size  Used by
cryptd                  9531  0 
aes_x86_64              8104  1 
aes_generic            27607  1 aes_x86_64
ip6t_LOG                5898  7 
xt_tcpudp               2859  6 
xt_pkttype              1288  3 
ipt_LOG                 6067  7 
xt_limit                2559  14 
af_packet              23229  4 
coretemp                6523  0 
snd_pcm_oss            53701  0 
snd_mixer_oss          19415  1 snd_pcm_oss
snd_seq                68137  0 
snd_seq_device          7834  1 snd_seq
edd                    10208  0 
nvidia              10227847  42 
cpufreq_conservative    12628  0 
cpufreq_userspace       3264  0 
cpufreq_powersave       1258  0 
acpi_cpufreq            8399  0 
mperf                   1523  1 acpi_cpufreq
ip6t_REJECT             4828  3 
nf_conntrack_ipv6      21550  4 
ip6table_raw            1627  1 
xt_NOTRACK              1192  4 
ipt_REJECT              2672  3 
xt_state                1618  8 
iptable_raw             1686  1                                                                                                                  
iptable_filter          1946  1                                                                                                                  
ip6table_mangle         2036  0 
nf_conntrack_netbios_ns     1854  0 
nf_conntrack_ipv4      10411  4 
nf_conntrack           89671  5 nf_conntrack_ipv6,xt_NOTRACK,xt_state,nf_conntrack_netbios_ns,nf_conntrack_ipv4
nf_defrag_ipv4          1673  1 nf_conntrack_ipv4
ip_tables              21698  2 iptable_raw,iptable_filter
ip6table_filter         1887  1 
ip6_tables             23320  4 ip6t_LOG,ip6table_raw,ip6table_mangle,ip6table_filter
x_tables               26644  16 ip6t_LOG,xt_tcpudp,xt_pkttype,ipt_LOG,xt_limit,ip6t_REJECT,ip6table_raw,xt_NOTRACK,ipt_REJECT,xt_state,iptable_raw,iptable_filter,ip6table_mangle,ip_tables,ip6table_filter,ip6_tables
fuse                   75897  3 
loop                   18524  0 
dm_mod                 86873  0 
snd_hda_codec_nvhdmi    17050  1 
arc4                    1601  2 
snd_hda_codec_realtek   324511  1 
ecb                     2495  2 
iwlagn                239568  0 
iwlcore               302209  1 iwlagn
snd_hda_intel          28621  2 
uvcvideo               68119  0 
snd_hda_codec         113249  3 snd_hda_codec_nvhdmi,snd_hda_codec_realtek,snd_hda_intel
snd_hwdep               8100  1 snd_hda_codec
mac80211              290644  2 iwlagn,iwlcore
videodev               43828  1 uvcvideo
v4l1_compat            17249  2 uvcvideo,videodev
snd_pcm               105589  3 snd_pcm_oss,snd_hda_intel,snd_hda_codec
snd_timer              26828  2 snd_seq,snd_pcm
v4l2_compat_ioctl32    11349  1 videodev
cfg80211              182851  3 iwlagn,iwlcore,mac80211
sg                     33348  0 
sr_mod                 16684  0 
cdrom                  43440  1 sr_mod
snd                    84444  15 snd_pcm_oss,snd_mixer_oss,snd_seq,snd_seq_device,snd_hda_codec_nvhdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
soundcore               9003  1 snd
atl1e                  41612  0 
rfkill                 21863  1 cfg80211
iTCO_wdt               12170  0 
iTCO_vendor_support     3150  1 iTCO_wdt
joydev                 11942  0 
pcspkr                  2222  0 
i2c_i801               11881  0 
serio_raw               5318  0 
snd_page_alloc          9569  2 snd_hda_intel,snd_pcm
video                  25256  0 
battery                12302  0 
intel_agp              34008  0 
ac                      4055  0 
wmi                     8750  0 
button                  6989  0 
ext4                  401916  2 
jbd2                  100410  1 ext4
crc16                   1715  1 ext4
sd_mod                 41436  6 
fan                     4559  0 
processor              45747  3 acpi_cpufreq
ahci                   42680  5 
libata                211449  1 ahci
scsi_mod              191748  4 sg,sr_mod,sd_mod,libata
thermal                20625  0 
thermal_sys            18230  4 video,fan,processor,thermal

             total       used       free     shared    buffers     cached
Mem:       4055884    1206000    2849884          0      35876     601672
-/+ buffers/cache:     568452    3487432
Swap:      6562516          0    6562516

success.
/usr/lib/pm-utils/sleep.d/00powersave hibernate hibernate:success.
/usr/lib/pm-utils/sleep.d/02rtcwake hibernate hibernate:rtcwake alarm not enabled in /etc/pm/config.d/rtcwake.config, doing nothing...
not applicable.
/usr/lib/pm-utils/sleep.d/06autofs hibernate hibernate:Shutting down automount ..done
success.
/usr/lib/pm-utils/sleep.d/30s2disk-check hibernate hibernate:INFO: checking for suspend-to-disk prerequisites...
  using userspace suspend method
  setting resume device to /dev/sda7
  setting image size to 1868951347
  adding these parameters from /etc/suspend.conf:
    splash = n
success.
/usr/lib/pm-utils/sleep.d/45pcmcia hibernate hibernate:ejecting PCMCIA cards...
success.
/usr/lib/pm-utils/sleep.d/49bluetooth hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/50rcnetwork hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/55NetworkManager hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/75modules hibernate hibernate:success.
/usr/lib/pm-utils/sleep.d/80acpi-fan hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/80videobios hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/90clock hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/94cpufreq hibernate hibernate:success.
/usr/lib/pm-utils/sleep.d/95led hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/95packagekit hibernate hibernate:success.
/usr/lib/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate:success.
/usr/lib/pm-utils/sleep.d/99Zgrub hibernate hibernate:INFO: running prepare-grub
  Skipping grub entry #1, because it has the noresume option
  running kernel is grub menu entry 0 (vmlinuz-2.6.34.7-0.5-desktop)
  preparing boot-loader: selecting entry 0, kernel /boot/2.6.34.7-0.5-desktop
  grub-once:   saving original /boot/grub/default
  running '/usr/sbin/grubonce 0'
Using entry #0: Desktop -- openSUSE 11.3 - 2.6.34.7-0.5
    time needed for sync: 0.5 seconds, time needed for grub: 0.0 seconds.
success.
/usr/lib/pm-utils/sleep.d/99info hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/99video hibernate hibernate:success.
Wed Dec  8 21:08:07 EST 2010: performing hibernate
INFO: using built-in quirks database from HAL.
INFO: S2RAM_OPTS from HAL quirks: ' '.
Wed Dec  8 21:09:34 EST 2010: Awake.
Wed Dec  8 21:09:34 EST 2010: Running hooks for thaw
/usr/lib/pm-utils/sleep.d/99video thaw hibernate:success.
/usr/lib/pm-utils/sleep.d/99info thaw hibernate:success.
/usr/lib/pm-utils/sleep.d/99Zgrub thaw hibernate:INFO: running grub-once-restore
  restoring original /boot/grub/default
success.
/usr/lib/pm-utils/sleep.d/98video-quirk-db-handler thaw hibernate:success.
/usr/lib/pm-utils/sleep.d/95packagekit thaw hibernate:method return sender=:1.76 -> dest=:1.75 reply_serial=2
success.
/usr/lib/pm-utils/sleep.d/95led thaw hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/94cpufreq thaw hibernate:success.
/usr/lib/pm-utils/sleep.d/90clock thaw hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/80videobios thaw hibernate:success.
/usr/lib/pm-utils/sleep.d/80acpi-fan thaw hibernate:kicking /proc/acpi/fan/FAN0/state off
success.
/usr/lib/pm-utils/sleep.d/75modules thaw hibernate:success.
/usr/lib/pm-utils/sleep.d/55NetworkManager thaw hibernate:method return sender=:1.7 -> dest=:1.78 reply_serial=2
success.
/usr/lib/pm-utils/sleep.d/50rcnetwork thaw hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/49bluetooth thaw hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/45pcmcia thaw hibernate:inserting PCMCIA cards...
success.
/usr/lib/pm-utils/sleep.d/30s2disk-check thaw hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/06autofs thaw hibernate:Shutting down automount ..done
Starting automount ..done
success.
/usr/lib/pm-utils/sleep.d/02rtcwake thaw hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/00powersave thaw hibernate:success.
/usr/lib/pm-utils/sleep.d/00logging thaw hibernate:success.
Wed Dec  8 21:09:35 EST 2010: Finished.

I recover partially though. That is, the desktop displays almost perfectly with some glitches here and there. The kmenu is accessible, but all the launchers in the panel don’t work. KDE throws a message stating : blablabla.desktop is nowhere to be found.

Tne networkmanager doesn’t respond and network doesn’t recover (it does recover when I hibernate).

When I logged out or reboot, a long list of messages displays and the session never shut down and the PC never reboot. Those messages are related to SATA somethning… Is there a log for that?

So, what’s up doc? :\ What should I do to make it work?

Have a read here
SDB:Pm-utils - openSUSE

SDB:Suspend to RAM - openSUSE

Hi caf4926,

Thanks for the readings. The problem is not that I cannot suspend to RAM. My system does it very well. The problem is getting out of this suspend. It resumes, I have no problem with video, no problem with backlight. I simply cannot get a network connection again and KDE is partially responsive.

As for PM-utils, do I have to create such a hook? I don’t know how and what to put in it?

On 2010-12-09 14:06, DaaX wrote:
>
> Hi caf4926,
>
> Thanks for the readings. The problem is not that I cannot suspend to
> RAM. My system does it very well. The problem is getting out of this
> suspend. It resumes, I have no problem with video, no problem with
> backlight. I simply cannot get a network connection again and KDE is
> partially responsive.

Disable splash screen (explained recently on another thread).

Try hibernate (to disk).

Try another user (new).

Try another desktop.

Try text mode.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Hi carlos,

I already disabled the splash screen as you suggested on other threads. :wink:

The hibernation goes without an itch. It hibernates and recover perfectly.

The problem is the sleep. It does go into sleep very well, but the desktop recovers perfectly, but is not responsive. The network too.

I will try another user and another DE.

In text mode, the command to sleep is what?

On 2010-12-10 23:06, DaaX wrote:
>
> Hi carlos,
>
> I already disabled the splash screen as you suggested on other threads.
> :wink:
>
> The hibernation goes without an itch. It hibernates and recover
> perfectly.
>

That’s typical. I don’t know why, but full suspend often works better than
suspend to ram. My laptop, for instance, gets a dead mouse in 11.2 (needs
reboot to recover), and an alive one in 11.3, but with other issues.

> The problem is the sleep. It does go into sleep very well, but the
> desktop recovers perfectly, but is not responsive. The network too.

You could perhaps disable the network manually, via a script. For the
network, I mean. Dunno, perhaps unload/reload the driver. Via hooks.

> I will try another user and another DE.
>
> In text mode, the command to sleep is what?

That will be pm-something. Let me see… here:

Telcontar:~ # pm-[TAB][TAB]
pm-hibernate pm-is-supported pm-powersave pm-profiler
pm-suspend pm-suspend-hybrid

So, pm-suspend. There is another command that also works as user, what was
it…? Ah, “powersave -U” is hibernate, suspend must be another option. Ah,
lowercase -u.

And there is another pair of commands, s2ram, s2disk. As root. But if I
recall correctly, those two do not run any preparation scripts, they do the
final call. Again, IIRC :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

I read this document, but I am not sure what to do with it. They’re talking about hooks.

The concept is quite easy:

* The main script pm-action (called via symlinks as either pm-suspend, pm-hibernate or pm-suspend-hybrid) executes so-called "hooks", executable scripts, in the alphabetical sorted order with the parameter suspend (suspend to RAM) or hibernate (suspend to disk).
* Once all hooks are done, it puts the machine to sleep. After the machine has woken up again, all those hooks are executed in reverse order with the parameter resume (resume from RAM) or thaw (resume from disk).
* The hooks do various stuff, for example preparing the bootloader, stopping the bluetooth subsystem or unloading of critical modules. 

How do I prgram such hooks?

On 2010-12-11 02:06, DaaX wrote:

> How do I prgram such hooks?

Ill post an example of mine, it is not that difficult. I’m not sure if we
are talking of the same (haven’t read that document recently), so… But i
know what you need to know :slight_smile:

In /etc/pm there are three directories, one for scripts. That’s the place.
The system scripts are in /usr/lib/pm-utils, and in
/usr/share/doc/packages/pm-utils/examples/hooks/ you have examples.

In /etc/pm/sleep.d/ -> I have 0cosas - that’s 0things. The “0” means that
it is the first one run. It is not a symlink, but a real file.

(Mentally omit the preceding "> " - checking a hack with thunderbird to
force non wrapping of lines)
Code:

>
> #!/bin/bash
>
> . /usr/lib/pm-utils/functions
>
>
> function Router ()
> {
> sleep 20
> /home/cer/bin/router_askandlogrouterip
> }
>
> case “$1” in
> hibernate|suspend)
> /bin/logger -t pm-utils -p syslog.warn “Hibernating (0)…”
> ;;
> thaw|resume)
> /bin/logger -t pm-utils -p syslog.warn “Thawing (0)…”
> Router &
> ;;
> *)
> ;;
> esac
>
> exit $?

You see it is a simple case with four entries: hibernate, suspend, thaw,
resume. Ie, ram or disk, sleeping or awakening. The logger entry is a call
to syslog to note the moment where hibernation starts and finishes -
although it might actually be written after the system returns. I’m not
sure. The router call on restoring is a script that logs the current IP I
get from my ISP. It is not currently working, but I leave it as an example.
The /usr/lib/pm-utils/functions line is necesary, I understand.

I have a “hook” that aborts hibernation if an external nfs mount is active:
it will crash the kernel. Wrote a bugzilla about this. I have another,
90clock, copied from the examples, that restores the clock from the cmos
clock and restart ntpd.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

What are you doing here? You dump something in this directory?

>
> case “$1” in
> hibernate|suspend)
> /bin/logger -t pm-utils -p syslog.warn “Hibernating (0)…”
> ;;
> thaw|resume)
> /bin/logger -t pm-utils -p syslog.warn “Thawing (0)…”
> Router &
> ;;
> *)
> ;;
> esac
>
> exit $?

You see it is a simple case with four entries: hibernate, suspend, thaw,
resume. Ie, ram or disk, sleeping or awakening. The logger entry is a call
to syslog to note the moment where hibernation starts and finishes -
although it might actually be written after the system returns. I’m not
sure. The router call on restoring is a script that logs the current IP I
get from my ISP. It is not currently working, but I leave it as an example.
The /usr/lib/pm-utils/functions line is necesary, I understand.

I have a “hook” that aborts hibernation if an external nfs mount is active:
it will crash the kernel. Wrote a bugzilla about this. I have another,
90clock, copied from the examples, that restores the clock from the cmos
clock and restart ntpd.

Ok, can I try this script on my system as it is (except for the line where you state your directory of course)?

On 2010-12-11 04:06, DaaX wrote:
>
> robin_listas;2264618 Wrote:

>>> function Router ()
>>> {
>>> sleep 20
>>> /home/cer/bin/router_askandlogrouterip
>>> }
>>
> What are you doing here? You dump something in this directory?

No, that’s a function where, after a wait of 20 seconds, I call a local
script that logs my IP. You don’t need that all, it was left as an example.

You see that the call to it has an “&” at the end. This way, when the
computer resumes, the call is made and the hook exits, but the call to the
external script actually runs 20 seconds later, giving time for the
computer to really resume and for the router to boot.

> Ok, can I try this script on my system as it is (except for the line
> where you state your directory of course)?

Yes, of course. Just remove the function “Router” and the call to it in the
resume section.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)