linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Perry Yuan <Perry.Yuan@amd.com>
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com>,
	Huang Rui <ray.huang@amd.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Deepak Sharma <Deepak.Sharma@amd.com>,
	Mario Limonciello <Mario.Limonciello@amd.com>,
	Nathan Fontenot <Nathan.Fontenot@amd.com>,
	Alex Deucher <Alexander.Deucher@amd.com>,
	"Su, Jinzhou (Joe)" <Jinzhou.Su@amd.com>,
	Shimmer.Huang@amd.com, "Du, Xiaojian" <Xiaojian.Du@amd.com>,
	"Meng, Li (Jassmine)" <Li.Meng@amd.com>,
	Linux PM <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 7/7] cpufreq: amd-pstate: add ACPI disabled check in acpi_cpc_valid()
Date: Thu, 25 Aug 2022 13:56:52 +0200	[thread overview]
Message-ID: <CAJZ5v0jwBU-6WFXVQZw4w7-r=LeyNqcu=rDHxP55VYKV5ETPng@mail.gmail.com> (raw)
In-Reply-To: <20220814163548.326686-8-Perry.Yuan@amd.com>

On Sun, Aug 14, 2022 at 6:53 PM Perry Yuan <Perry.Yuan@amd.com> wrote:
>
> Add acpi function check in case ACPI is not enabled, that will cause
> pstate driver failed to call cppc acpi to change perf or update epp
> value for shared memory solution processors.
>
> When CPPC or ACPI is invalid, warning log will be needed to tell
> user that AMD pstate driver failed to load and what is wrong.
>
> Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
> ---
>  drivers/acpi/cppc_acpi.c       | 3 +++
>  drivers/base/arch_topology.c   | 2 +-
>  drivers/cpufreq/amd-pstate.c   | 2 +-
>  drivers/cpufreq/cppc_cpufreq.c | 2 +-
>  4 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> index 1e15a9f25ae9..c2309429146f 100644
> --- a/drivers/acpi/cppc_acpi.c
> +++ b/drivers/acpi/cppc_acpi.c
> @@ -424,6 +424,9 @@ bool acpi_cpc_valid(void)
>         struct cpc_desc *cpc_ptr;
>         int cpu;
>
> +       if (acpi_disabled)
> +               return false;
> +
>         for_each_present_cpu(cpu) {
>                 cpc_ptr = per_cpu(cpc_desc_ptr, cpu);
>                 if (!cpc_ptr)
> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> index 579c851a2bd7..73a8cb31529d 100644
> --- a/drivers/base/arch_topology.c
> +++ b/drivers/base/arch_topology.c
> @@ -352,7 +352,7 @@ void topology_init_cpu_capacity_cppc(void)
>         struct cppc_perf_caps perf_caps;
>         int cpu;
>
> -       if (likely(acpi_disabled || !acpi_cpc_valid()))
> +       if (likely(!acpi_cpc_valid()))
>                 return;
>
>         raw_capacity = kcalloc(num_possible_cpus(), sizeof(*raw_capacity),
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 9cb051d61422..96e4ecddf3f6 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -661,7 +661,7 @@ static int __init amd_pstate_init(void)
>                 return -ENODEV;
>
>         if (!acpi_cpc_valid()) {
> -               pr_debug("the _CPC object is not present in SBIOS\n");
> +               pr_warn_once("the _CPC object is not present in SBIOS or ACPI disabled\n");
>                 return -ENODEV;
>         }
>
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index 24eaf0ec344d..9adb7612993e 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -947,7 +947,7 @@ static int __init cppc_cpufreq_init(void)
>  {
>         int ret;
>
> -       if ((acpi_disabled) || !acpi_cpc_valid())
> +       if (!acpi_cpc_valid())
>                 return -ENODEV;
>
>         cppc_check_hisi_workaround();
> --

Applied as 6.1 material with modified subject and changelog, thanks!

      reply	other threads:[~2022-08-25 11:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-14 16:35 [PATCH v5 0/7] AMD Pstate Enhancement And Issue Fixs Perry Yuan
2022-08-14 16:35 ` [PATCH v5 1/7] cpufreq: amd-pstate: cleanup the unused and duplicated headers declaration Perry Yuan
2022-08-15 15:04   ` Punit Agrawal
2022-09-01  5:34     ` Yuan, Perry
2022-08-14 16:35 ` [PATCH v5 2/7] cpufreq: amd-pstate: simplify cpudata pointer assignment Perry Yuan
2022-08-14 16:35 ` [PATCH v5 3/7] cpufreq: amd-pstate: fix white-space Perry Yuan
2022-08-31 19:07   ` Rafael J. Wysocki
2022-08-14 16:35 ` [PATCH v5 4/7] cpufreq: amd_pstate: fix wrong lowest perf fetch Perry Yuan
2022-08-15 15:05   ` Punit Agrawal
2022-08-31  8:53     ` Yuan, Perry
2022-09-01 14:58       ` Punit Agrawal
2022-08-14 16:35 ` [PATCH v5 5/7] cpufreq: amd_pstate: map desired perf into pstate scope for powersave governor Perry Yuan
2022-08-14 16:35 ` [PATCH v5 6/7] cpufreq: amd-pstate: update pstate frequency transition delay time Perry Yuan
2022-08-15 15:05   ` Punit Agrawal
2022-08-16  7:02     ` Yuan, Perry
2022-08-16 16:03       ` Punit Agrawal
2022-08-14 16:35 ` [PATCH v5 7/7] cpufreq: amd-pstate: add ACPI disabled check in acpi_cpc_valid() Perry Yuan
2022-08-25 11:56   ` Rafael J. Wysocki [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='CAJZ5v0jwBU-6WFXVQZw4w7-r=LeyNqcu=rDHxP55VYKV5ETPng@mail.gmail.com' \
    --to=rafael@kernel.org \
    --cc=Alexander.Deucher@amd.com \
    --cc=Deepak.Sharma@amd.com \
    --cc=Jinzhou.Su@amd.com \
    --cc=Li.Meng@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Nathan.Fontenot@amd.com \
    --cc=Perry.Yuan@amd.com \
    --cc=Shimmer.Huang@amd.com \
    --cc=Xiaojian.Du@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=ray.huang@amd.com \
    --cc=viresh.kumar@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).