From: Greg KH <gregkh@linuxfoundation.org>
To: Jinzhou Su <Jinzhou.Su@amd.com>
Cc: rjw@rjwysocki.net, linux-pm@vger.kernel.org, ray.huang@amd.com,
alexander.deucher@amd.com, xiaojian.du@amd.com,
perry.yuan@amd.com, li.meng@amd.com, richardqi.liang@amd.com,
stable@vger.kernel.org
Subject: Re: [PATCH] cpufreq: amd-pstate: Add resume and suspend callback for amd-pstate
Date: Thu, 23 Jun 2022 09:57:49 +0200 [thread overview]
Message-ID: <YrQc/T+mARRVbIHl@kroah.com> (raw)
In-Reply-To: <20220623031509.555269-1-Jinzhou.Su@amd.com>
On Thu, Jun 23, 2022 at 11:15:09AM +0800, Jinzhou Su 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>
> ---
> 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,
> --
> 2.32.0
>
<formletter>
This is not the correct way to submit patches for inclusion in the
stable kernel tree. Please read:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.
</formletter>
prev parent reply other threads:[~2022-06-23 7:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-23 3:15 [PATCH] cpufreq: amd-pstate: Add resume and suspend callback for amd-pstate Jinzhou Su
2022-06-23 7:52 ` Huang Rui
2022-06-23 19:24 ` Rafael J. Wysocki
2022-06-23 7:57 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YrQc/T+mARRVbIHl@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=Jinzhou.Su@amd.com \
--cc=alexander.deucher@amd.com \
--cc=li.meng@amd.com \
--cc=linux-pm@vger.kernel.org \
--cc=perry.yuan@amd.com \
--cc=ray.huang@amd.com \
--cc=richardqi.liang@amd.com \
--cc=rjw@rjwysocki.net \
--cc=stable@vger.kernel.org \
--cc=xiaojian.du@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox