* [Bug 216189] New: amd-pstate stops working after S3 suspend
@ 2022-06-29 15:21 bugzilla-daemon
2022-06-29 15:34 ` [Bug 216189] " bugzilla-daemon
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: bugzilla-daemon @ 2022-06-29 15:21 UTC (permalink / raw)
To: linux-pm
https://bugzilla.kernel.org/show_bug.cgi?id=216189
Bug ID: 216189
Summary: amd-pstate stops working after S3 suspend
Product: Power Management
Version: 2.5
Kernel Version: 5.18.8
Hardware: AMD
OS: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: cpufreq
Assignee: linux-pm@vger.kernel.org
Reporter: a@annel.in
Regression: No
Hardware: Lenovo Thinkpad T14 Gen2 AMD
CPU: AMD Ryzen 7 PRO 5850U
Kernel: 5.18.8 (tried linux-next too)
I've managed to get new `amd-pstate` driver working on my system, but after
suspend (S3) it stops working and CPU frequency and Boost state control is not
working.
Falling back to `acpi-cpufreq` driver solves the issue — suspend no longer
breaks CPU frequency and Boost controls.
```
~ sudo cpupower frequency-info
analyzing CPU 0:
driver: amd-pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 131 us
hardware limits: 400 MHz - 1.90 GHz
available cpufreq governors: ondemand performance schedutil
current policy: frequency should be within 800 MHz and 1.50 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency: Unable to call hardware
current CPU frequency: 3.41 GHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: no
AMD PSTATE Highest Performance: 166. Maximum Frequency: 4.51 GHz.
AMD PSTATE Nominal Performance: 70. Nominal Frequency: 1.90 GHz.
AMD PSTATE Lowest Non-linear Performance: 41. Lowest Non-linear
Frequency: 1.11 GHz.
AMD PSTATE Lowest Performance: 15. Lowest Frequency: 400 MHz.
```
As we see here, frequency limits are set to 800 MHz - 1.50 GHz and boost stats
is inactive, but actual CPU frequency 3.41 GHz (that means boost is on and
limits are ignored)
The things starts working again only after reboot.
Any commands such as
```
echo 1 > /sys/devices/system/cpu/cpufreq/boost
echo 0 > /sys/devices/system/cpu/cpufreq/boost
cpupower frequency-set -g ondemand -d 400MHz -u 800MHz
cpupower frequency-set -g performance -d 1.9GHz -u 1.9GHz
```
just does nothing. (after reboot they start working again of course)
There are no mentions of pstate module in dmesg, but maybe I have to enable
some debug (how to do it?)
Simillar bug for intel_pstate:
https://bugzilla.kernel.org/show_bug.cgi?id=90421
Maybe it is related some way.
--
You may reply to this email to add a comment.
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread* [Bug 216189] amd-pstate stops working after S3 suspend 2022-06-29 15:21 [Bug 216189] New: amd-pstate stops working after S3 suspend bugzilla-daemon @ 2022-06-29 15:34 ` bugzilla-daemon 2022-06-29 15:35 ` bugzilla-daemon ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: bugzilla-daemon @ 2022-06-29 15:34 UTC (permalink / raw) To: linux-pm https://bugzilla.kernel.org/show_bug.cgi?id=216189 --- Comment #1 from a@annel.in --- May be duplicate of https://bugzilla.kernel.org/show_bug.cgi?id=215938 -- You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug 216189] amd-pstate stops working after S3 suspend 2022-06-29 15:21 [Bug 216189] New: amd-pstate stops working after S3 suspend bugzilla-daemon 2022-06-29 15:34 ` [Bug 216189] " bugzilla-daemon @ 2022-06-29 15:35 ` bugzilla-daemon 2022-06-30 8:26 ` bugzilla-daemon 2022-06-30 8:33 ` bugzilla-daemon 3 siblings, 0 replies; 5+ messages in thread From: bugzilla-daemon @ 2022-06-29 15:35 UTC (permalink / raw) To: linux-pm https://bugzilla.kernel.org/show_bug.cgi?id=216189 a@annel.in changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #2 from a@annel.in --- *** This bug has been marked as a duplicate of bug 215938 *** -- You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug 216189] amd-pstate stops working after S3 suspend 2022-06-29 15:21 [Bug 216189] New: amd-pstate stops working after S3 suspend bugzilla-daemon 2022-06-29 15:34 ` [Bug 216189] " bugzilla-daemon 2022-06-29 15:35 ` bugzilla-daemon @ 2022-06-30 8:26 ` bugzilla-daemon 2022-06-30 8:33 ` bugzilla-daemon 3 siblings, 0 replies; 5+ messages in thread From: bugzilla-daemon @ 2022-06-30 8:26 UTC (permalink / raw) To: linux-pm https://bugzilla.kernel.org/show_bug.cgi?id=216189 Joe (sujinzhou2008@126.com) changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sujinzhou2008@126.com --- Comment #3 from Joe (sujinzhou2008@126.com) --- Hello, The fixed patch has been accepted. It will be updated in 5.19. Here is the detail On Thu, Jun 23, 2022 at 9:53 AM Huang Rui <ray.huang@amd.com> wrote: > > On Thu, Jun 23, 2022 at 11:15:09AM +0800, Su, Jinzhou (Joe) wrote: > > When system resumes from S3, the CPPC enable register will be > > cleared and reset to 0. So sets this bit to enable CPPC interface by > > writing 1 to this register. > > > > Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com> > > Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com> > Cc: stable@vger.kernel.org > > You can add one line below your commit description to Cc stable > mailing list. And next time in V2, it's better to use subject-prefix > optional to mark it as v2 like below: > > git format-patch --subject-prefix="PATCH v2" HEAD~ > > Other looks good for me, patch is > > Acked-by: Huang Rui <ray.huang@amd.com> > > > --- > > drivers/cpufreq/amd-pstate.c | 24 ++++++++++++++++++++++++ > > 1 file changed, 24 insertions(+) > > > > diff --git a/drivers/cpufreq/amd-pstate.c > > b/drivers/cpufreq/amd-pstate.c index 7be38bc6a673..9ac75c1cde9c > > 100644 > > --- a/drivers/cpufreq/amd-pstate.c > > +++ b/drivers/cpufreq/amd-pstate.c > > @@ -566,6 +566,28 @@ static int amd_pstate_cpu_exit(struct cpufreq_policy > *policy) > > return 0; > > } > > > > +static int amd_pstate_cpu_resume(struct cpufreq_policy *policy) { > > + int ret; > > + > > + ret = amd_pstate_enable(true); > > + if (ret) > > + pr_err("failed to enable amd-pstate during resume, > > + return %d\n", ret); > > + > > + return ret; > > +} > > + > > +static int amd_pstate_cpu_suspend(struct cpufreq_policy *policy) { > > + int ret; > > + > > + ret = amd_pstate_enable(false); > > + if (ret) > > + pr_err("failed to disable amd-pstate during suspend, > > + return %d\n", ret); > > + > > + return ret; > > +} > > + > > /* Sysfs attributes */ > > > > /* > > @@ -636,6 +658,8 @@ static struct cpufreq_driver amd_pstate_driver = { > > .target = amd_pstate_target, > > .init = amd_pstate_cpu_init, > > .exit = amd_pstate_cpu_exit, > > + .suspend = amd_pstate_cpu_suspend, > > + .resume = amd_pstate_cpu_resume, > > .set_boost = amd_pstate_set_boost, > > .name = "amd-pstate", > > .attr = amd_pstate_attr, > > -- Applied with some edits in the subject and changelog, and a CC:stable tag added, as 5.19-rc material. Thanks! -- You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug 216189] amd-pstate stops working after S3 suspend 2022-06-29 15:21 [Bug 216189] New: amd-pstate stops working after S3 suspend bugzilla-daemon ` (2 preceding siblings ...) 2022-06-30 8:26 ` bugzilla-daemon @ 2022-06-30 8:33 ` bugzilla-daemon 3 siblings, 0 replies; 5+ messages in thread From: bugzilla-daemon @ 2022-06-30 8:33 UTC (permalink / raw) To: linux-pm https://bugzilla.kernel.org/show_bug.cgi?id=216189 --- Comment #4 from Joe (sujinzhou2008@126.com) --- Hello, It works on my local. Please try the update and close the issue. Thanks! Joe -- You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-06-30 8:33 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-06-29 15:21 [Bug 216189] New: amd-pstate stops working after S3 suspend bugzilla-daemon 2022-06-29 15:34 ` [Bug 216189] " bugzilla-daemon 2022-06-29 15:35 ` bugzilla-daemon 2022-06-30 8:26 ` bugzilla-daemon 2022-06-30 8:33 ` bugzilla-daemon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox