resume from "suspend to ram" fails

Hi,
I recently moved from openSUSE 13.2 to Tumbleweed on a Fujitsu Siemens E8010 (older than 10 years) laptop.
Now, I find that I can put the machine in hibernation and restart OK, but when I suspend to RAM and try to resume, I only get a black screen. The system is still active, for example, I can issue a “shutdown -h now” from a remote machine through the network interface, but the screen remains black.
In 13.2 and earlier, there was a configuration file for pm utilities, /etc/pm/config.d/config, where S2RAM_OPTS could be set (and I needed “-f -a3” to work properly). But now I read that the pm-utils were abandoned in more recent openSUSE versions. So, I am not sure where to put the parameters that are needed for this hardware to work.
I found on the present machine a file “/usr/lib/pm-utils/sleep.d/49tlp” which points me to tlp functions to “handle suspend/hibernate/resume tasks”. I guess that could be a solution, but the tlp service is not activated. Also, I find various man pages for systemd-sleep and similar command and related config files, but these commands and files are missing.
Can anyone advise if the activation of the tlp service is OK, an if this is expected to help with the problem. Are there any additional installation steps and/or parameters to be considered?

Thanks and best regards

Yes, systemd is responsible for suspend/resume functions now. This archlinux thread might be the basis of a working systemd-based solution for you as well. It involves the creation of two .service files, one to invoke “sysctl -w kernel.acpi_video_flags=3”, and the other to suspend with “echo mem > /sys/power/state”, which will automate the steps required to suspend in a manner suitable for the ATI graphics hardware (based on what I read in that thread).

Anyway, you can try this manually via a terminal (as root) with

sysctl -w kernel.acpi_video_flags=3
echo mem > /sys/power/state

If this works for you you can proceed with implementing the above.

I tried the sequence. Suspend is OK, but when the machine resumes, I get some random graphics on the screen (colored rectangles and similar), no password prompt as I would expect.
Is there something else to be changed or added?

Some users have found various kernel parameters help. Further reading/experimentation required. For example, this bug report
https://bugs.freedesktop.org/show_bug.cgi?id=42960
suggests some users found success using

acpi_sleep=s3_bios

but it will depend on your hardware.

More options documented here
https://www.kernel.org/doc/Documentation/power/video.txt

Hopefully, others with ATI experience can chime in here.

Yes, indeed, this seems to be a complex issue. I found some hint at

tr.opensuse.org/S2ram

regarding the use of the framebuffer. It is suggested to switch the framebuffer off with

vga=0

. In combination with setting the kernel.apci_video_flags to 3 this seems to work. To integrate into the boot process, I did the following:

In /etc/default/grub, I added

GRUB_GFXPAYLOAD_LINUX=vga=0

and I added the apci flags to the end of the command line by

apci_sleep=s3_bios,s3_mode

Then, after saving the previous grub config file (/boot/grub2/grub.conf), I ran

grub2_mkconfig -o /boot/grub2/grub.cfg

to generate the new configuration file, for which the default entry in its relevant parts now looks like


menuentry 'openSUSE Tumbleweed'  --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-e9bb12ea-170d-4bf3-aa2d-da9d4c4c10e1' {
    load_video
    set gfxpayload=vga=0

    echo    'Loading Linux 4.9.0-2-default ...'
    linux    /vmlinuz-4.9.0-2-default root=/dev/mapper/system-root  ${extra_cmdline} resume=/dev/system/swap splash=silent quiet showopts nomodeset acpi_sleep=s3_bios,s3_mode

}

After reboot suspend/resume works fine.
The only problem is that caused by switching off the framebuffer makes the boot process look quite ugly on screen (large font, flickering), but this is certainly a minor side effect. It is more dramatic that also a text console (Alt-F2) now comes with this ugly font and not much text is displayed on the screen.
Is there anything to do about that?

Thanks for the helpup to now and best regards.

That doesn’t look right to me. Refer to this reference for permitted settings

After reboot suspend/resume works fine.

That’s a good sign, but probably due to the ACPI parameters added?

The only problem is that caused by switching off the framebuffer makes the boot process look quite ugly on screen (large font, flickering), but this is certainly a minor side effect. It is more dramatic that also a text console (Alt-F2) now comes with this ugly font and not much text is displayed on the screen.
Is there anything to do about that?

I’ll leave others to offer guidance here.

Thanks for the helpup to now and best regards.

Glad to be of assistance.

BTW, I just noticed the ‘nomodeset’ parameter you have added. That will prevent the radeon driver from loading.

To respond to your comments about the parameters I use on the kernel command line and before, maybe some additional pieces of information:

(1) I use nomodeset [FONT=arial]to avoid booting into a black screen - no display manager; without this parameter I am not able to log in except into a text console. With the parameter everything is OK.

(2) Indeed I need both, the [FONT=courier new]acpi_sleep parameter, and vga=0. Only one of these does not work.

(3) As I said, I found a comment on switching off the framebuffer with vga=0 in here:

https://tr.opensuse.org/S2ram

. First I put this on the command line together with nomodeset and acpi_sleep, but this produced an informative message “text is deprecated. use set gfxpayload=vga=0 before linux command instead”. So this is what I did. The message is no longer displayed.
I also read the grub manual page

https://www.gnu.org/software/grub/manual/html_node/gfxpayload.html#gfxpayload

. So, what is the correct way to set the vga parameter to “0”?

[/FONT][/FONT]By the way, the KInfoCenter tells me that I have a[FONT=arial]n “Intel Corporation 82852/855GM Integrated Graphics Device”[/FONT] if tha information is of additional value.

[FONT=arial]
That just means a KMS won’t be loaded. If you’re happy using a basic framebuffer driver then there is no problem, but graphics performance will be limited. You can check /var/log/Xorg.0.log for more details about that.

This might help determine what was eventually loaded…

cat /var/log/Xorg.0.log |egrep 'load|LoadModule'

(2) Indeed I need both, the [FONT=courier new]acpi_sleep parameter, and vga=0. Only one of these does not work.

(3) As I said, I found a comment on switching off the framebuffer with vga=0 in here:

https://tr.opensuse.org/S2ram

. First I put this on the command line together with nomodeset and acpi_sleep, but this produced an informative message “text is deprecated. use set gfxpayload=vga=0 before linux command instead”. So this is what I did. The message is no longer displayed.
I also read the grub manual page

https://www.gnu.org/software/grub/manual/html_node/gfxpayload.html#gfxpayload

. So, what is the correct way to set the vga parameter to “0”?

I don’t know what ‘vga=0’ is really supposed to do. It is is a deprecated parameter and not used with grub2. Instead, the GRUB_GFXMODE and GRUB_GFXPAYLOAD_LINUX variables are set in /etc/default/grub, with appropriate variables. So, why I don’t deny that what you did is working, it might just be defaulting to something else (eg ‘auto’). Valid settings are documented here…

[/FONT][/FONT]

By the way, the KInfoCenter tells me that I have a[FONT=arial]n “Intel Corporation 82852/855GM Integrated Graphics Device”[/FONT] if tha information is of additional value.

That tells very little.

These commands can provide a little more info (especially with respect to chipset details)

/usr/sbin/hwinfo --gfxcard
lspci -nnk |grep '\03' -A3

Dear deano_ferrari,

thanks for your help again … my understanding of the boot process is limited and I appreciate explanations and certainly I would like to understand what is going on here. So, I’ll give some more information here, and maybe we can find out.
It seems that there are now two issues, which may or may not be related.

The first is the use of nomodeset [FONT=arial]as a kernel parameter. I am using this following many comments in the openSUSE forums if the boot process leads to a black screen (i.e. no display manager, or - if a user is set to autologin - no desktop), only text console can be used with Alt-F2. Using the parameter I can avaoid this problem and boot proceeds to display manager or desktop. X graphics work fine after booting.
Here is the output from the Xorg.0.log:


/home/bs> cat /var/log/Xorg.0.log | egrep 'load|LoadModule'
   115.857] (II) LoadModule: "glx"
   116.285] (II) LoadModule: "intel"
   116.469] (II) LoadModule: "modesetting"
   116.491] (II) LoadModule: "fbdev"
   116.516] (II) LoadModule: "vesa"
   118.664] intel: waited 2020 ms for i915.ko driver to load
   118.704] (II) LoadModule: "fbdevhw"
   118.715] (II) UnloadModule: "modesetting"
   118.716] (II) LoadModule: "fb"
   118.721] (II) LoadModule: "shadow"
   118.732] (II) UnloadModule: "vesa"
   118.732] (II) Unloading vesa
   123.697] (II) LoadModule: "libinput"

Could it be of interest to see the output when [FONT=courier new]nomodeset is not used?
[/FONT][/FONT]
The second problem is the unability to resume from a suspend to RAM, which I try to resolve with the vga=0 setting (see tr.opensuse/org/S2ram). For testing purposes, I use the editor invoked on the screen where I can select the various boot options, and add whatever is to be tested to the linux command line.
The default configuration from /boot/grubs/grub.cfg is:

menuentry 'openSUSE Tumbleweed'  --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-e9bb12ea-170d-4bf3-aa2d-da9d4c4c10e1' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if  x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos1' --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  9742d1ff-3241-4c88-98e6-5bb300701d60
    else
      search --no-floppy --fs-uuid --set=root 9742d1ff-3241-4c88-98e6-5bb300701d60
    fi
    echo    'Loading Linux 4.9.0-2-default ...'
    linux    /vmlinuz-4.9.0-2-default root=/dev/mapper/system-root  ${extra_cmdline} resume=/dev/system/swap splash=silent quiet showopts nomodeset acpi_sleep=s3_bios,s3_mode
    echo    'Loading initial ramdisk ...'
    initrd    /initrd-4.9.0-2-default
}

No other change has been made here except “nomodeset” and the “acpi_sleep” parameters.
I know that putting vga=0 on the kernel command line is deprecated (but doesn’t that mean it should still work but may not be in the future?), and I see the following suggestion on the next screen:


Booting a command list
Loading Linux 4.9.0-2.default ...
text is deprecated. use set gfxvideopayload=vga=0 before the linux command instead
Loading initial ramdisk ...

Following this advice, I changed


set gfxpayload=keep

to

set gfxpayload=vga=0

Both, if vga=0 is set on the command line or gfxpayload is changed as above, resume from suspend to RAM Is now OK.
I guess it would help in analyzing what’s going on if we understand what this change does. With vga=0, the Xorg.0.log lists:


/home/bs> cat /var/log/Xorg.0.log | egrep 'load|LoadModule'
    66.407] (II) LoadModule: "glx"
    66.903] (II) LoadModule: "intel"
    67.089] (II) LoadModule: "modesetting"
    67.109] (II) LoadModule: "fbdev"
    67.132] (II) LoadModule: "vesa"
    69.211] intel: waited 2020 ms for i915.ko driver to load
    69.254] (II) LoadModule: "fbdevhw"
    69.265] (II) LoadModule: "fbdevhw"
    69.266] (II) UnloadModule: "modesetting"
    69.266] (II) UnloadModule: "fbdev"
    69.266] (II) UnloadSubModule: "fbdevhw"
    69.267] (II) LoadModule: "vbe"
    69.273] (II) LoadModule: "int10"
    69.313] (II) LoadModule: "ddc"
    69.355] (II) LoadModule: "shadow"
    69.357] (II) LoadModule: "fb"
    69.362] (II) LoadModule: "int10"
    73.463] (II) LoadModule: "libinput"

There are differences, so can someone explain if they can help us?

Here are the results of the hwinfo and lspci commands that you suggested:


/home/bs> /usr/sbin/hwinfo --gfxcard
20: PCI 02.0: 0300 VGA compatible controller (VGA)              
  [Created at pci.378]
  Unique ID: _Znp.mboYdMdxjS6
  SysFS ID: /devices/pci0000:00/0000:00:02.0
  SysFS BusID: 0000:00:02.0
  Hardware Class: graphics card
  Model: "Intel 855 GM"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x3582 "855 GM"
  SubVendor: pci 0x10cf "Fujitsu Limited."
  SubDevice: pci 0x1281 
  Revision: 0x02
  Memory Range: 0xd8000000-0xdfffffff (ro,non-prefetchable)
  Memory Range: 0xd0000000-0xd007ffff (rw,non-prefetchable)
  I/O Ports: 0x2450-0x2457 (rw)
  Memory Range: 0x000c0000-0x000dffff (rw,non-prefetchable,disabled)
  IRQ: 11 (3025 events)
  I/O Port: 0x00 (rw)
  Module Alias: "pci:v00008086d00003582sv000010CFsd00001281bc03sc00i00"
  Driver Info #0:
    XFree86 v4 Server Module: intel
  Driver Info #1:
    XFree86 v4 Server Module: intel
    3D Support: yes
    Extensions: dri
  Config Status: cfg=no, avail=yes, need=no, active=unknown

29: PCI 02.1: 0380 Display controller
  [Created at pci.378]
  Unique ID: ruGf.mdDR2eouThB
  SysFS ID: /devices/pci0000:00/0000:00:02.1
  SysFS BusID: 0000:00:02.1
  Hardware Class: graphics card
  Model: "Intel 855 GM"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x3582 "855 GM"
  SubVendor: pci 0x10cf "Fujitsu Limited."
  SubDevice: pci 0x1281 
  Revision: 0x02
  Memory Range: 0xe0000000-0xe7ffffff (ro,non-prefetchable)
  Memory Range: 0xd0080000-0xd00fffff (rw,non-prefetchable)
  Module Alias: "pci:v00008086d00003582sv000010CFsd00001281bc03sc80i00"
  Driver Info #0:
    XFree86 v4 Server Module: intel
  Driver Info #1:
    XFree86 v4 Server Module: intel
    3D Support: yes
    Extensions: dri
  Config Status: cfg=no, avail=yes, need=no, active=unknown

Primary display adapter: #20

and


/home/bs> sudo lspci -nnk | grep '\[03' -A3
00:02.0 VGA compatible controller [0300]: Intel Corporation 82852/855GM Integrated Graphics Device [8086:3582] (rev 02)
        Subsystem: Fujitsu Limited. Device [10cf:1281]
        Kernel modules: i915
00:02.1 Display controller [0380]: Intel Corporation 82852/855GM Integrated Graphics Device [8086:3582] (rev 02)
        Subsystem: Fujitsu Limited. Device [10cf:1281]
        Kernel modules: i915
00:1d.0 USB controller [0c03]: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 [8086:24c2] (rev 03)

Does this help? I will be happy to supply additional ifnroamtion if needed or do more experimentation to solve this issue.

Best regards

This is grub bug. Arguments are reversed; it wants to say

vga=0 is deprecated. Use set gfxpayload=text before linux command instead

Thank you for report!

Ah, that explains at least the strange message.
And: using

set gfxpayload=text

gives the same result as

set gfxpayload=vga=0

before - ugly boot screens but later suspend/resume works fine, probably because text is the default.

As I suspected :wink:

In conclusion from this thread, I will set the gfxpayload variable to value “text” through /etc/default/grub and the grub2-mkconfig command, since the suspend/resume functionality for me seems more important than having nice boot screens and a nice font size for the text console.
Thanks for helping with this.

Glad to have been of assistance. :slight_smile:

Yes it would be interesting to see what the X server problem is when the intel kernel module (i915) is allowed to use modesetting … the full contents of the /var/log/Xorg.0.conf would be illuminating in that regard

Also, I would suggest removing the vga= whatever. Such setting impacts the vesafb console framebuffer driver. It concedes control to the kms framebuffer embedded in the intel drm kernel driver (i915). So, I would first test with the nomodeset option removed and the gfxpayload set to “keep”