Skip to content
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

S3 not being advertised after patch #10

Open
mynameisfiber opened this issue Nov 14, 2020 · 17 comments
Open

S3 not being advertised after patch #10

mynameisfiber opened this issue Nov 14, 2020 · 17 comments

Comments

@mynameisfiber
Copy link

mynameisfiber commented Nov 14, 2020

Hello!

I tried the instructions in your repo and still wasn't able to get S3 to be advertised. I looked at #6 and #7 but my problem seems to be different. I have the following in my /etc/default/grub:

GRUB_EARLY_INITRD_LINUX_CUSTOM="acpi_s3_override"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mem_sleep_default=deep"

Poking around I see:

root@charm:/boot# dmesg | grep "ACPI:" | grep support
[    0.380853] ACPI: (supports S0 S4 S5)

root@charm:/boot# cat /sys/power/mem_sleep
[s2idle]

root@charm:/boot# cat /etc/issue
Ubuntu 20.10 \n \l

root@charm:/boot# uname -a
Linux charm 5.8.0-28-generic #30-Ubuntu SMP Thu Nov 5 13:24:33 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Here is the compiled grub.cfg and the actual override file:
grub_override.tar.gz

Any thoughts as to what is happening? Thanks!

@mynameisfiber
Copy link
Author

Ah... I think this is a secure boot issue. From dmesg:

[    0.005017] ACPI: kernel is locked down, ignoring table override

@mynameisfiber
Copy link
Author

mynameisfiber commented Nov 14, 2020

It seems that there is no way around having secure boot and a table override at the same time. I've disabled validation using sudo mokutil --disable-validation for now in the hopes that once this issue is fully resolved i can re-enable it. With secure boot disabled, your patch works perfectly! Thanks for having it so well documented.

@jrandiny
Copy link
Owner

jrandiny commented Nov 15, 2020

Have you tried self signing the kernel?

I can confirm that I'm running with secure boot enabled

image

@mynameisfiber
Copy link
Author

@jrandiny This is my first time going down the secure boot rabbit hole, so maybe I'm doing it wrong! I tried using sbsign to sign the acpi override file, but that doesn't seem to be a valid route. I'm using the vanilla ubuntu 20.10 kernel so that came in pre-signed. How should I go about signing things so that the override is supported?

@jrandiny
Copy link
Owner

jrandiny commented Nov 15, 2020

Hmmm, I think I know why, kernel lockdown is a different feature from secure boot. Kernel lockdown is configured on kernel compile time and it seems that the behavior for stock kernel is to enable lockdown when it detect secure boot is enabled (I verify this by running the stock kernel on my machine). I'm currently using the mainline kernel signed with MOK which seems to disable this behaviour.

Edit: I haven't been able to get the list of Ubuntu kernel specific patch to confirm this behaviour. However from https://lore.kernel.org/lkml/CACdnJuti5Riqoi1sesqPALYHq9LT87o4MFj-0Y5BZqqzJ5579g@mail.gmail.com/ it seems that a lot of distro is enabling this by default.

@mynameisfiber
Copy link
Author

Ah yes! I thought the behavior of locking down the kernel on secure boot was default. I'd rather stick to the stock kernel so I guess my best bet is to keep secure boot off until there is a proper fix.

@StarGW-net
Copy link

I gave up on the laptop trying to support S3 suspend. The default S0 suspend takes too much power and there is the issue with the screen recovering after S0 suspend.

In the end I went for S4 Hibernate which suits my requirements better anyway and uses no power. However to get S4 Hibernate to work with full disk encryption I had to turn off Secure Boot.

https://www.stargw.net/wiki/Lenovo%20Yoga%20Slim%207/index.html#Hibernate

@sarvasana
Copy link

I gave up on the laptop trying to support S3 suspend. The default S0 suspend takes too much power and there is the issue with the screen recovering after S0 suspend.

In the end I went for S4 Hibernate which suits my requirements better anyway and uses no power. However to get S4 Hibernate to work with full disk encryption I had to turn off Secure Boot.

https://www.stargw.net/wiki/Lenovo%20Yoga%20Slim%207/index.html#Hibernate

That is what I did too.
It is a shame that companies like Lenovo lock machines this way.

@StarGW-net
Copy link

Ok, I after using the Lenovo with hibernate after a week, a few times it fails to resume from hibernate and this seems to be because of a similar issue encountered in resuming from S0 suspend:

Seems to crash setting the backlight:

WARNING: CPU: 4 PID: 10460 at drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:2546 dc_link_set_backlight_level+0x92/0xf0 [amdgpu]
...
Feb 09 14:57:01 stealth kernel: amdgpu 0000:03:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring kiq_2.1.0 test failed (-110)
Feb 09 14:57:01 stealth kernel: [drm:amdgpu_gfx_enable_kcq.cold [amdgpu]] *ERROR* KCQ enable failed
Feb 09 14:57:01 stealth kernel: [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block  failed -110
Feb 09 14:57:01 stealth kernel: [drm:amdgpu_device_resume [amdgpu]] *ERROR* amdgpu_device_ip_resume failed (-110).
Feb 09 14:57:01 stealth kernel: PM: dpm_run_callback(): pci_pm_restore+0x0/0xf0 returns -110
Feb 09 14:57:01 stealth kernel: PM: Device 0000:03:00.0 failed to restore async: error -110

Full logs at:

https://www.stargw.net/wiki/Lenovo%20Yoga%20Slim%207/hibernate.html

A quick check on the Internet and it seems quite a lot of people have issues with Ryzen integrated graphics and suspend/hibernate resuming, and its not limited to the Lenovo Yoga.

@StarGW-net
Copy link

After having hibernate working for nearly a year I was forced to upgrade from Ubuntu Budgie 21.04 (unsupported) to 21.10. Now hibernate is fully broken.

Even "systemctl hibernate" does not work. The system thinks its hibernating and all the logs indicate its hibernating, but the screen stays on. Apart from that, the system is unresponsive. I can only recover by long press the power key, in which case it does a full reboot.

No idea what is broken now.

@sarvasana
Copy link

I gave up on patching and decided to void warranty and alter the bios.

https://github.com/esno/yoga-bios-unlock

@StarGW-net
Copy link

No idea what is broken now.

Turns out that its shutdown that is broken. Even powering off my laptop it hangs. Turning off the splash screen I get:

shutdown[1]: Could not detach DM /dev/dm-0: Device or resource busy
shutdown[1]: Failed to finalize file systems, DM devices, ignoring.

And the laptop never shuts down. So maybe that is why hibernate and suspend now fail.

If I boot the old kernel 5.11.0-49-generic instead of 5.13.0-27-generic it all works again. Note I still see the same error messages, but the machine powers off or hibernates as okay.

Ah well I have spent far too much time on this will just boot Ubuntu 21.10 off kernel 5.11.0-49-generic for now

@benoe77
Copy link

benoe77 commented Jan 24, 2022

There is a launchpad bug report about this hang as well:

https://bugs.launchpad.net/ubuntu/+source/linux-hwe-5.13/+bug/1958289

@arnaud-feldmann
Copy link

arnaud-feldmann commented Jan 25, 2022

@nightflame2 i was under 5.13.22 and had updated to 5.13.23 and then shutdown was broken. Reverted and it works (but not suspend).
I have tried 5.15 also ; the suspend was still unstable

@StarGW-net
Copy link

I can report that kernel 5.13.0-28 fixes the shutdown issue for me. Ubuntu Budgie.

@arnaud-feldmann
Copy link

arnaud-feldmann commented Feb 4, 2022

@nightflame2 confirmed for me too, thanks

@mirao
Copy link

mirao commented Mar 18, 2023

I'm running Ubuntu 22.10 with an official kernel 5.19.0-35-generic. Originally I forgot to disable "Secure boot" in BIOS and S3 still was not advertised. Fortunately there is an info about that issue here.

Now it's working:

$ mokutil --sb-state
SecureBoot disabled
$ dmesg | grep "ACPI:" | grep support
[    0.297702] ACPI: PM: (supports S0 S3 S4 S5)
$ cat /sys/power/mem_sleep 
s2idle [deep]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants