Bug 1226232

Summary: Going to sleep and Hibernate often fails with black screen
Product: [openSUSE] openSUSE Distribution Reporter: Gui Do <guidopro>
Component: KernelAssignee: openSUSE Kernel Bugs <kernel-bugs>
Status: NEW --- QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: guidopro, tiwai
Version: Leap 15.6Flags: tiwai: needinfo? (guidopro)
Target Milestone: ---   
Hardware: Other   
OS: All   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: sleep.log
suspend.log
new log

Description Gui Do 2024-06-12 15:28:56 UTC
Maybe same problem as in Tumbleweed Bug 1190357 :

I was on Leap 15.5 with seperate partitions for /, /home  and swap. Until now the automatic hibernation/suspend-to-disk after some time in sleep mode worked flawlessly. 

Now, after the upgrade to Leap 15.6,  manually start hibernation and wake up again works, but when going automatically to sleep/ hibernate-after-sleep the screen is black and no button to wake up works, system freezes and has to be hard rebooted (because of that no log entry captured). 

Operating System: openSUSE Leap 15.6
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.4.0-150600.21-default (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i3-7100U CPU @ 2.40GHz
Memory: 11.5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 620
Comment 1 Andreas Stieger 2024-06-12 15:37:43 UTC
Please do not touch the priority field unless you are a developer or a release manager.

This problem happens after the upgrade, but this not an upgrade problem. Moving to "Kernel".
Comment 2 Takashi Iwai 2024-06-14 15:23:00 UTC
Do you see any relevant kernel messages indicating crash or such?
It's difficult to diagnose without logs, unfortunately.

In anyway, try the kernel in OBS Kernel:SLE15-SP6 repo
  http://download.opensuse.org/repositories/Kernel:/SLE15-SP6/pool/

It's the build from the latest git branch, and some fixes might have been already included.
Comment 3 Gui Do 2024-06-15 10:10:37 UTC
(In reply to Takashi Iwai from comment #2)
> Do you see any relevant kernel messages indicating crash or such?
> It's difficult to diagnose without logs, unfortunately.

Unfortunately it is not possible to add logs because of the freezing and hard rebooting there are no logs written.

> In anyway, try the kernel in OBS Kernel:SLE15-SP6 repo
>   http://download.opensuse.org/repositories/Kernel:/SLE15-SP6/pool/
> 
> It's the build from the latest git branch, and some fixes might have been
> already included.

Maybe it not the kernel only. I was booting the last kernel from Leap 15.5 (kernel 5.14) and the problem exists, too. So I think it is a issue with Leap 15.6 in general.
Comment 4 Gui Do 2024-06-16 20:04:53 UTC
So, 

I have hibernated system manually and started again. This is the log for it:

16.06.24 21:36	systemd-logind	The system will hibernate now!
16.06.24 21:36	systemd	Starting System Hibernate...
16.06.24 21:36	systemd-sleep	INFO: running /usr/lib/systemd/system-sleep/grub2.sleep for hibernate
16.06.24 21:36	systemd-sleep	Entering sleep state 'hibernate'...
16.06.24 21:36	kernel	PM: hibernation: hibernation entry
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x00000000-0x00000fff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x00058000-0x00058fff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x0009e000-0x000fffff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x6d7fd000-0x6d7fdfff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x6d80a000-0x6d80bfff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x6d81b000-0x6d81bfff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x70b71000-0x70b72fff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x7bd97000-0x7be78fff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x7d9c3000-0x7d9c3fff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x7eaa8000-0x7fffdfff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x7ffff000-0xffffffff]
16.06.24 21:58	kernel	PM: hibernation: Basic memory bitmaps created
16.06.24 21:58	kernel	PM: hibernation: Preallocating image memory
16.06.24 21:58	kernel	PM: hibernation: Allocated 892640 pages for snapshot
16.06.24 21:58	kernel	PM: hibernation: Allocated 3570560 kbytes in 2.94 seconds (1214.47 MB/s)
16.06.24 21:58	kernel	PM: hibernation: PM: secret key is invalid
16.06.24 21:58	kernel	PM: hibernation: Creating image:
16.06.24 21:58	kernel	PM: hibernation: Need to copy 882950 pages
16.06.24 21:58	kernel	PM: hibernation: Normal pages needed: 882950 + 1024, available pages: 2208611
16.06.24 21:58	kernel	PM: hibernation: PM: Trampoline freed
16.06.24 21:58	kernel	PM: hibernation: Basic memory bitmaps freed
16.06.24 21:58	kernel	PM: hibernation: hibernation exit
16.06.24 21:59	systemd-sleep	INFO: running /usr/lib/systemd/system-sleep/grub2.sleep for hibernate
16.06.24 21:59	systemd	systemd-hibernate.service: Deactivated successfully.
16.06.24 21:59	systemd	Finished System Hibernate.
16.06.24 21:59	systemd	systemd-hibernate.service: Consumed 3.879s CPU time.
16.06.24 21:59	systemd	Reached target System Hibernation.
16.06.24 21:59	systemd	Stopped target System Hibernation.
Comment 5 Gui Do 2024-06-16 20:07:02 UTC
So, 

I have hibernated system manually and started again. This is the log for it:

16.06.24 21:36	systemd-logind	The system will hibernate now!
16.06.24 21:36	systemd	Starting System Hibernate...
16.06.24 21:36	systemd-sleep	INFO: running /usr/lib/systemd/system-sleep/grub2.sleep for hibernate
16.06.24 21:36	systemd-sleep	Entering sleep state 'hibernate'...
16.06.24 21:36	kernel	PM: hibernation: hibernation entry
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x00000000-0x00000fff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x00058000-0x00058fff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x0009e000-0x000fffff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x6d7fd000-0x6d7fdfff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x6d80a000-0x6d80bfff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x6d81b000-0x6d81bfff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x70b71000-0x70b72fff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x7bd97000-0x7be78fff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x7d9c3000-0x7d9c3fff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x7eaa8000-0x7fffdfff]
16.06.24 21:58	kernel	PM: hibernation: Marking nosave pages: [mem 0x7ffff000-0xffffffff]
16.06.24 21:58	kernel	PM: hibernation: Basic memory bitmaps created
16.06.24 21:58	kernel	PM: hibernation: Preallocating image memory
16.06.24 21:58	kernel	PM: hibernation: Allocated 892640 pages for snapshot
16.06.24 21:58	kernel	PM: hibernation: Allocated 3570560 kbytes in 2.94 seconds (1214.47 MB/s)
16.06.24 21:58	kernel	PM: hibernation: PM: secret key is invalid
16.06.24 21:58	kernel	PM: hibernation: Creating image:
16.06.24 21:58	kernel	PM: hibernation: Need to copy 882950 pages
16.06.24 21:58	kernel	PM: hibernation: Normal pages needed: 882950 + 1024, available pages: 2208611
16.06.24 21:58	kernel	PM: hibernation: PM: Trampoline freed
16.06.24 21:58	kernel	PM: hibernation: Basic memory bitmaps freed
16.06.24 21:58	kernel	PM: hibernation: hibernation exit
16.06.24 21:59	systemd-sleep	INFO: running /usr/lib/systemd/system-sleep/grub2.sleep for hibernate
16.06.24 21:59	systemd	systemd-hibernate.service: Deactivated successfully.
16.06.24 21:59	systemd	Finished System Hibernate.
16.06.24 21:59	systemd	systemd-hibernate.service: Consumed 3.879s CPU time.
16.06.24 21:59	systemd	Reached target System Hibernation.
16.06.24 21:59	systemd	Stopped target System Hibernation.

