Framework 13 AMD sleep/s2idle issues

The “disabled” wakeups do not survive a reboot. You will have to type the echo commands in again to test it again. They will survive a suspend/wake cycle, but not a reboot.
If the tests with the commands work well, then we put them in a config file so that they are activated every time one suspends and are permanent.
The config file looks something like this. You replace the echo lines with the ones that work for you. This file is for a FW16, the echo lines are different for a FW13:

#!/bin/sh
# This file should be placed in: /usr/lib/systemd/system-sleep

PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "$1" in
	pre)	#echo AMDI0010:03 >/sys/bus/platform/drivers/i2c_designware/unbind
		#echo 1-4 >/sys/bus/usb/drivers/usb/unbind
		/home/jcd/computer/framework/qmk_hid/target/debug/qmk_hid via --backlight 0
		echo disabled > /sys/devices/pci0000:00/0000:00:08.1/0000:c1:00.3/usb1/1-4/1-4.3/power/wakeup
		echo disabled > /sys/devices/platform/AMDI0010:03/i2c-1/i2c-PIXA3854:00/power/wakeup
		echo disabled >/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4b/PNP0C09:00/PNP0C0D:00/power/wakeup
		exit 0
		;;
	post)	#echo AMDI0010:03 >/sys/bus/platform/drivers/i2c_designware/bind
		#echo 1-4 >/sys/bus/usb/drivers/usb/bind
		exit 0
		;;
 	*)	exit 1
		;;
esac

The BIOS writes to the flash of the EC. You don’t need to update the EC firmware on its own, the BIOS will overwrite that.
The EC will reset itself if you leave the laptop powered off (not suspended) for long enough. When you do “ectool console” the numbers at the start of the line are seconds since the EC last rebooted. If you leave the laptop powered off overnight, that should be enough.
You can go into the BIOS and disconnect the battery with a setting if you wish to do the EC reboot quicker, but I don’t think that is the problem here.

I re-applied all the disabled between reboots. Disabling the power/keyboard/touchpad does not consistently allow the computer to sleep.

After a night with the power off the EC has been reset and now I get 95+% sleep without disabling any wakeups. Now the report reads wakeup from IRQ 1 and not the PS/2 controller like the reports before.

Is there a way to isolate if it’s a defective input cover (some hardware on the input cover that is)?

Please can you post a sleep “report” with the power/keyboard/touchpad disabled with the echo commands. I wish to check it is actually disabling what it should.

This is right after the echo commands: https://gist.githubusercontent.com/ripdajacker/008dc2f2e92b7f13320f55ac95c43c25/raw/05f1c7eac969e83063b9eacbc1ac7458d807245a/gistfile1.txt

That “report” is showing it working correctly, you asked for it to sleep for about 60 seconds and it did sleep for about 60 seconds. It is never going to be super accurate time wise, because various devices take different amount of time to “sleep”. Within a few seconds is good enough.

|2024-07-30 22:52:31,648 INFO:|✅ Userspace suspended for 0:01:01.997840|
|---|---|
|2024-07-30 22:52:31,648 DEBUG:|Kernel suspended for total of 0:00:58.791000 (94.83%)|
|2024-07-30 22:52:31,648 INFO:|✅ In a hardware sleep state for 0:00:58.251556 (93.96%)|

Also, it seems to have missed the “lid” disabled, so maybe the echo line for that is currently wrong.

Yes it started sleeping correctly after it was out of battery a whole night but after a day or so it is back to being flaky. This is with the correct wakeups disabled, 4 times 120sec:

https://gist.githubusercontent.com/ripdajacker/6d04a5dd92922686e50f1f845a4f0c6a/raw/12f8ebc158a4a274c17906122f5d33b6d5fddca4/gistfile1.txt

The ectool output after:

[54974.000100 KB Clear Buffer]
[54974.027700 KB unsupported cmd: 0x00]
[54974.028700 KB Clear Buffer]
PORT80: 1015
[54974.063200 KB unsupported cmd: 0x00]
[54974.064200 KB Clear Buffer]
PORT80: 3F56
PORT80: F90E
PORT80: 3F80
[54974.193800 PH S0ix]
[54974.194700 power state 16 = S0ix->S0, in 0x000f]
[54974.195800 PH S0ixS0]
[54974.198100 Power saving disable]
[54974.201400 PH S0ixS0->S0]
[54974.202700 power state 4 = S0, in 0x000f]
PORT80: 3C01
PORT80: 0DB5
[54974.272300 KS disable]
[54974.273300 KB Clear Buffer]
[54974.276700 KS enable]
[54974.278500 KB Clear Buffer]
PORT80: 3050
[54974.282800 event set 0x0400000000000000]
PORT80: 003B
[54974.304000 event set 0x0400000000000000]
PORT80: 003B
[54974.322900 event set 0x0400000000000000]
[54974.340900 event set 0x0400000000000000]
PORT80: 003B
[54974.360100 event set 0x0400000000000000]
PORT80: 003B
PORT80: 003B
[54974.382100 event set 0x0400000000000000]
PORT80: 003B
[54974.407400 event set 0x0400000000000000]
[54974.426700 event set 0x0400000000000000]
PORT80: AA8F
[54974.444800 event set 0x0400000000000000]
PORT80: 003B
[54974.463800 event set 0x0400000000000000]
PORT80: 003B
[54974.481900 event set 0x0400000000000000]
PORT80: 003B
PORT80: 3F84
PORT80: 3F74
PORT80: 3F78
PORT80: 3F34
PORT80: 3C08
[54978.532400 KB Clear Buffer]
PORT80: 3F30
PORT80: 0DB4
PORT80: F90E
PORT80: 30D5
PORT80: 3F58
[54978.828100 power state 17 = S0->S0ix, in 0x000f]
[54978.829400 PH S0->S0ix]
[54978.831700 Power saving enable]
[54978.834400 PH S0S0ix->S0ix]
[54978.835300 power state 5 = S0ix, in 0x000f]
[54978.836500 PH S0ix]
PORT80: 00C7
PORT80: F626
PORT80: 0026
[54979.425300 power state 5 = S0ix, in 0x000d]
[54979.426400 PH S0ix]
[54979.427200 power state 18 = S0ix->S3, in 0x000d]
[54979.428400 PH S0ixS3]
[54979.514400 PH S0ixS0->S3]
[54979.515400 power state 3 = S3, in 0x0005]
[55039.007000 Battery 49% (Display 48.2 %) / 53h:9 to empty]
[55097.223700 power state 3 = S3, in 0x0007]
[55097.224900 power state 19 = S3->S0ix, in 0x0007]
[55097.226000 PH S3->S0ix]
[55097.258100 PH S3S0ix->S0ix]
[55097.259200 power state 5 = S0ix, in 0x000f]
[55097.260200 PH S0ix]
PORT80: 0000
PORT80: 0000
PORT80: 0200
PORT80: 0000
[55097.441500 KB unsupported cmd: 0x00]
[55097.442500 KB Clear Buffer]
[55097.469900 KB unsupported cmd: 0x00]
[55097.471000 KB Clear Buffer]
[55097.498800 KB unsupported cmd: 0x00]
[55097.499900 KB Clear Buffer]
[55097.528000 KB unsupported cmd: 0x00]
[55097.529100 KB Clear Buffer]
[55097.556900 KB unsupported cmd: 0x00]
[55097.557900 KB Clear Buffer]
PORT80: 1015
[55097.591500 KB unsupported cmd: 0x00]
[55097.592600 KB Clear Buffer]
PORT80: 3F66
PORT80: 0000
PORT80: 3F40
PORT80: 0DB4
[55097.784600 PH S0ix]
[55097.785500 power state 16 = S0ix->S0, in 0x000f]
[55097.786500 PH S0ixS0]
[55097.788900 Power saving disable]
[55097.792700 PH S0ixS0->S0]
[55097.793600 power state 4 = S0, in 0x000f]
PORT80: 1001
[55097.818300 KS disable]
[55097.819200 KB Clear Buffer]
[55097.821600 KS enable]
[55097.822500 KB Clear Buffer]
PORT80: 3050
[55097.833000 event set 0x0400000000000000]
PORT80: 003B
[55097.860300 event set 0x0400000000000000]
[55097.879100 event set 0x0400000000000000]
PORT80: 003B
[55097.897500 event set 0x0400000000000000]
PORT80: 003B
[55097.916200 event set 0x0400000000000000]
PORT80: 003B
PORT80: 003B
[55097.938000 event set 0x0400000000000000]
PORT80: 003B
[55097.963400 event set 0x0400000000000000]
PORT80: AA8F
[55097.988900 event set 0x0400000000000000]
[55098.006500 event set 0x0400000000000000]
PORT80: 003B
[55098.025200 event set 0x0400000000000000]
PORT80: 003B
[55098.043100 event set 0x0400000000000000]
PORT80: 3F44
PORT80: 3F88
PORT80: 3F78
PORT80: 3F34
PORT80: 3C08
[55112.111300 Battery 49% (Display 48.1 %) / 5h:2 to empty]
PORT80: F022
PORT80: F90E
PORT80: 3F64
PORT80: 3F68
[55152.922900 Battery 49% (Display 48.0 %) / 4h:50 to empty]
PORT80: F90E
[55184.720500 Battery 49% (Display 47.9 %) / 5h:7 to empty]
PORT80: 393D
PORT80: 0DB5
PORT80: 0DB7
PORT80: 3C01
[55214.096800 HC 0x000b]
[55214.098400 HC Suppressed: 0x97=3 0x98=54 0x113=0 0x103=0 0x115=0 0x2b=0 0x67=0 0x121=0]

I see now.
Summary of where we are:

  1. By looking at the “report”, I can see all the correct things had wakeup disabled with the echo lines.
  2. Of the 4 times you tested for. The first 2 were bad, the second 2 were good.
  3. Removing the input cover makes the sleeps good. I.e. stay asleep when needed.
    Just checking, but how sure are you about the cause being something on the input cover waking it up?
  4. With the input cover present, and wakeup disabled for LID, Keyboard, Touchpad, Power button but it still wakes up.
  5. Fingerprint sensor: This is not causing the problem because you have already tried disabling the fingerprint sensor in the BIOS and it did not help.
  6. Kernel in use: Fedora 40: Kernel 6.9.9-200.fc40.x86_64

The only remaining things to try are:

  1. Chassis Open sensor - I don’t know if this causes a wakeup. I guess you might be able to test it by removing the input cover, suspend, and see if pressing on/off the Chassic open sensor causes it to wake.
    Another way to test this would be to partially remove the input cover, leaving the cables connected, but the input cover not pressing the Chassis Open sensor.

  2. The problem seems to be intermittent, in the sense that it wakes up badly only some of the time. Maybe a slightly loose cable on the input cover somewhere?

  3. Something else, but I don’t know what that might be.

I guess a work around for this at the moment, is when you wish the laptop too sleep, use the sleep script with a long sleep time and multi repeats, so if the laptop does wake up, the script sends it to sleep again.

First: I tried the chassis open sensor and it makes no difference.

A cable being loose could be the culprit but wouldn’t it be blocked by the disabling of keyboard, pwr buttong and touchpad wakeups?

To sum up:
I re-did the input cover lidt test just now and it slept 5x5min with and without the cover on.
The problem does in fact seem to be intermittent and not easily reproducible and it’s frankly quite frustrating.

I close and open the computer many times a day so the workaround seems to be fairly involved. Can we somehow disable all wakeups except for the power button and the lid sensor?

This script placed in the right place will disable all wake ups except the Power button. I would be interested to see if it helps or not.

#!/bin/sh
# This file should be placed in directory: /usr/lib/systemd/system-sleep

PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "$1" in
  pre)
    # Disable all wakeup devices except for the power button
    find /sys/devices -path '*/power/wakeup' ! -path '*/PNP0C0C:00/*' |
      while read wakeup; do echo disabled > $wakeup; done
    exit 0
    ;;
  post)
    exit 0
    ;;
  *)
    exit 1
    ;;
esac
» cat /usr/lib/systemd/system-sleep/00-on-sleep-disable-wakeups.sh                                                                                                                                1 ↵
#!/bin/sh
# This file should be placed in directory: /usr/lib/systemd/system-sleep

PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "$1" in
  pre)
    # Disable all wakeup devices except for the power button
    find /sys/devices -path '*/power/wakeup' ! -path '*/PNP0C0C:00/*' |
      while read wakeup; do echo disabled > $wakeup; done
    exit 0
    ;;
  post)
    exit 0
    ;;
  *)
    exit 1
    ;;
esac

The s2idle report: https://gist.githubusercontent.com/ripdajacker/0af6910f756f0c8f778448753ebb4612/raw/4f90232f67fdca27078f5635e26ca6e8d4c76bd5/gistfile2.txt

The dmesg dump after the wakeup: https://gist.githubusercontent.com/ripdajacker/0af6910f756f0c8f778448753ebb4612/raw/4f90232f67fdca27078f5635e26ca6e8d4c76bd5/gistfile1.txt

I forgot to mention, that script runs as it is about to suspend.
So, you kind of need to do one sleep / wake cycle before starting the test.
Otherwise the “Wakeup sources” section in the report is inaccurate.
From the report, it looks like the sleep / wake is working ok.
After the script has run, the “Wakeup sources” section should be very short with only the power button there.

Alternatively, you can manually run the disable all wakeup except power button with:

find /sys/devices -path '*/power/wakeup' ! -path '*/PNP0C0C:00/*' | while read wakeup; do echo disabled > $wakeup; done

and then run the sleep “amd_s2idle.py” script

If I have the script installed the computer does not wake up from a normal sleep cycle (only from the first one). If I hit sleep in the shutdown menu or close the lid the computer just freezes upon wakeup.

Running sudo journalctl -b -1 gives me:

Jul 31 20:13:51 jm-framework audit[4034]: AVC avc:  denied  { execute } for  pid=4034 comm="(direxec)" name="00-on-sleep-disable-wakeups.sh" dev="nvme0n1p3" ino=265863 scontext=system_u:system_r:systemd_sleep_t:s0 tcontext>
Jul 31 20:13:51 jm-framework (direxec)[4034]: Failed to execute /usr/lib/systemd/system-sleep/00-on-sleep-disable-wakeups.sh: Permission denied
Jul 31 20:13:51 jm-framework (sd-exec-strv)[4033]: /usr/lib/systemd/system-sleep/00-on-sleep-disable-wakeups.sh failed with exit status 1.
Jul 31 20:13:51 jm-framework systemd-sleep[4019]: Performing sleep operation 'suspend'...
Jul 31 20:13:51 jm-framework kernel: PM: suspend entry (s2idle)

The script has a+rx permissions.

What do you mean by freezes upon wakeup?
So, you press the power button and something happens that shows it exited out of sleep and then it just freezes?
Or, does it never exit from sleep and the fade in/out LED stays in fade in/out mode, thus never exiting from sleep mode?
This is something new, and might be a different bug to look into.

The plot thickens :smile:

When I disable wakeup from all devices things get a little weird.

The s2idle script does not wake up at the specified interval (which is expected), but does so with the power button. No reaction on keyboard press when it is sleeping.

When I suspend using the sleep button in the KDE menu: same as above, but I return to a locked screen instead of the desktop (as expected).

When I close the lid, open it again I get one or two correct wakeups, but then I am greeted with a black background with a movable cursor. No desktop environment, no login screen, CTRL+ALT+F# does not switch to a TTY.

In this state the keyboard backlight lights up when I press a button on the keyboard, but does not wake the computer up. Only the power button does that, but I can only recover from it with a hard shutdown.

I tested with:

  • Power plugged in
  • On battery
  • With the script in the systemd sleep folder
  • Running the script manually before causing it to sleep

It seems that the lid close does something more than whatever the s2idle script does.

Edit: The power button was doing the fade in/fade out mode in all modes of sleep in all tests

So, it looks like disabling wakeup on everything is at least making it stay asleep.
That was the aim. i.e. when you “sleep” the laptop, it stays asleep.
Can you confirm that it always stays asleep now?

The no desktop, no login screen is actually a separate, different problem. Its a GPU driver problem.
If you leave it in that state for, say, 5 mins, does it recover?
You might have some luck diagnosing that part if you use an ethernet cable to the laptop, and set up sshd on the laptop and ssh into it from another machine. You might then be able to collect “dmesg” logs.

Let me address the first part:

No it does not stay in hardware sleep but userspace does stay suspended, see s2idle report.
I had to wake it manually, tried to give it a minute the first 4 times and cut it short the last because I could se it didn’t hardware sleep.

There are some messages in dmesg regarding min power state, D3hot:

[  462.396396] PM: suspend entry (s2idle)
[  462.407133] Filesystems sync: 0.010 seconds
[  462.407694] Freezing user space processes
[  462.410054] Freezing user space processes completed (elapsed 0.002 seconds)
[  462.410059] OOM killer disabled.
[  462.410061] Freezing remaining freezable tasks
[  462.411108] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[  462.411112] printk: Suspending console(s) (use no_console_suspend to debug)
[  462.411423] wlp1s0: deauthenticating from c0:74:ad:28:33:76 by local choice (Reason: 3=DEAUTH_LEAVING)
[  462.548807] PM: suspend of devices complete after 137.409 msecs
[  462.548818] PM: start suspend of devices complete after 137.677 msecs
[  462.548823] PM: suspend devices took 0.137 seconds
[  462.549561] Disabling GPIO #5 interrupt for suspend.
[  462.549588] Disabling GPIO #84 interrupt for suspend.
[  462.550218] PM: late suspend of devices complete after 1.390 msecs
[  462.551351] ACPI: EC: interrupt blocked
[  462.721158] PM: noirq suspend of devices complete after 170.743 msecs
[  462.721173] ACPI: \_SB_.PCI0.GPP6: LPI: Constraint not met; min power state:D1 current power state:D0
[  462.721181] ACPI: \_SB_.PCI0.GP11.SWUS: LPI: Constraint not met; min power state:D3hot current power state:D0
[  462.721186] ACPI: \_SB_.PCI0.GP12.SWUS: LPI: Constraint not met; min power state:D3hot current power state:D0
[  462.721189] ACPI: \_SB_.PCI0.GPP7.DEV0: LPI: Constraint not met; min power state:D3hot current power state:D0
[  462.721198] ACPI: \_SB_.PCI0.GP19.XHC2: LPI: Constraint not met; min power state:D3hot current power state:D0
[  462.721763] ACPI: \_SB_.PEP_: Successfully transitioned to state screen off
[  462.940639] ACPI: \_SB_.PEP_: Successfully transitioned to state lps0 ms entry
[  462.941345] ACPI: \_SB_.PEP_: Successfully transitioned to state lps0 entry
[  462.941672] PM: suspend-to-idle
[  462.941681] amd_pmc: SMU idlemask s0i3: 0x3ffb3ebd
[  469.590032] Timekeeping suspended for 6.840 seconds
[  523.136420] Timekeeping suspended for 52.999 seconds
[  523.136463] PM: Triggering wakeup from IRQ 9
[  523.136587] ACPI: EC: ACPI EC GPE status set
[  523.136614] ACPI: EC: ACPI EC GPE dispatched
[  523.142788] ACPI: EC: ACPI EC work flushed
[  523.142797] ACPI: PM: Wakeup after ACPI Notify sync
[  523.142799] PM: resume from suspend-to-idle
[  523.143510] ACPI: \_SB_.PEP_: Successfully transitioned to state lps0 exit
[  523.299276] ACPI: \_SB_.PEP_: Successfully transitioned to state lps0 ms exit
[  523.299889] ACPI: \_SB_.PEP_: Successfully transitioned to state screen on
[  523.300366] ACPI: EC: interrupt unblocked
[  523.489241] PM: noirq resume of devices complete after 189.344 msecs

I’ll take a stab at testing part 2 in a bit.

I let it stay in the black screen state for over 5min and no cigar. It did allow me to switch to a tty now. dmesg since previous post:

[ 1109.615642] wlp1s0: deauthenticating from c0:74:ad:28:33:76 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 1110.236003] PM: suspend entry (s2idle)
[ 1110.239782] Filesystems sync: 0.003 seconds
[ 1110.258576] Freezing user space processes
[ 1110.260817] Freezing user space processes completed (elapsed 0.002 seconds)
[ 1110.260822] OOM killer disabled.
[ 1110.260823] Freezing remaining freezable tasks
[ 1110.261774] Freezing remaining freezable tasks completed (elapsed 0.000 seconds)
[ 1110.261778] printk: Suspending console(s) (use no_console_suspend to debug)
[ 1110.403508] PM: suspend devices took 0.141 seconds
[ 1110.405474] ACPI: EC: interrupt blocked
[ 1117.770349] ACPI: EC: interrupt unblocked
[ 1117.972241] [drm] PCIE GART of 512M enabled (table at 0x00000080FFD00000).
[ 1117.972296] amdgpu 0000:c1:00.0: amdgpu: SMU is resuming...
[ 1117.975017] amdgpu 0000:c1:00.0: amdgpu: SMU is resumed successfully!
[ 1117.979910] nvme nvme0: D3 entry latency set to 10 seconds
[ 1117.980463] amdgpu 0000:c1:00.0: [drm] REG_WAIT timeout 1us * 1000 tries - dcn314_dsc_pg_control line:223
[ 1117.981041] nvme nvme0: 8/0/0 default/read/poll queues
[ 1117.983209] amdgpu 0000:c1:00.0: [drm] REG_WAIT timeout 1us * 1000 tries - dcn314_dsc_pg_control line:231
[ 1117.985968] amdgpu 0000:c1:00.0: [drm] REG_WAIT timeout 1us * 1000 tries - dcn314_dsc_pg_control line:239
[ 1117.988999] amdgpu 0000:c1:00.0: [drm] REG_WAIT timeout 1us * 1000 tries - dcn314_dsc_pg_control line:247
[ 1118.179954] [drm] VCN decode and encode initialized successfully(under DPG Mode).
[ 1118.180050] amdgpu 0000:c1:00.0: [drm:jpeg_v4_0_hw_init [amdgpu]] JPEG decode initialized successfully.
[ 1118.180425] amdgpu 0000:c1:00.0: amdgpu: ring gfx_0.0.0 uses VM inv eng 0 on hub 0
[ 1118.180429] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 1 on hub 0
[ 1118.180431] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 4 on hub 0
[ 1118.180433] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 6 on hub 0
[ 1118.180435] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 7 on hub 0
[ 1118.180437] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 8 on hub 0
[ 1118.180439] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 9 on hub 0
[ 1118.180441] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 10 on hub 0
[ 1118.180443] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 11 on hub 0
[ 1118.180445] amdgpu 0000:c1:00.0: amdgpu: ring sdma0 uses VM inv eng 12 on hub 0
[ 1118.180447] amdgpu 0000:c1:00.0: amdgpu: ring vcn_unified_0 uses VM inv eng 0 on hub 8
[ 1118.180449] amdgpu 0000:c1:00.0: amdgpu: ring jpeg_dec uses VM inv eng 1 on hub 8
[ 1118.180451] amdgpu 0000:c1:00.0: amdgpu: ring mes_kiq_3.1.0 uses VM inv eng 13 on hub 0
[ 1118.184865] [drm] ring gfx_32807.1.1 was added
[ 1118.185437] [drm] ring compute_32807.2.2 was added
[ 1118.185952] [drm] ring sdma_32807.3.3 was added
[ 1118.185980] [drm] ring gfx_32807.1.1 ib test pass
[ 1118.186010] [drm] ring compute_32807.2.2 ib test pass
[ 1118.186124] [drm] ring sdma_32807.3.3 ib test pass
[ 1118.192594] PM: resume devices took 0.228 seconds
[ 1118.192871] OOM killer enabled.
[ 1118.192873] Restarting tasks ... done.
[ 1118.196180] random: crng reseeded on system resumption
[ 1118.200949] PM: suspend exit
[ 1118.479607] usb 1-4: reset full-speed USB device number 2 using xhci_hcd
[ 1118.770297] usb 1-4: reset full-speed USB device number 2 using xhci_hcd
[ 1122.160999] wlp1s0: authenticate with c0:74:ad:28:33:76 (local address=62:fe:77:c6:2e:39)
[ 1122.174737] wlp1s0: send auth to c0:74:ad:28:33:76 (try 1/3)
[ 1122.178086] wlp1s0: authenticated
[ 1122.178400] wlp1s0: associate with c0:74:ad:28:33:76 (try 1/3)
[ 1122.192000] wlp1s0: RX AssocResp from c0:74:ad:28:33:76 (capab=0x931 status=0 aid=1)
[ 1122.216084] wlp1s0: associated
[ 1122.244906] wlp1s0: Limiting TX power to 20 (20 - 0) dBm as advertised by c0:74:ad:28:33:76
[ 1126.536736] wlp1s0: deauthenticating from c0:74:ad:28:33:76 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 1127.611388] PM: suspend entry (s2idle)
[ 1127.615477] Filesystems sync: 0.004 seconds
[ 1127.615888] Freezing user space processes
[ 1127.617683] Freezing user space processes completed (elapsed 0.001 seconds)
[ 1127.617687] OOM killer disabled.
[ 1127.617689] Freezing remaining freezable tasks
[ 1127.618637] Freezing remaining freezable tasks completed (elapsed 0.000 seconds)
[ 1127.618641] printk: Suspending console(s) (use no_console_suspend to debug)
[ 1127.631259] queueing ieee80211 work while going to suspend
[ 1127.762397] PM: suspend devices took 0.143 seconds
[ 1127.764499] ACPI: EC: interrupt blocked
[ 1138.398087] Reading current time from RTC took around 236 ms
[ 1138.562994] ACPI: EC: interrupt unblocked
[ 1138.764151] [drm] PCIE GART of 512M enabled (table at 0x00000080FFD00000).
[ 1138.764206] amdgpu 0000:c1:00.0: amdgpu: SMU is resuming...
[ 1138.767786] amdgpu 0000:c1:00.0: amdgpu: SMU is resumed successfully!
[ 1138.771701] nvme nvme0: D3 entry latency set to 10 seconds
[ 1138.772990] nvme nvme0: 8/0/0 default/read/poll queues
[ 1138.773368] amdgpu 0000:c1:00.0: [drm] REG_WAIT timeout 1us * 1000 tries - dcn314_dsc_pg_control line:223
[ 1138.776111] amdgpu 0000:c1:00.0: [drm] REG_WAIT timeout 1us * 1000 tries - dcn314_dsc_pg_control line:231
[ 1138.778889] amdgpu 0000:c1:00.0: [drm] REG_WAIT timeout 1us * 1000 tries - dcn314_dsc_pg_control line:239
[ 1138.781640] amdgpu 0000:c1:00.0: [drm] REG_WAIT timeout 1us * 1000 tries - dcn314_dsc_pg_control line:247
[ 1138.970229] [drm] VCN decode and encode initialized successfully(under DPG Mode).
[ 1138.970471] amdgpu 0000:c1:00.0: [drm:jpeg_v4_0_hw_init [amdgpu]] JPEG decode initialized successfully.
[ 1138.970838] amdgpu 0000:c1:00.0: amdgpu: ring gfx_0.0.0 uses VM inv eng 0 on hub 0
[ 1138.970842] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 1 on hub 0
[ 1138.970844] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 4 on hub 0
[ 1138.970846] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 6 on hub 0
[ 1138.970848] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 7 on hub 0
[ 1138.970850] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 8 on hub 0
[ 1138.970852] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 9 on hub 0
[ 1138.970854] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 10 on hub 0
[ 1138.970856] amdgpu 0000:c1:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 11 on hub 0
[ 1138.970858] amdgpu 0000:c1:00.0: amdgpu: ring sdma0 uses VM inv eng 12 on hub 0
[ 1138.970860] amdgpu 0000:c1:00.0: amdgpu: ring vcn_unified_0 uses VM inv eng 0 on hub 8
[ 1138.970862] amdgpu 0000:c1:00.0: amdgpu: ring jpeg_dec uses VM inv eng 1 on hub 8
[ 1138.970864] amdgpu 0000:c1:00.0: amdgpu: ring mes_kiq_3.1.0 uses VM inv eng 13 on hub 0
[ 1138.975496] [drm] ring gfx_32806.1.1 was added
[ 1138.976068] [drm] ring compute_32806.2.2 was added
[ 1138.976617] [drm] ring sdma_32806.3.3 was added
[ 1138.976646] [drm] ring gfx_32806.1.1 ib test pass
[ 1138.976676] [drm] ring compute_32806.2.2 ib test pass
[ 1138.976789] [drm] ring sdma_32806.3.3 ib test pass
[ 1138.984911] PM: resume devices took 0.228 seconds
[ 1138.985246] OOM killer enabled.
[ 1138.985250] Restarting tasks ... done.
[ 1138.990003] random: crng reseeded on system resumption
[ 1138.994668] PM: suspend exit
[ 1142.968459] wlp1s0: authenticate with c0:74:ad:28:33:76 (local address=62:fe:77:c6:2e:39)
[ 1142.984953] wlp1s0: send auth to c0:74:ad:28:33:76 (try 1/3)
[ 1142.988508] wlp1s0: authenticated
[ 1142.990263] wlp1s0: associate with c0:74:ad:28:33:76 (try 1/3)
[ 1143.003726] wlp1s0: RX AssocResp from c0:74:ad:28:33:76 (capab=0x931 status=0 aid=1)
[ 1143.034311] wlp1s0: associated
[ 1143.034410] wlp1s0: Limiting TX power to 20 (20 - 0) dBm as advertised by c0:74:ad:28:33:76
[ 1143.920092] ucsi_acpi USBC000:00: failed to re-enable notifications (-110)
[ 1456.832420] fbcon: Taking over console
[ 1456.855812] Console: switching to colour frame buffer device 282x94
[ 1480.359646] usb 1-4: reset full-speed USB device number 2 using xhci_hcd
[ 1480.627115] usb 1-4: reset full-speed USB device number 2 using xhci_hcd
[ 1497.849969] usb 1-4: reset full-speed USB device number 2 using xhci_hcd
[ 1577.359682] usb 1-4: reset full-speed USB device number 2 using xhci_hcd
[ 1577.628183] usb 1-4: reset full-speed USB device number 2 using xhci_hcd

I think the D3hot is normal. Your very first report in this thread contained them.
My FW16 that does sleep OK has the following:

2024-05-25 14:21:39,892 DEBUG:  ACPI: \_SB_.PCI0.GPP6: LPI: Constraint not met; min power state:D1 current power state:D0
2024-05-25 14:21:39,892 DEBUG:  ACPI: \_SB_.PCI0.GP11.SWUS: LPI: Constraint not met; min power state:D3hot current power state:D0
2024-05-25 14:21:39,892 DEBUG:  ACPI: \_SB_.PCI0.GP12.SWUS: LPI: Constraint not met; min power state:D3hot current power state:D0
2024-05-25 14:21:39,892 DEBUG:  ACPI: \_SB_.PCI0.GP19.XHC2: LPI: Constraint not met; min power state:D3hot current power state:D0
2024-05-25 14:21:39,892 DEBUG:  ACPI: \_SB_.PEP_: Successfully transitioned to state screen off
2024-05-25 14:21:39,892 DEBUG:  ACPI: \_SB_.PEP_: Successfully transitioned to state lps0 ms entry
2024-05-25 14:21:39,892 DEBUG:  ACPI: \_SB_.PEP_: Successfully transitioned to state lps0 entry

Please open a new thread for the Black screen after wake issue. That is because its not related to coming out of sleep too early, it is related to a separate GPU driver bug, so we could then link that one to many other threads already discussed on this forum.