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

For you it’s fine with suspend / resume but fails for hibernate? Can you please use amd-pstate from amd-debug-tools to capture 3 reports.

  1. Startup
  2. After Suspend to idle (s0ix)
  3. After Suspend fo disk (hibernate).

Thanks Mario!

That’s right, after suspend the state is kept at balanced, but after resume from hibernate it’s back to performance mode — and same thing with gnome — it’s not showing that the perf mode is on — but cpufreq does, that and the laptop gets a lot hotter.

Will try and get you the reports.

Startup

🐧 Fedora Linux 42 (Toolbx Container Image)
🐧 Kernel:      6.17.0-0.rc6.49.fc43.x86_64
○ 'status':     active
○ 'prefcore':   enabled
💻 CPU:         AMD Ryzen 7 7840U w/ Radeon  780M Graphics
🔋 Per-CPU sysfs files
+---------+----------------+----------------------+----------------+--------------------+--------------------+---------------------------------+------------+---------+
|   CPU # |   CPU Min Freq |   CPU Nonlinear Freq |   CPU Max Freq |   Scaling Min Freq |   Scaling Max Freq | Energy Performance Preference   |   Prefcore |   Boost |
|---------+----------------+----------------------+----------------+--------------------+--------------------+---------------------------------+------------+---------|
|       0 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        202 |       1 |
|       1 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        202 |       1 |
|       2 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        196 |       1 |
|       3 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        196 |       1 |
|       4 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        226 |       1 |
|       5 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        226 |       1 |
|       6 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        232 |       1 |
|       7 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        232 |       1 |
|       8 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        220 |       1 |
|       9 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        220 |       1 |
|      10 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        232 |       1 |
|      11 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        232 |       1 |
|      12 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        214 |       1 |
|      13 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        214 |       1 |
|      14 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        208 |       1 |
|      15 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        208 |       1 |
+---------+----------------+----------------------+----------------+--------------------+--------------------+---------------------------------+------------+---------+
🚦 MSR checks unavailable

After S0ix

🐧 Fedora Linux 42 (Toolbx Container Image)
🐧 Kernel:      6.17.0-0.rc6.49.fc43.x86_64
○ 'status':     active
○ 'prefcore':   enabled
💻 CPU:         AMD Ryzen 7 7840U w/ Radeon  780M Graphics
🔋 Per-CPU sysfs files
+---------+----------------+----------------------+----------------+--------------------+--------------------+---------------------------------+------------+---------+
|   CPU # |   CPU Min Freq |   CPU Nonlinear Freq |   CPU Max Freq |   Scaling Min Freq |   Scaling Max Freq | Energy Performance Preference   |   Prefcore |   Boost |
|---------+----------------+----------------------+----------------+--------------------+--------------------+---------------------------------+------------+---------|
|       0 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        202 |       1 |
|       1 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        202 |       1 |
|       2 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        196 |       1 |
|       3 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        196 |       1 |
|       4 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        226 |       1 |
|       5 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        226 |       1 |
|       6 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        232 |       1 |
|       7 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        232 |       1 |
|       8 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        220 |       1 |
|       9 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        220 |       1 |
|      10 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        232 |       1 |
|      11 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        232 |       1 |
|      12 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        214 |       1 |
|      13 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        214 |       1 |
|      14 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        208 |       1 |
|      15 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        208 |       1 |
+---------+----------------+----------------------+----------------+--------------------+--------------------+---------------------------------+------------+---------+
🚦 MSR checks unavailable

After hibernate

🐧 Fedora Linux 42 (Toolbx Container Image)
🐧 Kernel:      6.17.0-0.rc6.49.fc43.x86_64
○ 'status':     active
○ 'prefcore':   enabled
💻 CPU:         AMD Ryzen 7 7840U w/ Radeon  780M Graphics
🔋 Per-CPU sysfs files
+---------+----------------+----------------------+----------------+--------------------+--------------------+---------------------------------+------------+---------+
|   CPU # |   CPU Min Freq |   CPU Nonlinear Freq |   CPU Max Freq |   Scaling Min Freq |   Scaling Max Freq | Energy Performance Preference   |   Prefcore |   Boost |
|---------+----------------+----------------------+----------------+--------------------+--------------------+---------------------------------+------------+---------|
|       0 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | balance_power                   |        202 |       1 |
|       1 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        202 |       1 |
|       2 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        196 |       1 |
|       3 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        196 |       1 |
|       4 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        226 |       1 |
|       5 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        226 |       1 |
|       6 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        232 |       1 |
|       7 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        232 |       1 |
|       8 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        220 |       1 |
|       9 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        220 |       1 |
|      10 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        232 |       1 |
|      11 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        232 |       1 |
|      12 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        214 |       1 |
|      13 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        214 |       1 |
|      14 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        208 |       1 |
|      15 |         419175 |              1100334 |        5134889 |            1100334 |            5134889 | performance                     |        208 |       1 |
+---------+----------------+----------------------+----------------+--------------------+--------------------+---------------------------------+------------+---------+
🚦 MSR checks unavailable

The MSR checks are actually what I was looking for. Can you pass MSR support into the container?

The MSR for the resume after hibernate case:

🔋 CPPC MSRs
+---------+----------+----------+--------------------+---------+------------+
|   CPU # |   Enable |   Status | Cap 1              | Cap 2   | Request    |
|---------+----------+----------+--------------------+---------+------------|
|       0 |        1 |        0 | 0xca7e2a10ca7e2a10 | 0x0     | 0xbf002bc4 |
|       1 |        1 |        0 | 0xca7e2a10         | 0x0     | 0x2bc4     |
|       2 |        1 |        0 | 0xc47e2a10c47e2a10 | 0x0     | 0x2bc4     |
|       3 |        1 |        0 | 0xc47e2a10         | 0x0     | 0x2bc4     |
|       4 |        1 |        0 | 0xe27e2a10e27e2a10 | 0x0     | 0x2bc4     |
|       5 |        1 |        0 | 0xe27e2a10         | 0x0     | 0x2bc4     |
|       6 |        1 |        0 | 0xe87e2a10e87e2a10 | 0x0     | 0x2bc4     |
|       7 |        1 |        0 | 0xe87e2a10         | 0x0     | 0x2bc4     |
|       8 |        1 |        0 | 0xdc7e2a10dc7e2a10 | 0x0     | 0x2bc4     |
|       9 |        1 |        0 | 0xdc7e2a10         | 0x0     | 0x2bc4     |
|      10 |        1 |        0 | 0xe87e2a10e87e2a10 | 0x0     | 0x2bc4     |
|      11 |        1 |        0 | 0xe87e2a10         | 0x0     | 0x2bc4     |
|      12 |        1 |        0 | 0xd67e2a10d67e2a10 | 0x0     | 0x2bc4     |
|      13 |        1 |        0 | 0xd67e2a10         | 0x0     | 0x2bc4     |
|      14 |        1 |        0 | 0xd07e2a10d07e2a10 | 0x0     | 0x2bc4     |
|      15 |        1 |        0 | 0xd07e2a10         | 0x0     | 0x2bc4     |
+---------+----------+----------+--------------------+---------+------------+
🔋 MSR_AMD_CPPC_CAP1 (decoded)
+---------+---------------+------------------+----------------+----------------+
|   CPU # |   Lowest Perf |   Nonlinear Perf |   Nominal Perf |   Highest Perf |
|---------+---------------+------------------+----------------+----------------|
|       0 |            16 |               42 |            126 |            202 |
|       1 |            16 |               42 |            126 |            202 |
|       2 |            16 |               42 |            126 |            196 |
|       3 |            16 |               42 |            126 |            196 |
|       4 |            16 |               42 |            126 |            226 |
|       5 |            16 |               42 |            126 |            226 |
|       6 |            16 |               42 |            126 |            232 |
|       7 |            16 |               42 |            126 |            232 |
|       8 |            16 |               42 |            126 |            220 |
|       9 |            16 |               42 |            126 |            220 |
|      10 |            16 |               42 |            126 |            232 |
|      11 |            16 |               42 |            126 |            232 |
|      12 |            16 |               42 |            126 |            214 |
|      13 |            16 |               42 |            126 |            214 |
|      14 |            16 |               42 |            126 |            208 |
|      15 |            16 |               42 |            126 |            208 |
+---------+---------------+------------------+----------------+----------------+
🔋 MSR_AMD_CPPC_REQ (decoded)
+---------+------------+------------+----------------+---------------------------+
|   CPU # |   Min Perf |   Max Perf |   Desired Perf |   Energy Performance Perf |
|---------+------------+------------+----------------+---------------------------|
|       0 |         43 |        196 |              0 |                       191 |
|       1 |         43 |        196 |              0 |                         0 |
|       2 |         43 |        196 |              0 |                         0 |
|       3 |         43 |        196 |              0 |                         0 |
|       4 |         43 |        196 |              0 |                         0 |
|       5 |         43 |        196 |              0 |                         0 |
|       6 |         43 |        196 |              0 |                         0 |
|       7 |         43 |        196 |              0 |                         0 |
|       8 |         43 |        196 |              0 |                         0 |
|       9 |         43 |        196 |              0 |                         0 |
|      10 |         43 |        196 |              0 |                         0 |
|      11 |         43 |        196 |              0 |                         0 |
|      12 |         43 |        196 |              0 |                         0 |
|      13 |         43 |        196 |              0 |                         0 |
|      14 |         43 |        196 |              0 |                         0 |
|      15 |         43 |        196 |              0 |                         0 |
+---------+------------+------------+----------------+---------------------------+```

MSR after a normal boot:

🔋 CPPC MSRs
+---------+----------+----------+--------------------+---------+------------+
|   CPU # |   Enable |   Status | Cap 1              | Cap 2   | Request    |
|---------+----------+----------+--------------------+---------+------------|
|       0 |        1 |        0 | 0xca7e2a10ca7e2a10 | 0x0     | 0xbf002bc4 |
|       1 |        1 |        0 | 0xca7e2a10         | 0x0     | 0xbf002bc4 |
|       2 |        1 |        0 | 0xc47e2a10c47e2a10 | 0x0     | 0xbf002bc4 |
|       3 |        1 |        0 | 0xc47e2a10         | 0x0     | 0xbf002bc4 |
|       4 |        1 |        0 | 0xe27e2a10e27e2a10 | 0x0     | 0xbf002bc4 |
|       5 |        1 |        0 | 0xe27e2a10         | 0x0     | 0xbf002bc4 |
|       6 |        1 |        0 | 0xe87e2a10e87e2a10 | 0x0     | 0xbf002bc4 |
|       7 |        1 |        0 | 0xe87e2a10         | 0x0     | 0xbf002bc4 |
|       8 |        1 |        0 | 0xdc7e2a10dc7e2a10 | 0x0     | 0xbf002bc4 |
|       9 |        1 |        0 | 0xdc7e2a10         | 0x0     | 0xbf002bc4 |
|      10 |        1 |        0 | 0xe87e2a10e87e2a10 | 0x0     | 0xbf002bc4 |
|      11 |        1 |        0 | 0xe87e2a10         | 0x0     | 0xbf002bc4 |
|      12 |        1 |        0 | 0xd67e2a10d67e2a10 | 0x0     | 0xbf002bc4 |
|      13 |        1 |        0 | 0xd67e2a10         | 0x0     | 0xbf002bc4 |
|      14 |        1 |        0 | 0xd07e2a10d07e2a10 | 0x0     | 0xbf002bc4 |
|      15 |        1 |        0 | 0xd07e2a10         | 0x0     | 0xbf002bc4 |
+---------+----------+----------+--------------------+---------+------------+
🔋 MSR_AMD_CPPC_CAP1 (decoded)
+---------+---------------+------------------+----------------+----------------+
|   CPU # |   Lowest Perf |   Nonlinear Perf |   Nominal Perf |   Highest Perf |
|---------+---------------+------------------+----------------+----------------|
|       0 |            16 |               42 |            126 |            202 |
|       1 |            16 |               42 |            126 |            202 |
|       2 |            16 |               42 |            126 |            196 |
|       3 |            16 |               42 |            126 |            196 |
|       4 |            16 |               42 |            126 |            226 |
|       5 |            16 |               42 |            126 |            226 |
|       6 |            16 |               42 |            126 |            232 |
|       7 |            16 |               42 |            126 |            232 |
|       8 |            16 |               42 |            126 |            220 |
|       9 |            16 |               42 |            126 |            220 |
|      10 |            16 |               42 |            126 |            232 |
|      11 |            16 |               42 |            126 |            232 |
|      12 |            16 |               42 |            126 |            214 |
|      13 |            16 |               42 |            126 |            214 |
|      14 |            16 |               42 |            126 |            208 |
|      15 |            16 |               42 |            126 |            208 |
+---------+---------------+------------------+----------------+----------------+
🔋 MSR_AMD_CPPC_REQ (decoded)
+---------+------------+------------+----------------+---------------------------+
|   CPU # |   Min Perf |   Max Perf |   Desired Perf |   Energy Performance Perf |
|---------+------------+------------+----------------+---------------------------|
|       0 |         43 |        196 |              0 |                       191 |
|       1 |         43 |        196 |              0 |                       191 |
|       2 |         43 |        196 |              0 |                       191 |
|       3 |         43 |        196 |              0 |                       191 |
|       4 |         43 |        196 |              0 |                       191 |
|       5 |         43 |        196 |              0 |                       191 |
|       6 |         43 |        196 |              0 |                       191 |
|       7 |         43 |        196 |              0 |                       191 |
|       8 |         43 |        196 |              0 |                       191 |
|       9 |         43 |        196 |              0 |                       191 |
|      10 |         43 |        196 |              0 |                       191 |
|      11 |         43 |        196 |              0 |                       191 |
|      12 |         43 |        196 |              0 |                       191 |
|      13 |         43 |        196 |              0 |                       191 |
|      14 |         43 |        196 |              0 |                       191 |
|      15 |         43 |        196 |              0 |                       191 |
+---------+------------+------------+----------------+---------------------------+```

I’ve reproduced the issue locally and it’s a very similar root cause as the other one. Here’s a patch for it. You can reply to that with a tested-by tag if you can test it.

2 Likes

@Mario_Limonciello I can test the new patch, if we can get the new patch into Fedora kernels like last time. (I just noticed that Gnome on Fedora 42 has a “hibernate” option).

Looks like it wasn’t pulled into 18-rc1 yet LKML: "Rafael J. Wysocki": [GIT PULL] Power management updates for v6.18-rc1 ?

It doesn’t have public review or testing results.

Oh, so it won’t get pulled until there’s feedback from testers ?

@Fn1 We’re the testers, as in specifically you and me.

Suggest to follow the same process as done for the previous patch. That is:
(1) build the kernel with the proposed patch (or request to have someone else to build the kernel for you with the patch, such as Fedora kernel maintainers),
(2) test the patched kernel to make sure it works as intended,
(3) report the result on the appropriate LKML mailing list as a reply to Mario’s email containing the patch.

1 Like

This has now landed into 5.17.6, I verified that it works. Thank you, Mario!

1 Like