System do not wake up after suspend

I already went trough a lot of posts about this but I don’t have a clear understanding what I need to do.

So the situations is that my laptop Asus TUF Gaming A15 laptop (AMD Renoir + Nvidia GPU) doesn’t wake up after every suspend. Sometimes it does wake up, but most often it doesn’t.

I try to avoid suspend now and instead use hibernate (as it at least stops battery drain, not like [s2idle] which is useless), but sometimes when I’m on battery and get distracted, it suspends and then all my work is gone. So this problem is very serious for me.

So my 2 problems are:

  1. Laptop does not wake up after suspend. I will provide any logs you need.
    journalctl -p3 -b-1 -- Journal begins at Sat 2021-05-22 19:15:00 EEST, ends at Tue 2021-08-03 15:33:01 EEST. -- авг 03 14:02:09 kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_TZ.THRM._SCP.CTYP], AE_NOT_FOUND (20210105/psargs-330) авг 03 14:02:09 denijane kernel: ACPI Error: Aborting method \_TZ.THRM._SCP due to previous error (AE_NOT_FOUND) (20210105/psparse-529) авг 03 14:02:09 denijane kernel: sp5100-tco sp5100-tco: Watchdog hardware is disabled

`mhwd --pci -li

Installed PCI configs:


              NAME               VERSION          FREEDRIVER           TYPE

video-hybrid-amd-nvidia-prime 2020.11.30 false PCI
video-linux 2018.05.04 true PCI
`
2. The other problem I have is I really don’t like [s2idle] . Is there any way to use deep sleep? I couldn’t find that option in the BIOS so it’s not settable from there.

The Problem is the Ryzen CPU. Please read this page: Ryzen - ArchWiki
" Freeze on shutdown, reboot and suspend "

Thanks, I read somewhere it freezes when there is something using the video driver and yesterday it indeed froze after trying to resume, the video showed on screen and then a black screen. Today it just died without any obvious reason (though maybe Steam had some video on). This link you suggest says it’s because of the CPU. Is there a way to confirm what is the problem?
Also, the first solution is to change BIOS but my BIOS doesn’t have that setting. The other option is to stop the c-state with processor.max_cstates=1. Do I need the c-state and will this option work if written as a GRUB option?

The cstate influences the energy-saving function of the cpu.
in general, at least the c6 should be switched off.
I use a Ryzen CPU myself and have installed the script: AUR (en) - disable-c6-systemd

In connection with the grub entry “idle = nomwait” to avoid sporadic freezing, it is now stable for me.

Well, so far my laptop has frozen maybe twice while working, most cases were after wake up. But ok, I’ll try this, also the script. Do you think your CPU still works that quitely? Because I’m not using suspend now, because I just let the laptop on during the night, it’s that quiet.

Yes, it works wonderfully.
I usually run my Lenovo laptop permanently via external HDMI and use the suspend mode a lot.

On a second device with a Ryzen CPU (and Debian) I had to add a grub entry because not all USB devices always switched off. But once it is set up correctly, it works.

Thanks for the super helpful replies. I added “idle = nomwait” to grub and installed the script. Any other useful suggestions for grub commands for this laptop? Do you have “iommu=soft” or “sysrq_always_enabled=1” (for the REISUB)? Or anyhting else useful?
I love my laptop so far, except for the suspend drama, it works lovely.

I don’t think you need any further contributions.
Depending on the additional hardware, “usbcore.autosuspend = -1” was necessary for me. This means that USb devices are no longer put to sleep. (but a little more energy consumption)
With things like that, all you can do is test to see if it works. Only if there are still problems would I add this.

Well, it doesn’t seem that the modifications helped. Suspending still causes a freeze every second time (also it never shuts down for example keyboard backlight which is pretty annoying). I still don’t have observations on the stability, hopefully it helps for this.

I was thinking to try tomodify the acpi tables to enable s3 deep sleep. But I see that I’m missing a kernel config for ssdt to work (i.e. CONFIG_ACPI_PROCFS=y) . So I may need to recompile the kernel. Do you (or anyone reading this) have any suggestions about that? I may have to post another thread, though.

Also here is a dump on what caused my last failed wake up. I think it’s related to the script I installed but I’m not sure if it’s just about the script or a more general problem.

'авг 04 13:21:12 denijane kernel: ACPI BIOS Error (bug): Could not resolve symbol [_TZ.THRM._SCP.CTYP], AE_NOT_FOUND (20210105/psargs-330)
авг 04 13:21:12 denijane kernel: ACPI Error: Aborting method _TZ.THRM._SCP due to previous error (AE_NOT_FOUND) (20210105/psparse-529)
авг 04 13:21:12 denijane kernel: sp5100-tco sp5100-tco: Watchdog hardware is disabled
авг 04 13:21:19 denijane kwin_x11[1405]: kwin_core: Compositing is not possible
авг 04 13:21:43 denijane systemd[1]: Timed out starting Restart display-manager if amdgpu initialization failed.
авг 04 13:22:13 denijane kernel: ucsi_acpi USBC000:00: PPM init failed (-110)
авг 04 13:54:37 denijane kernel:
авг 04 18:01:48 denijane kernel: amdgpu 0000:05:00.0: amdgpu: failed send message: SetGfxCGPG (47) param: 0x00000001 response 0xff
авг 04 18:01:48 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Msg issuing pre-check failed and SMU may be not in the right state!
авг 04 18:01:48 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Failed to power ungate SDMA!
авг 04 18:01:48 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Msg issuing pre-check failed and SMU may be not in the right state!
авг 04 18:01:48 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Failed to update WMTABLE!
авг 04 18:01:48 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Msg issuing pre-check failed and SMU may be not in the right state!
авг 04 18:01:48 denijane kernel: [drm:smu_v12_0_gfx_off_control [amdgpu]] ERROR disable gfxoff timeout and failed!
авг 04 18:01:48 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Failed to disable gfxoff!
авг 04 18:01:48 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Msg issuing pre-check failed and SMU may be not in the right state!
авг 04 18:01:48 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Fail to set workload type 2
авг 04 18:01:48 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Msg issuing pre-check failed and SMU may be not in the right state!
авг 04 18:01:48 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Failed to power ungate VCN!
авг 04 18:01:48 denijane kernel: [drm:amdgpu_dpm_enable_uvd [amdgpu]] ERROR Dpm enable uvd failed, ret = -5.
авг 04 18:01:48 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Msg issuing pre-check failed and SMU may be not in the right state!
авг 04 18:01:48 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Failed to power ungate JPEG!
авг 04 18:01:48 denijane kernel: [drm:jpeg_v2_0_set_powergating_state [amdgpu]] ERROR Dpm enable jpeg failed, ret = -5.
авг 04 18:01:48 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Msg issuing pre-check failed and SMU may be not in the right state!
авг 04 18:02:05 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Msg issuing pre-check failed and SMU may be not in the right state!
авг 04 18:02:05 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Attempt to get max GX frequency from SMC Failed !
авг 04 18:02:05 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Msg issuing pre-check failed and SMU may be not in the right state!
авг 04 18:02:05 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Failed to disable gfxoff!
авг 04 18:02:05 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Msg issuing pre-check failed and SMU may be not in the right state!
авг 04 18:02:05 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Attempt to get max GX frequency from SMC Failed !
авг 04 18:02:12 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Msg issuing pre-check failed and SMU may be not in the right state!
авг 04 18:02:12 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Failed to power gate SDMA!
авг 04 18:02:12 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Msg issuing pre-check failed and SMU may be not in the right state!
авг 04 18:02:12 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Failed to SetDriverDramAddr!
авг 04 18:02:12 denijane kernel: amdgpu 0000:05:00.0: amdgpu: Failed to setup smc hw!
авг 04 18:02:12 denijane kernel: [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] ERROR resume of IP block failed -5
авг 04 18:02:12 denijane kernel: amdgpu 0000:05:00.0: amdgpu: amdgpu_device_ip_resume failed (-5).
авг 04 18:02:12 denijane kernel: PM: dpm_run_callback(): pci_pm_resume+0x0/0xe0 returns -5
авг 04 18:02:12 denijane kernel: amdgpu 0000:05:00.0: PM: failed to resume async: error -5
авг 04 18:02:12 denijane kernel: amdgpu: Move buffer fallback to memcpy unavailable
авг 04 18:02:12 denijane kernel: amdgpu 0000:05:00.0: amdgpu: 0000000037c60dae pin failed
авг 04 18:02:12 denijane kernel: [drm:dm_plane_helper_prepare_fb [amdgpu]] ERROR Failed to pin framebuffer with error -19
авг 04 18:02:12 denijane kernel: amdgpu: Move buffer fallback to memcpy unavailable
авг 04 18:02:12 denijane kernel: [drm:amdgpu_cs_ioctl [amdgpu]] ERROR Failed to process the buffer list -19!
авг 04 18:02:20 denijane kernel: [drm:amdgpu_dm_atomic_commit_tail [amdgpu]] ERROR Waiting for fences timed out!
авг 04 18:02:22 denijane kernel: [drm:amdgpu_job_timedout [amdgpu]] ERROR ring sdma0 timeout, signaled seq=16233, emitted seq=16235
авг 04 18:02:22 denijane kernel: [drm:amdgpu_job_timedout [amdgpu]] ERROR Process information: process pid 0 thread pid 0

habe you start the service and check the cstate after this action?

Well, I’m not sure how to check the cstate, after googling I got:
grep . /sys/devices/system/cpu/cpu0/cpuidle/state*/name
/sys/devices/system/cpu/cpu0/cpuidle/state0/name:POLL
/sys/devices/system/cpu/cpu0/cpuidle/state1/name:C1
/sys/devices/system/cpu/cpu0/cpuidle/state2/name:C2
/sys/devices/system/cpu/cpu0/cpuidle/state3/name:C3

After I redid the installation + starting the service, it still shows the same info for the cstate.

The script (here the homepage: GitHub - jfredrickson/disable-c6: A systemd service to disable the C6 state upon system boot, preventing Ryzen freezes.)
has a function of its own to check the current status.
For this to work, however, the MSR module must also be loaded when booting.
More details are also on this page or in the man page of the script;)
Unfortunately, it doesn’t work out that simple: D

What kernel version are you using?
For me (Lenovo Laptop with Ryzen 5 4600U), finally suspend and resume works again since the update to 5.13.3 or .4, and it even has reasonable battery drain now without the previously necessary ACPI patch.

I’m with 5.12. I’ll try the 5.13, hopefully all finally works. After installing the script, my touchpad doesn’t work every second reboot so I guess that’s not a good solution. I’ll see how it is with the new kernel. But I think I’ll try to enable the deep sleep, because I really don’t see the point in a suspend which is basically turning off the screen. I don’t get why would anyone impose this standard over the previous, very nicely working sleep to ram.

Try it out. For me it has finally fixed the issues I had with suspend/resume, after it didn’t work at all with anything post 5.11.6 for the past 3 or 4 months.
Importantly, it seems to enter deep sleep, or at least battery drain is very close to it and my status LED is slowly pulsing as it did before.

Oh, if this is so, that would be great. I really really need my working deep sleep. With my previous laptop and Sabayon, I would suspend the laptop every night for more than a month, without any problem. So obviously now my workflow suffers. Do you have observations on 5.14? Is it good? I just installed 5.13 and I’ll try it when it crashes next time.

Haven’t tried 5.14 yet, since 5.13 works for me now.
There might be further improvements or it might work correctly on more systems, but that’s just an assumption. Unless something else comes up, I’ll switch at some point after release, likely once it had a few point releases.

Well my experiment with 5.13 showed that on the first suspend, upone waking up, it kept on showing me a log off screen whatever button or mouse I press, on the second, it froze again. So I don’t think 5.13 fixes it for me. I’ll try 5.14 now.

Another approach could be tested here.
A friend of mine has the same problem with a Lenovo laptop (amd 3500u / Debian).
Since he has been using the XanMod kernel, he no longer has a freeze.
I have not yet been able to find out whether it is due to the CPU governor → performance or other adjustments. Which also avoids the cstate 6.