No log when automatically sleep and hibernate due to crash possible.
Comment 6 Gui Do 2024-06-17 01:07:30 UTC
I was able now to create a complete systemd-log (see attachement). 

To clarify: I removed the USB mouse connector and closed the lid of the laptop, it was going to sleep, the green standby LED flashed. Then after about two hours the LED was still flashing, so no hibernate was running. I opened the laptop, the screen remained black and the device did not respond to any keystrokes. I plugged the mouse connector back in as a test. The corresponding KDE desktop system sound could be heard - the computer was not dead, it just stopped responding. I simply closed the laptop lid and opened it again and ended up back in the lock screen, the device responded again and I was able to log in again and create the attached log files.
Comment 7 Gui Do 2024-06-17 01:08:33 UTC
Created attachment 875507 [details]
sleep.log
Comment 8 Gui Do 2024-06-17 01:09:39 UTC
Created attachment 875508 [details]
suspend.log
Comment 9 Gui Do 2024-06-17 01:25:33 UTC
Oh, if you're wondering why I unplugged the mouse: When I close the laptop and it goes into sleep mode, the slightest movement of the mouse wakes it up (the led no longer flashes but lights up normally).
Comment 10 Gui Do 2024-06-18 10:02:10 UTC
(In reply to Takashi Iwai from comment #2)
 
> In anyway, try the kernel in OBS Kernel:SLE15-SP6 repo
>   http://download.opensuse.org/repositories/Kernel:/SLE15-SP6/pool/

Thx, have tried it, but this kernel unfortunately does not resolve the problem.
Comment 11 Gui Do 2024-06-18 10:13:11 UTC
Created attachment 875547 [details]
new log

added new log from going to suspend to automatically trying to hibernate: stays in suspend mode
Comment 12 Takashi Iwai 2024-06-18 11:24:41 UTC
You might see a bit more with no_console_suspend boot option.

Also, could you check whether the recent upstream kernel in OBS Kernel:stable:Backport works as expected?
  http://download.opensuse.org/repositories/Kernel:/stable:/Backport/standard/
Comment 13 Gui Do 2024-06-18 14:20:09 UTC
(In reply to Takashi Iwai from comment #12)
> You might see a bit more with no_console_suspend boot option.
> 
> Also, could you check whether the recent upstream kernel in OBS
> Kernel:stable:Backport works as expected?
>  
> http://download.opensuse.org/repositories/Kernel:/stable:/Backport/standard/

Tried both, no success. Maybe no kernel issue.
Comment 14 Takashi Iwai 2024-06-18 14:28:35 UTC
You can try to install the old Leap 15.5 kernel and test with that.
If that works, it means that it's a kernel regression.
And since OBS Kernel:stable:Backport also fails, it implies that the upstream kernel is still buggy.  For the very latest 6.10-rc, you can try the kernel in OBS Kernel:HEAD:Backport repo, too.
Comment 15 Gui Do 2024-06-18 14:33:44 UTC
(In reply to Takashi Iwai from comment #14)
> You can try to install the old Leap 15.5 kernel and test with that.
> If that works, it means that it's a kernel regression.

As I wrote in comment 3, kernel from Leap 15.5 also does not work anymore.

Same machine, restore old backup from former installed Leap 15.5 works as expexcted (but EOL end of the year) - so I think is an Leap 15.6 issue.
Comment 16 Takashi Iwai 2024-06-18 14:35:16 UTC
(In reply to Gui Do from comment #15)
> (In reply to Takashi Iwai from comment #14)
> > You can try to install the old Leap 15.5 kernel and test with that.
> > If that works, it means that it's a kernel regression.
> 
> As I wrote in comment 3, kernel from Leap 15.5 also does not work anymore.
> 
> Same machine, restore old backup from former installed Leap 15.5 works as
> expexcted (but EOL end of the year) - so I think is an Leap 15.6 issue.

Ah sorry, I missed that information.  So it's something in user-space, or some subtle change that was applied to BIOS or whatever.  Tough.

In the case of user-space, it's often such like tlp, tuned or such package that adjust the PM behavior.
Comment 17 Gui Do 2024-06-21 08:41:18 UTC
(In reply to Takashi Iwai from comment #16)

> Ah sorry, I missed that information.  So it's something in user-space, or
> some subtle change that was applied to BIOS or whatever.  Tough.
> 
> In the case of user-space, it's often such like tlp, tuned or such package
> that adjust the PM behavior.

Maybe, bu I have no such a package. tlp and tuned are not installed, BIOS settings did not changed an are the same as in Leap 15.5.

I did a fresh installation of Leap 15.6 on my old testing laptop thinkpad T61 with BIOS boot, LUKS1 encryption for root partition an not-encrypted swap partiton. Problem is the same: no automatically hibernation.

So it is not a hardware problem but 15.6 release issue.
Comment 18 Takashi Iwai 2024-06-21 10:02:49 UTC
It might be systemd stuff itself, too.  It's not trivial to track down, unfortunately...
Comment 19 Gui Do 2024-06-24 11:10:15 UTC
Update: After the last update the sleep mode does not freeze the screen anymore. So, when opening the laptop lid, the lock screen occures immediately.

Suspend-to-disk/hibernation-after-sleep does not work, yet.
Comment 20 Takashi Iwai 2024-06-24 11:14:32 UTC
(In reply to Gui Do from comment #19)
> Update: After the last update the sleep mode does not freeze the screen
> anymore. So, when opening the laptop lid, the lock screen occures
> immediately.

OK, that's good.

> Suspend-to-disk/hibernation-after-sleep does not work, yet.

Do you mean that the manual suspend-to-disk (e.g. "systemctl hibernate") doesn't work either?
Comment 21 Gui Do 2024-06-24 12:26:15 UTC
(In reply to Takashi Iwai from comment #20)
> Do you mean that the manual suspend-to-disk (e.g. "systemctl hibernate")
> doesn't work either?

No no! manual hibernating works fine as anytime, only automatic doesnot work.
Comment 22 Gui Do 2024-07-16 18:09:32 UTC
Part of new log file:

Every hour the device tries to hibernate after suspend:

16.07.24 02:11	kernel	ACPI: PM: Preparing to enter system sleep state S3
16.07.24 02:11	kernel	ACPI: PM: Waking up from system sleep state S3
16.07.24 02:11	kernel	ahci 0000:00:17.0: port does not support device sleep
16.07.24 02:11	systemd-sleep	System returned from sleep state.

I do not know why ahci for the intel sunrise port does not support sleep anymore.