linux-5.4 regression: hibernate-disk resumes instantly

Bug #1866984 reported by Horst Schirmeier
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
hibernate (Ubuntu)
Confirmed
Undecided
Unassigned
linux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Since upgrading from 19.10 (eoan) to 20.04 (focal), hibernate-disk fails to properly hibernate and shutdown the system; instead, Ubuntu resumes instantly.

$ sudo hibernate-disk
[sudo] password for xyz:
hibernate-disk:Warning: Tuxonice binary signature file not found.
$

(Note that this warning has been there earlier and is presumably not associated with this bug.)

Expected: Switch to console, memory-page writeout progress indication, poweroff

Observed: Switch to console, very quickly switch back to X11

Excerpt from dmesg:

[ 418.377514] usbcore: deregistering interface driver uvcvideo
[ 419.227465] Filesystems sync: 0.006 seconds
[ 419.227468] Freezing user space processes ... (elapsed 0.002 seconds) done.
[ 419.229889] OOM killer disabled.
[ 419.230429] PM: Marking nosave pages: [mem 0x00000000-0x00000fff]
[ 419.230432] PM: Marking nosave pages: [mem 0x0009d000-0x000fffff]
[ 419.230440] PM: Marking nosave pages: [mem 0x99438000-0xffffffff]
[ 419.233760] PM: Basic memory bitmaps created
[ 419.234176] PM: Preallocating image memory... done (allocated 1188843 pages)
[ 420.040021] PM: Allocated 4755372 kbytes in 0.80 seconds (5944.21 MB/s)
[ 420.040021] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[ 420.041324] printk: Suspending console(s) (use no_console_suspend to debug)
[ 420.041755] wlp3s0: deauthenticating from cc:ce:1e:61:2e:d0 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 421.278599] ACPI: EC: interrupt blocked
[ 421.297107] ACPI: Preparing to enter system sleep state S4
[ 421.301832] ACPI: EC: event blocked
[ 421.301833] ACPI: EC: EC stopped
[ 421.301834] PM: Saving platform NVS memory
[ 421.302557] Disabling non-boot CPUs ...
[ 421.303996] smpboot: CPU 1 is now offline
[ 421.307624] smpboot: CPU 2 is now offline
[ 421.309904] IRQ 129: no longer affine to CPU3
[ 421.310921] smpboot: CPU 3 is now offline
[ 421.314818] smpboot: CPU 4 is now offline
[ 421.317033] IRQ 16: no longer affine to CPU5
[ 421.317040] IRQ 132: no longer affine to CPU5
[ 421.318049] smpboot: CPU 5 is now offline
[ 421.320365] IRQ 126: no longer affine to CPU6
[ 421.320373] IRQ 130: no longer affine to CPU6
[ 421.321405] smpboot: CPU 6 is now offline
[ 421.325743] smpboot: CPU 7 is now offline
[ 421.330059] PM: Creating hibernation image:
[ 422.045974] PM: Need to copy 1182218 pages
[ 422.045977] PM: Normal pages needed: 1182218 + 1024, available pages: 7053219
[ 423.427947] PM: Hibernation image created (1182218 pages copied)
[ 421.330504] PM: Restoring platform NVS memory
[ 421.330638] ACPI: EC: EC started
[ 421.331412] Enabling non-boot CPUs ...
[ 421.331453] x86: Booting SMP configuration:
[ 421.331454] smpboot: Booting Node 0 Processor 1 APIC 0x2
[ 421.332297] CPU1 is up
[ 421.332327] smpboot: Booting Node 0 Processor 2 APIC 0x4
[ 421.333137] CPU2 is up
[ 421.333164] smpboot: Booting Node 0 Processor 3 APIC 0x6
[ 421.333987] CPU3 is up
[ 421.334013] smpboot: Booting Node 0 Processor 4 APIC 0x1
[ 421.334926] CPU4 is up
[ 421.334956] smpboot: Booting Node 0 Processor 5 APIC 0x3
[ 421.335640] CPU5 is up
[ 421.335666] smpboot: Booting Node 0 Processor 6 APIC 0x5
[ 421.336447] CPU6 is up
[ 421.336469] smpboot: Booting Node 0 Processor 7 APIC 0x7
[ 421.337232] CPU7 is up
[ 421.340095] ACPI: Waking up from system sleep state S4
[ 421.347884] ACPI: EC: interrupt unblocked
[ 421.390488] ACPI: EC: event unblocked
[ 421.391425] tpm tpm0: tpm_try_transmit: send(): error -5
[ 421.403775] iwlwifi 0000:03:00.0: Applying debug destination EXTERNAL_DRAM
[ 421.553049] iwlwifi 0000:03:00.0: Applying debug destination EXTERNAL_DRAM
[ 421.603306] [drm] Reducing the compressed framebuffer size. This may lead to less power savings than a non-reduced-size. Try to increase stolen memory size if available in BIOS.
[ 421.634367] iwlwifi 0000:03:00.0: FW already configured (0) - re-configuring
[ 421.714565] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[ 421.715010] ata1.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
[ 421.715012] ata1.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
[ 421.715083] ata1.00: ACPI cmd ef/10:09:00:00:00:a0 (SET FEATURES) succeeded
[ 421.715396] ata1.00: supports DRM functions and may not be fully accessible
[ 421.716087] ata1.00: disabling queued TRIM support
[ 421.718110] ata1.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
[ 421.718112] ata1.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
[ 421.718178] ata1.00: ACPI cmd ef/10:09:00:00:00:a0 (SET FEATURES) succeeded
[ 421.718400] ata1.00: supports DRM functions and may not be fully accessible
[ 421.718987] ata1.00: disabling queued TRIM support

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: hibernate 2.0+15+g88d54a8-1
ProcVersionSignature: Ubuntu 5.4.0-14.17-generic 5.4.18
Uname: Linux 5.4.0-14-generic x86_64
ApportVersion: 2.20.11-0ubuntu19
Architecture: amd64
CurrentDesktop: KDE
Date: Wed Mar 11 11:55:21 2020
InstallationDate: Installed on 2016-11-26 (1200 days ago)
InstallationMedia: Kubuntu 16.10 "Yakkety Yak" - Release amd64 (20161012.1)
PackageArchitecture: all
SourcePackage: hibernate
UpgradeStatus: Upgraded to focal on 2020-03-06 (5 days ago)

Revision history for this message
Horst Schirmeier (horst) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in hibernate (Ubuntu):
status: New → Confirmed
Revision history for this message
Horst Schirmeier (horst) wrote :

Additional info: This has been observed on a Lenovo ThinkPad T460p, BIOS version R07ET90W (2.30). dmesg output attached.

Revision history for this message
Horst Schirmeier (horst) wrote :

Reproducible from a clean install of focal daily within KVM (on an x86_64 host):

wget http://cdimage.ubuntu.com/kubuntu/daily-live/20200311/focal-desktop-amd64.iso
qemu-img create -f qcow2 ubuntu.qcow2 10G
kvm -m 4096 -smp 2 -cdrom focal-desktop-amd64.iso ubuntu.qcow2
[do a minimal install]
[boot into the installed system:]
kvm -m 4096 -smp 2 ubuntu.qcow2
[within the virtual env:]
sudo -s
apt install hibernate
[make sure the swap file is large enough:]
swapoff -a
dd if=/dev/zero of=/swapfile bs=1M count=1500
mkswap /dev/swapfile
swapon -a
hibernate-disk

dmesg output attached.

Revision history for this message
Horst Schirmeier (horst) wrote :

To ensure that hibernate/resume *should* work properly in a KVM environment, I reproduced the above steps with Ubuntu 19.10 Eoan Desktop (x86_64). After applying one missing step (see below), hibernate-disk successfully hibernated the machine state in /swapfile and powered off the VM; restarting kvm resumed the state as expected.

The additionally necessary step to make resume work properly (hibernate-disk works with the above steps alone, but resume doesn't):

-> add resume=/swapfile to the GRUB_CMDLINE_LINUX_DEFAULT string in /etc/default/grub; run update-grub

Revision history for this message
Horst Schirmeier (horst) wrote :

This seems to be caused by Focal's 5.4 kernel: after booting Ubuntu 19.10's linux-image-5.3.0-40-generic (5.3.0-40.32), which remained on the system after upgrading to 20.04, hibernate-disk (and resume afterwards) works fine.

Horst Schirmeier (horst)
summary: - hibernate-disk resumes instantly
+ linux-5.4 regression: hibernate-disk resumes instantly
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux-5.4 (Ubuntu):
status: New → Confirmed
Revision history for this message
cosine (mvanross) wrote :

Confirmed on a T480.

I lose my trackpoint mouse after a failed hibernation attempt, and can suspend to ram anymore.

Revision history for this message
Marian Klein (sandokan9) wrote :
Revision history for this message
Daniel Garbes (dgarbes07) wrote :

For the following error in the initial post:

[ 421.603306] [drm] Reducing the compressed framebuffer size. This may lead to less power savings than a non-reduced-size. Try to increase stolen memory size if available in BIOS.

This can be solved by disabling framebuffer compression, which will have a pretty negligible impact on power management. @mvanross, I'm also working on a T480, so this may help you.

To disable, edit /etc/default/grub (you need superuser privilege to do this)

change:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i915.i915_enable_fbc=0"

and run:

sudo update-grub

Revision history for this message
cosine (mvanross) wrote :

Dear Daniel,
Thank you for that work-around!

The error message is a bit odd, as it says that it may lead to LESS powersaving.
Even then, once hibernated there is no power draw anyway....

affects: linux-5.4 (Ubuntu) → linux (Ubuntu)
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Please send the patch to mailing list...

Revision history for this message
cosine (mvanross) wrote :

Hi
I'm not sure if I can disable frambuffer compression (FBC).

> cat /proc/cmdline
says I disabled it:

BOOT_IMAGE=/boot/vmlinuz-5.4.0-49-generic root=UUID=86dba13c-b77a-4ac6-9f08-983354e5f8f1 ro quiet splash i915.i915_enable_fbc=0 vt.handoff=7

but
> systool -v -m i915 |grep fbc
says I did not:

enable_fbc = "1"

Does anyone understand this?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.