Bug 219290

Summary: AMD Ryzen 7900x freeze when resuming from sleep with 6.11
Product: ACPI Reporter: dsgluyu (2802131438)
Component: Power-Sleep-WakeAssignee: acpi_power-sleep-wake
Status: REOPENED ---    
Severity: normal CC: adrian.mitchell.dadv, bernard.cafarelli, cfebs, h, herbiejhopkins, jokeyrhyme, maciek.borzecki, mstrobl2
Priority: P3    
Hardware: AMD   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:
Attachments: here is dmesg from linux-6.11.arch1-1-x86_64
lspci -kvv

Description dsgluyu 2024-09-19 13:17:00 UTC
Created attachment 306895 [details]
here is dmesg from linux-6.11.arch1-1-x86_64

I initially discovered this issue while using linux-cachyos, and it can be reproduced when testing with linux-6.11.arch1-1-x86_64 from the archlinux core-testing repository.

When I press the power button, the screen is woken up and it displays the last frame from before sleep. but I can't do anything. 

The logs stop after "systemd-sleep[4525]: Performing sleep operation 'suspend'..." so I have no idea how to troubleshoot this.

And I disabled sddm and tried to wake up from sleep in the tty, after the monitor wakes up, the tty's cursor is blinking normally, the Num Lock and Caps Lock indicator lights work normally, but I can't make any inputs. Attempting to reconnect the keyboard resulted in the keyboard not being recognized.

My motherboard is MAG B650M MORTAR WIFI. I tried updating the BIOS to the latest version from MSI's official website, but the issue remains the same.
Comment 1 dsgluyu 2024-09-19 13:23:06 UTC
Reverting to 6.10 or using the LTS version doesn’t cause this issue, so it seems like 6.11 made some changes about wake-up?
Comment 2 dsgluyu 2024-09-19 13:28:19 UTC
Created attachment 306896 [details]
lspci -kvv
Comment 3 Artem S. Tashkinov 2024-09-19 13:47:57 UTC
Please report here instead:

https://gitlab.freedesktop.org/drm/amd/-/issues
Comment 4 dsgluyu 2024-09-19 15:14:09 UTC
(In reply to Artem S. Tashkinov from comment #3)
> Please report here instead:
> 
> https://gitlab.freedesktop.org/drm/amd/-/issues

It doesn't seem to be an AMD DRM issue. I disabled the AMD integrated graphics in the BIOS, and my discrete GPU is an Intel Arc A770.
Comment 5 Julian Weissgerber 2024-09-19 18:53:37 UTC
Also experiencing this on 6.11 with Ryzen 7800X3D on MSI X670E GAMING PLUS WIFI. Board firmware 7E16v181, Agesa 1.2.0.1. On kernel 6.10.x resume works fine.

Nothing conclusive is written logs here either.

Sep 18 23:20:53 xxx kernel: PM: suspend entry (deep)
Sep 18 23:20:53 xxx kernel: Filesystems sync: 0.036 seconds
-- Boot 630805d182244f7b82f162e50d41a1da --
Sep 19 09:44:36 xxx kernel: Linux version 6.11.0-cb1.0.fc40.x86_64 (mockbuild@5896c1ab416c4f639c7b1f6c31d7034d) (gcc (GCC) 14.2.1 20240801 (Red Hat 14.2.1-1), GNU ld version 2.41-37.fc40) >

$ uname -a
Linux xxx 6.11.0-cb2.0.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Sep 19 02:35:36 UTC 2024 x86_64 GNU/Linux
Comment 6 dsgluyu 2024-09-20 06:41:13 UTC
I find my issue is caused by the VMware network device so it shouldn’t be reported there.
Comment 7 dsgluyu 2024-09-20 06:56:15 UTC
(In reply to dsgluyu from comment #6)
> I find my issue is caused by the VMware network device so it shouldn’t be
> reported there.

It was a false alarm—this issue can't be consistently reproduced.
Comment 8 dsgluyu 2024-09-20 08:49:53 UTC
I'm trying to bisect, but there's another bug, which was fixed in 6.11.0, that prevents the bisected kernel from booting on my motherboard, making it hard to verify the wake-up issue.

The bug causes the following error:

kernel: BUG: unable to handle page fault for address: ffffffffffffff98
kernel: #PF: supervisor read access in kernel mode
kernel: #PF: error_code(0x0000) - not-present page

Does anyone know when this bug was fixed?
Comment 9 dsgluyu 2024-09-25 14:28:24 UTC
I previously thought the freeze occurred during the wake-up phase, but I've found in the past couple of days that it actually happens during the suspend phase. It seems very likely to be a DRM-related issue.
Comment 10 Markus Strobl 2024-10-13 15:43:50 UTC
Can confirm this issue. It happens every time I try to suspend-to-RAM. 

Kubuntu 24.10 with 6.11 Kernel. Ryzen 5800X3D. NVidia 3070 with driver 560.35.03. Have also tried NVidia drivers 555 and 550 as well as Nouveau and all act the same, i.e. suspend freezes the computer.

My symptoms: When trying to suspend I get black screen. Sometimes backlight is on, sometimes off. When backlight is on the screen is sometimes all black, sometimes a blinking cursor in upper left corner. Once I had a working mouse pointer on a black screen. Keyboard and mouse stays powered up. Fans keep running. I have to press the reset button to get it to reboot.

Reverting to Kernel 6.10.10 fixes it for me.
Comment 11 Markus Strobl 2024-10-13 15:50:14 UTC
Reading my comment I realize it is misleading: The problem occurs when resuming from suspend. The PC enters sleep ok, the freezes with black screen when resuming. Sorry for being unclear.(In reply to Markus Strobl from comment #10)
Comment 12 dsgluyu 2024-10-13 16:03:04 UTC
I eventually found out it was a bluetooth or wifi related issue, the problem occurs when both are turned on at the same time, not when wifi is turned on and bluetooth is turned off. I haven't tried turning off wifi but turning on bluetooth. The motherboard carries a wireless card RZ616 alias MT7922.
Comment 13 Bernard Cafarelli 2024-10-14 13:52:17 UTC
Thanks for the info, I added a systemd service to stop/start bluetooth around suspend, and system now wakes up properly from suspend again on 6.11 (with that workaround)

Tested on kernel 6.11.3, Asus TUF GAMING X670E-PLUS WIFI, similar card MEDIATEK Corp. MT7922
Comment 14 Markus Strobl 2024-10-14 14:43:34 UTC
Just tried turning BT and WIFI off on my MSI B550 MAX WIFI motherboard and unfortunately kernel 6.11.0 still freezes when resuming.
Comment 15 Adrian 2024-10-14 17:45:39 UTC
I've been plagued by this for a couple weeks too: MSI Mag B650m and 7800x3d. Disabling bluetooth before sleep solved my issue so I guess I need to learn how to write my own systemd services. This is just a little generic bluetooth dongle sat in the front ports of my case.
Comment 16 Markus Strobl 2024-10-14 18:14:35 UTC
Did some more testing. Like I said in comment #11: Disabling bluetooth in BIOS did not fix it. However, when I disable bluetooth in the KDE desktop (and have it enabled in BIOS) resume DOES work. 

Also noticed another bug which is probably a bug in the KDE BT app: After I disabled BT and did a suspend-resume it showed as disabled but it is actually enabled. A second suspend-resume will give the familiar frozen system. If I click enable-disable BT a few times it will eventually sync back up and show the correct status. If I then disable BT I can suspend-resume successfully again.

So yeah, I think we have narrowed it down to that there's a fault in bluetooth. Interesting that the system still freezes even if BT is off in BIOS. Have to disable it in the desktop environment.
Comment 17 dsgluyu 2024-10-15 06:03:56 UTC
(In reply to Adrian from comment #15)
> I've been plagued by this for a couple weeks too: MSI Mag B650m and 7800x3d.
> Disabling bluetooth before sleep solved my issue so I guess I need to learn
> how to write my own systemd services. This is just a little generic
> bluetooth dongle sat in the front ports of my case.

So you're using a usb bluetooth adapter and the motherboard didn't come with one? If that's the case then it doesn't seem to be a problem with the wireless card. Is there a better place to ask looking for an actual solution
Comment 18 dsgluyu 2024-10-15 06:16:19 UTC
(In reply to Markus Strobl from comment #16)
> Did some more testing. Like I said in comment #11: Disabling bluetooth in
> BIOS did not fix it. However, when I disable bluetooth in the KDE desktop
> (and have it enabled in BIOS) resume DOES work. 

I also tried disabling bluetooth in the bios, but it didn't do what you said, it woke up fine
Comment 19 dsgluyu 2024-10-16 02:08:51 UTC
If the USB Bluetooth adapter has issues, the problem might be with the USB itself, since even wireless network cards use USB for Bluetooth.