Increased power usage after resuming from suspend on Ryzen 7040 (kernel 6.15 regression)

@Mario_Limonciello There is a regression in power handling on kernel 6.15.

After coming out of suspend, the actual energy preference is always reported as “performance”, even though it was set to “power” before suspend.

The regression does NOT occur on kernel 6.14.11 (everything else is the same except kernel version).

Using Fedora 41, tuned-2.25.1-2, kernel 6.15.11, gnome-shell 47.9, latest framework bios (3.16).

Before suspend: using the gnome shell top-right menu to set the power mode to “Power Saver”, which under the hood uses TuneD. The change in the energy preference after the resume is NOT reflected in the gnome shell top-right menu (still says “Power Saver”). However, the actual mode can be seen via the cpupower command (part of kernel-tools).

Before suspend:

$ sudo cpupower frequency-info
analyzing CPU 0:
driver: amd-pstate-epp
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
energy performance preference: power

After resuming from suspend:

$ sudo cpupower frequency-info
analyzing CPU 6:
driver: amd-pstate-epp
CPUs which run at the same hardware frequency: 6
CPUs which need to have their frequency coordinated by software: 6
energy performance preference: performance

What’s going on here?

Interesting find!!!

I am suspecting it’s this causing it.

@Mario_Limonciello I don’t have the skills/knowledge nor the bandwidth to do a kernel bisect. However, I can test kernel 6.16.3 (as currently available in Fedora 41 updates-testing channel) to see if this regression is present there.

I can also test any pre-made kernel rpm, if that’s an option.

I looked through the code paths and I have a hypothesis that may fix it. You can apply this to 6.17-rc3.

1 Like

@Mario_Limonciello Tried kernel 6.16.3 from Fedora 41 updates-testing. Same problem.

@Mario_Limonciello Thanks for the patch, though it’s beyond my current ability+bandwidth to create a new kernel with it. Happy to test it via fedora-updates in say kernel 6.16.4+, even if that’s not the fastest way to do it.

Maybe someone else on this forum can compile a new kernel with the patch?

If you raise this in the fedora bug tracker you might be able to get someone to build you a binary.

@Mario_Limonciello Good idea. Filed fedora bug report at: 2391221 – suspend + resume causes power handling regression in kernel 6.15.11 and 6.16.3 on AMD Ryzen 7640

Hi, I can confirm the patch works. I didn’t measure power consumption or anything complex, I just suspended, woke up and checked using the same sudo cpupower frequency-info OP used. Tested on Fedora KDE 42, AMD 7840U, Tuned-2.25.1.

Will it be backported to 6.15 and 6.16? Do you want me to send an email in the kernel mailing list too?

2 Likes

Please send a tag to the mailing list indicating your testing status.

I think I sent an email (?). I always have trouble with my email client and the way the mailing list works…

1 Like

@Willian The message came through on the kernel mailing list. Thanks for confirming the patch works!

@Mario_Limonciello Good news. I can confirm that the 6.16.3 kernel with your amd-pstate patch works correctly and fixes the issue. Thanks for looking into this.

I recommend pushing this patch to the next stable kernel update.

The patched 6.13.3 kernel was built by jforbes/fedora, and was obtained from:

I verified that the amd-pstate patch is embedded in the larger “patch-6.16-redhat.patch” file, which is within the kernel source rpm.

Can you respond to the mailing list post?

Once I get code review it can be merged.

For posterity. Related bug report: Fedora 42: CPU governor always set to performance after resume from suspend?

1 Like

@Mario_Limonciello Replied to the post on linux-pm mailing list. Let me know if anything else needs to be done to get this patch into mainline (6.16 stable and 6.17 RC).

Here’s the fix in Linus’ tree.

4 Likes

@Mario_Limonciello Thank you for the patch and shepherding it into mainline.

1 Like

Mario’s patch is now in Linux kernel 6.16.8: https://lwn.net/Articles/1038841/

4 Likes

Is this fixed in 6.17rc6? I’m still seeing the issue, although after a resume from hibernate.