-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for hibernation (S4) for all NovaCustom laptops #471
Comments
Additional comment:
It isn't just your laptops. I'm realizing now that I haven't seen a UEFI laptop that properly hibernated in 20 years, and the last time I saw a machine that could do it properly was a desktop. (The current work-around is to book an extra half hour for prep time beforehand. I'd like to be able to eliminate that.) The mention of "laptops without S3 support" -- It seems that modern systems are moving away from S3 support now. It's like the "one size fits all" / "if it works for us in corporate, it will work for everyone everywhere" model of apple/google/microsoft is taking over. Please, be better. :-) |
@keybounce Thank you for leaving your comment. I agree and that's why I opened this ticket in the first place. About S3: we took a lot of time to investigate this and we came to the conclusion that the S3 suspend mode is not possible due to the NS5x/NS7x (ADL) hardware design. So that's another reason to add hibernation support (S4) as an alternative solution. |
Hibernation should be already available. I have tested it and works out-of-the-box on Windows 11 (restored all opened windows and applications I had before hiberating), however one must unhide the Hibernate option first: https://support.microsoft.com/en-us/windows/shut-down-sleep-or-hibernate-your-pc-2941d165-7d0a-a5e8-c5ad-8c972e8e6eff There are rumors that hibernation is not suitable for SSDs due to its faster wear out. However, limiting the frequency of hibernation and simply doing shutdown wherever applicable won't make much difference. But doing hibernation 10 times a day with nearly full RAM may be a bit tough for the SSD. Ubuntu 22.04 needs extra steps to do hibernation.
Some documentation how to do it: https://www.linuxandubuntu.com/home/how-to-enable-hibernate-in-ubuntu-linux Also no idea how QubesOS/Xen hypervisor will behave, but it seems to not be supported: QubesOS/qubes-issues#2414 |
Sent from my iPhone
On Aug 8, 2023, at 1:32 AM, Michał Żygowski ***@***.***> wrote:
https://www.linuxandubuntu.com/home/how-to-enable-hibernate-in-ubuntu-linux
Reading the comments at the end of that article, it seems there's a difference in how hibernation works between the APM and ACPI interfaces for trying to hibernate a computer. (Other than the fact that those are two different power systems, I don't know anything else about them.).
|
Thank you very much for your explanation, @miczyg1. I have discussed this with @macpijan today and it should be part of the test scope (if it's feasible of course). We have seen as well that hibernation works properly on a NV41-ADL laptop with Windows. But in another case (NS7x-ADL) while using Kubuntu, the state of opened applications was not restored when booting after hibernation. We did follow the steps you mentioned (among adding the GUI option for hibernation) and no disk encryption was applied. It's a valid point that the support from the OS should be there, so it's just no option for OSes like Qubes. But it should be working from the firmware side under Ubuntu and Windows 11, which should be tested for a next release. Maybe we can even get support for suspend-then-hibernate. About the SSD story: that's a good point. This is why it would be preferable to have a suspend-then-hibernate solution for all NovaCustom Dasharo laptops, where hibernation isn't triggered very soon but only after x hours or even days of not using the laptop. I don't believe there are cases in which hibernation is used multiple times on a day and on a daily base. It's a good thing to mention again that S0ix nor S3 is available for the NS5x/NS7x devices with Intel ME disabled. This is another reason why it's a priority request. S4 hibernation would be an acceptable alternative for traveling, while S2Idle is not (as the fan is still on and laptop is still hot during traveling). You can say users to fully shut down the laptop instead, but the use case is that the customer wants to resume and work again without having to close and/or reopen applications. I'm sorry for the delay this can cause for the new firmware release. |
This is basically all on OS settings and policies configured to prioritize S3 over S4 or wait at least X hours before hibernate. not much firmware can do about it. |
Ah okay. Yes, so then let's make sure S4 is working on NovaCustom laptops by adding it to the test scope. |
I have actually found a way to not reinstall Ubuntu and not make a large swap. One can create a swapfile and save the state there on rootfs: https://linuxhint.com/enable-hibernate-ubuntu-22-04-lts/ |
After following the above process (except that I had a previously prepared swap partition instead of swapfile) it worked perfectly on Ubuntu 22.04. Also adding the Hibernate option to the power off options in the GUI worked as well. |
That's great! Can you confirm that it also works with multiple applications running and that they restore fine from hibernation? |
@wessel-novacustom before the hibernation I had opened: terminal, file explorer and Firefox. All have been restored properly on the screen when booted again. |
That's great! Can you please confirm there is no firmware-side implementation needed? Is it nevertheless useful to add this to the test scope? Or wouldn't it make any sense because firmware is maybe not involved? I don't know to what extend firmware is involved. |
Confirmed, no modifications needed. You may as well use the latest link wit the guide I have provided and test on the latest release.
Yes, we are working on adding hibernation to the test scope. Firmware has very little involvement in S4/hibernation (it just has to expose that S4 is supported) because it is not much different from regular power on. Most action is done on OS side |
For simplicity, I will wait for the next firmware release and assume that it is working starting from then, even though with the need of some software modifications, which don't seem to be too hard, though. Thank you again for your assistance! |
So this is what I'm noticing so far.
Hibernation *usually* works fine. So far there have been two cases of a
full restart, rather than a refresh/reload.
At the same time, both hibernation and sleep have an annoying side problem.
About one in 4, one in 5, the trackpad will not work properly on resume.
The mouse will move, but button pressing does not work.
The fix is to do the other -- if I slept, and it does not work, a
hibernation/wake fixes it; if it failed on hibernate, a sleep/restore fixes
it.
The same thing a second time -- sleep to fix sleep -- has a 1 for 2 success.
(ok, so the sample size is small.)
…On Tue, Sep 5, 2023 at 3:36 AM Wessel klein Snakenborg < ***@***.***> wrote:
Closed #471 <#471> as
completed.
—
Reply to this email directly, view it on GitHub
<#471 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOF4R6HPSUGH6DK7YVFQMDXY36BZANCNFSM6AAAAAA3A5YGM4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
This message may have been spell checked by a laptop kitten.
|
@keybounce Could you please let me know what operating system, kernel version and Dasharo version you are using? It's worth mentioning that I know about this problem from the past. Back then, I realised that the problem didn't occur if the touchpad and keyboard aren't touched before at least one second after the screen display has turned on again. Is this the case for you, too? |
It's worth mentioning that I know about this problem from the past. Back
then, I realised that the problem didn't occur if the touchpad and keyboard
aren't touched before at least one second after the screen display has
turned on again. Is this the case for you, too?
No, pretty sure I don't touch the keyboard / trackpad for a few seconds
after the screen turns on.
Here is a dmesg log from startup this morning. Hibernate resume failed.
Most tasks were just restarted -- this means that, for example, bash shells
lose all state, any program running under bash is gone, and chromium does
not restore.
kubuntu LTS, I think that's 22.04.
Same version of the bios that was shipped -- not sure how to tell which one
that is.
[ 5.103059] kernel: PM: hibernation: Marking nosave pages: [mem
0x76793000-0xffffffff]
[ 5.107092] kernel: PM: hibernation: Basic memory bitmaps created
[ 5.380836] kernel: PM: Using 3 thread(s) for decompression
[ 5.380840] kernel: PM: Loading and decompressing image data (2862652
pages)...
[ 5.380845] kernel: Hibernate inconsistent memory map detected!
[ 5.380849] kernel: PM: hibernation: Image mismatch: architecture
specific data
[ 5.380852] kernel: PM: hibernation: Read 11450608 kbytes in 0.01
seconds (1145060.80 MB/s)
[ 5.382218] kernel: PM: Error -1 resuming
[ 5.382225] kernel: PM: hibernation: Failed to load image, recovering.
[ 5.382763] kernel: PM: hibernation: Basic memory bitmaps freed
[ 5.383135] kernel: OOM killer enabled.
[ 5.383136] kernel: Restarting tasks ... done.
[ 5.419990] kernel: video LNXVIDEO:00: Restoring backlight state
[ 5.430561] kernel: PM: hibernation: resume failed (-1)
…On Sat, Sep 9, 2023 at 2:00 AM Wessel klein Snakenborg < ***@***.***> wrote:
@keybounce <https://github.com/keybounce> Could you please let me know
what operating system, kernel version and Dasharo version you are using?
It's worth mentioning that I know about this problem from the past. Back
then, I realised that the problem didn't occur if the touchpad and keyboard
aren't touched before at least one second after the screen display has
turned on again. Is this the case for you, too?
—
Reply to this email directly, view it on GitHub
<#471 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOF4RZGUT4NSRDBUHKIVM3XZQVZXANCNFSM6AAAAAA3A5YGM4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
This message may have been spell checked by a laptop kitten.
|
sudo dmidecode -t bios |
***@***.***:/var/log$ sudo dmidecode -t bios
[sudo] password for user:
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 3.3.0 present.
Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
Vendor: 3mdeb
Version: Dasharo (coreboot+UEFI) v1.6.0
Release Date: 03/30/2023
ROM Size: 32 MB
Characteristics:
PCI is supported
PC Card (PCMCIA) is supported
BIOS is upgradeable
Selectable boot is supported
ACPI is supported
Targeted content distribution is supported
BIOS Revision: 1.6
Firmware Revision: 0.0
***@***.***:/var/log$
…On Sun, Sep 10, 2023 at 1:18 PM Piotr Król ***@***.***> wrote:
Same version of the bios that was shipped -- not sure how to tell which one
that is.
sudo dmidecode -t bios
—
Reply to this email directly, view it on GitHub
<#471 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOF4R4QRW2YFRR265NQTDDXZYOCRANCNFSM6AAAAAA3A5YGM4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
This message may have been spell checked by a laptop kitten.
|
Ok, this is cool, especially with the suspend-then-hibernate feature. It seems to work fine, verified on the NV41 Series (12th Gen) with Dasharo v1.6.0 and Xubuntu, but requires some setup. I just set this up for a customer by following this guide. I also installed pm-utils with the command suspend-then-hibernate is very useful for those who disable Intel ME. Because by disabling Intel ME, the suspend mode S0ix (modern standby) uses ~3W instead of ~1W, draining the battery. With this suspend-then-hibernate policy, you can suspend the laptop and trigger hibernation after x seconds/minutes/hours. Plus, it can also increase the laptop's security in combination with disk encryption, although that hasn't been tested yet. |
The problem you're addressing (if any)
Users expect to be able to resume their laptop, even after - let's say - 24 or 48 hours after they put the laptop in suspend mode (either triggered by closing the lid, FN+F12 or selected in the OS).
Describe the solution you'd like
Support for hibernation (S4) and suspend-then-hibernate.
Where is the value to a user, and who might that user be?
Even though hibernation is relatively little used, hibernation can still be triggered in most GNU/Linux operating systems and Windows.
Moreover, it can be a perfect solution for HAP disabled devices without S3 support. In such case, suspend mode doesn't reach the lowest power state, causing the battery to drain in suspend mode.
But even for S3 supported devices, it can help tremendously to extend the battery life while suspending. For example, users might be able to setup a suspend-then-hibernate policy. This would mean that if the laptop wasn't resumed from suspend after x hours, the laptop would hibernate. This would save a lot of energy, meaning almost no battery is being drained while in suspend mode.
Obviously, it would be a requirement to restore the state of all applications after resuming from hibernation (as it should be).
Describe alternatives you've considered
We are aware that hibernation requires a swap partition and a modified GRUB configuration in order to work. In some cases, the operating system files need to be changed as well. Nevertheless, we didn't succeed in getting hibernation working in either GNU/Linux nor Windows.
Additional context
No response
The text was updated successfully, but these errors were encountered: