Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

Hibernate does not work after update

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
21 posts • Page 1 of 1
Author
Message
V-Li
Retired Dev
Retired Dev
Posts: 618
Joined: Tue Jan 03, 2006 12:44 am

Hibernate does not work after update

  • Quote

Post by V-Li » Wed Mar 05, 2025 10:44 pm

[Administrator note: this post, and the first 2 responses, were originally attached to the topic Hibernate does not work after update. However, that topic dealt with nVidia drivers preventing hibernate, and this appears to deal with logind not issuing a valid hibernate command to the system. -Hu]

I am seeing the same effect for some time that

Code: Select all

loginctl hibernate
just locks the screen. As root the command

Code: Select all

echo disk > /sys/power/state
works fine however. Nothing recorded on dmesg apart from "[ 123.116971] elogind-daemon[2727]: The system will hibernate now!". It used to work fine.

Running as root as no effect either, I have no NVIDIA card.

Any idea where else to look for hints?
Top
Hu
Administrator
Administrator
Posts: 24383
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Thu Mar 06, 2025 2:44 pm

V-Li, all the other posts in this thread seem specific to the proprietary nVidia drivers. Since you are not using an nVidia card, I suspect you have a different problem. Shall I move your post to a new thread?

Regardless, it could be useful to know the last known good and first known bad logind versions for you. Since it does work for you using echo disk (which did not work for dabler), I think your problem is in logind, whereas the other affected users had a kernel-level problem.
Top
V-Li
Retired Dev
Retired Dev
Posts: 618
Joined: Tue Jan 03, 2006 12:44 am

  • Quote

Post by V-Li » Thu Mar 06, 2025 8:36 pm

Hu wrote:V-Li, all the other posts in this thread seem specific to the proprietary nVidia drivers. Since you are not using an nVidia card, I suspect you have a different problem. Shall I move your post to a new thread?

Regardless, it could be useful to know the last known good and first known bad logind versions for you. Since it does work for you using echo disk (which did not work for dabler), I think your problem is in logind, whereas the other affected users had a kernel-level problem.
Downgrade is not possible, I assume it used to be 246.10-r3, but I actually cannot tell if it was a kernel upgrade or elogind. So I would love to check what is going on, but cannot find a log message.

A separate thread is fine by me.
Top
wjb
l33t
l33t
User avatar
Posts: 681
Joined: Sun Jul 10, 2005 9:40 am
Location: Fife, Scotland

  • Quote

Post by wjb » Sat Mar 08, 2025 1:14 am

I have what looks like the same problem on a laptop with intel graphics. It was ok when I was away with it in late December, but hibernate did not work on a recent trip. The fail mode is that the screen goes black as if hibernate is doing something, then the lock screen appears almost immediately[/list].

Looking at history with "genlop -s", during the December trip (hibernate working) the laptop had:
  • sys-auth/elogind-252.9-r2
  • sys-kernel/gentoo-sources-6.6.62
  • sys-libs/pam-1.6.1
And this last trip (hibernate not working):
  • sys-auth/elogind-255.5-r2
  • sys-kernel/gentoo-sources-6.6.74
  • sys-libs/pam-1.6.1
I just tried reverting to sys-auth/elogind-252.9-r2 and hibernate now works from the KDE logout menu.
Top
V-Li
Retired Dev
Retired Dev
Posts: 618
Joined: Tue Jan 03, 2006 12:44 am

  • Quote

Post by V-Li » Sun Mar 09, 2025 3:06 pm

I assume the following issue https://github.com/elogind/elogind/issues/298 might be related to this. I will try to compile with the referenced patch and let's see.
Top
V-Li
Retired Dev
Retired Dev
Posts: 618
Joined: Tue Jan 03, 2006 12:44 am

  • Quote

Post by V-Li » Sun Mar 09, 2025 5:38 pm

I can confirm that applying said patch (https://github.com/enometh/elogind/comm ... fb28.patch) does not help at all.
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3529
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sun Mar 09, 2025 6:06 pm

V-Li you've provided so much information that it almost looks like you want to solve it on your own :)

Best Regards,
Georgi
Top
iromeister
n00b
n00b
Posts: 38
Joined: Sat Feb 04, 2017 9:19 pm
Location: Wustrow (Wendland)

  • Quote

Post by iromeister » Mon Mar 10, 2025 10:55 am

For me

Code: Select all

loginctl hibernate
also stopped working after upgrading the kernel to linux-6.12.16-gentoo. When I switched back to kernel linux-6.6.74-gentoo it does work again, so the kernel upgrade is at least involved in the problem, if not the sole cause.
Edit: Someone reported a bug in elogind concerning Suspend to RAM which might be related.
Top
iromeister
n00b
n00b
Posts: 38
Joined: Sat Feb 04, 2017 9:19 pm
Location: Wustrow (Wendland)

  • Quote

Post by iromeister » Mon Mar 10, 2025 2:51 pm

It gets more complicated: now I downgraded pam to 1.6.1 and elogind to 252.9-r2. With those in place, loginctl hibernate seems to work with kernel 6.12.16 running - at least the screen goes blank after the usual amount of time. But my system does not resume, but instead does a clean boot. Using kernel 6.6.74 everything works as expected.
When upgrading the kernel I didn't change any of the old kernel options, only added the new ones.
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3529
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Mon Mar 10, 2025 4:24 pm

iromeister wrote:But my system does not resume, but instead does a clean boot.
When resuming, Linux kernel loads but then gets replaced by the copy in the hibernate image. That's why it needs to be pointed to the resume partition/file. How do you do that? For quite a long time CONFIG_PM_STD_PARTITION didn't work for me and I had to pass it on the kernel command line. I'm pretty sure it didn't work for a lot of the 5.x kernels. In fact I still have it in CONFIG_CMDLINE as well but I remember once I booted a kernel that didn't have it that resumed normally which prompted me that issue was resolved, at least for me.

I haven't tested if hibernation still works with 6.12.17 which I'm currently using, but I remember it worked with 6.13.

Best Regards,
Georgi
Top
iromeister
n00b
n00b
Posts: 38
Joined: Sat Feb 04, 2017 9:19 pm
Location: Wustrow (Wendland)

  • Quote

Post by iromeister » Mon Mar 10, 2025 4:35 pm

logrusx wrote:That's why it needs to be pointed to the resume partition/file. How do you do that? For quite a long time CONFIG_PM_STD_PARTITION didn't work for me and I had to pass it on the kernel command line.
I do pass it on the command line, which used to work until the upgrade to kernel 6.12.16. As I wrote above, I didn't change anything regarding the kernel config. Grub command line for 6.12.16 still has the same resume parameter as for kernel 6.6.74.
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3529
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Mon Mar 10, 2025 5:43 pm

I tried with my kernel and hibernation worked. It's one version above yours - 6.12.17 but I suggest trying 6.13 as well, just in case it's something that's known and fixed there. In my case it was S3 sleep that was broken for nearly 2 years. Somebody on the forums reported it worked on 6.13 and later I found the fix was present in 6.12.17 as well. I wanted to be on the long term kernel so I switched to it.

Best Regards,
Georgi
Top
deleterium
n00b
n00b
Posts: 2
Joined: Fri Jul 08, 2022 1:20 pm

  • Quote

Post by deleterium » Mon Mar 17, 2025 2:31 pm

Maybe related, but I have similar issue.

I debugged the suspension following the article https://docs.kernel.org/power/basic-pm-debugging.html and found the problem at the step "processors".

I've compiled my kernel with the new features and linked directly to the new alternate scheduler (I'm usign PDS). So I'm trying to isolate even more, but it seems that i can 'hotunplug' all non boot processors only when compiling the kernel with clang and for generic x86_64 abi v1

Once I have only the boot processors online, the computer suspend/hibernate.
Top
Kruppe
Tux's lil' helper
Tux's lil' helper
Posts: 121
Joined: Tue Oct 14, 2008 2:55 pm

  • Quote

Post by Kruppe » Mon Apr 21, 2025 2:20 pm

I've also seen this same behaviour.

In dmesg, I only see:

Code: Select all

Apr 20 17:05:53 [sudo] pam_unix(sudo:session): session closed for user root
But when looking at /var/log/everything/current I see:

Code: Select all

Apr 20 17:05:53 [sudo] pam_unix(sudo:session): session closed for user root
Apr 20 17:05:53 [e-hibernate] Failed to build JSON object: Invalid argument
Apr 20 17:05:53 [e-hibernate] e-hibernate: shutdown_or_sleep failed: Invalid argument
I think loginctl hibernate is building invalid json, but I'm not sure where that would be happening.

I can also confirm that:

Code: Select all

echo disk > /sys/power/state
Works just fine.
Top
iromeister
n00b
n00b
Posts: 38
Joined: Sat Feb 04, 2017 9:19 pm
Location: Wustrow (Wendland)

  • Quote

Post by iromeister » Sat May 10, 2025 11:48 am

Today I made a cup of coffee and scrolled through the kernel config diff between linux-6.6.67-gentoo and linux-6.12.16-gentoo, and I found new options in kernel 6.12 that might be responsible for resume not working anymore.
The one that stands out is CONFIG_ACPI_MADT_WAKEUP which is set to yes and was not present in kernel 6.6.
There are also new options for compressing the hibernation image:

Code: Select all

CONFIG_HIBERNATION_COMP_LZ4=y
CONFIG_HIBERNATION_DEF_COMP="lz4"
The differences between said kernel configs are manifold, so I hope I found the needle in the haystack. Didn't have time to test it yet.
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3529
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sat May 10, 2025 4:58 pm

iromeister wrote:Today I made a cup of coffee and scrolled through the kernel config diff between linux-6.6.67-gentoo and linux-6.12.16-gentoo, and I found new options in kernel 6.12 that might be responsible for resume not working anymore.
The one that stands out is CONFIG_ACPI_MADT_WAKEUP which is set to yes and was not present in kernel 6.6.
That option is controlled by other options, you can't control it directly.

iromeister wrote:
There are also new options for compressing the hibernation image:

Code: Select all

CONFIG_HIBERNATION_COMP_LZ4=y
CONFIG_HIBERNATION_DEF_COMP="lz4"
That doesn't really matter.
iromeister wrote:The differences between said kernel configs are manifold, so I hope I found the needle in the haystack. Didn't have time to test it yet.
No you haven't. In the kernel commit log there are explicit entries addressing the problem. It was a regression.

I don't think the fix will be backported in 6.6, but 6.12 is stable in the main tree and is a long term kernel.

If you really need to use 6.6 maybe you need to file a bug asking for the fix to be backported but don't hold out much hope on it.

Best Regards,
Georgi
Top
iromeister
n00b
n00b
Posts: 38
Joined: Sat Feb 04, 2017 9:19 pm
Location: Wustrow (Wendland)

  • Quote

Post by iromeister » Sat May 24, 2025 10:41 am

It still remains mysterious, but today I learned something. When testing said kernel option I noticed that resume still does not work in kernel 6.12, and after hibernating (either using loginctl or directly via /sys/power) swapon complains that it can't activate the swap partition because the device or resource is busy. After rebooting swap works again.

That means that either hibernate creates a broken hibernation image somehow, or resume does not work correctly.

Changing CONFIG_ACPI_MADT_WAKEUP has no effect whatsoever.
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3529
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sat May 24, 2025 12:05 pm

There's 6.14.8 already. You can try it. There are some entries in the commit log that might be relevant.

Also, 6.6 is longterm, you could have stayed on it, did something necessitate the upgrade?

Best Regards,
Georgi
Top
iromeister
n00b
n00b
Posts: 38
Joined: Sat Feb 04, 2017 9:19 pm
Location: Wustrow (Wendland)

  • Quote

Post by iromeister » Sat May 24, 2025 2:13 pm

logrusx wrote:Also, 6.6 is longterm, you could have stayed on it, did something necessitate the upgrade?
I am on 6.6 still, as resume in newer versions doesn't work for me. But some day 6.6 will be deprecated, that's why I'm trying to get it working in 6.12.
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3529
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sat May 24, 2025 3:16 pm

I suggest starting a new thread with your specific issue.

Best Regards,
Georgi
Top
8an
n00b
n00b
Posts: 25
Joined: Sat May 14, 2005 12:06 pm

  • Quote

Post by 8an » Tue May 27, 2025 7:16 pm

Kruppe wrote:

Code: Select all

Apr 20 17:05:53 [sudo] pam_unix(sudo:session): session closed for user root
Apr 20 17:05:53 [e-hibernate] Failed to build JSON object: Invalid argument
Apr 20 17:05:53 [e-hibernate] e-hibernate: shutdown_or_sleep failed: Invalid argument
I had the same problem, the error happens in function write_efi_hibernate_location, which in my case isn't actually needed (I use UEFI boot, but resume is done through Grub2). So I disabled it with a custom patch (/etc/portage/patches/sys-auth/elogind/fix-hibernation.patch) and hibernation in GUI works again.

Code: Select all

diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c
index e68547c..011b07f 100644
--- a/src/sleep/sleep.c
+++ b/src/sleep/sleep.c
@@ -202,6 +202,8 @@ static int write_efi_hibernate_location(const HibernationDevice *hibernation_dev
         struct utsname uts = {};
         int r, log_level_ignore = required ? LOG_WARNING : LOG_DEBUG;

+        return 0;
+
         assert(hibernation_device);

         if (!is_efi_boot())
Top
Post Reply

21 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy