public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Punit Agrawal <punitagrawal@gmail.com>
To: rjw@rjwysocki.net
Cc: Punit Agrawal <punitagrawal@gmail.com>,
	wei.huang2@amd.com, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, bp@alien8.de
Subject: [PATCH 2/2] cpufreq: acpi-cpufreq: Add processor to the ignore PSD override list
Date: Fri, 11 Dec 2020 07:56:40 +0900	[thread overview]
Message-ID: <20201210225640.317719-3-punitagrawal@gmail.com> (raw)
In-Reply-To: <20201210225640.317719-1-punitagrawal@gmail.com>

Booting Linux on a Zen2 based processor (family: 0x17, model: 0x60,
stepping: 0x1) shows the following message in the logs -

    acpi_cpufreq: overriding BIOS provided _PSD data

Although commit 5368512abe08 ("acpi-cpufreq: Honor _PSD table setting
on new AMD CPUs") indicates that the override is not required for Zen3
onwards, it seems that domain information can be trusted even on
certain earlier systems. Update the check, to skip the override for
Zen2 processors known to work without the override.

Signed-off-by: Punit Agrawal <punitagrawal@gmail.com>
Cc: Wei Huang <wei.huang2@amd.com>
---
 drivers/cpufreq/acpi-cpufreq.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 126315ad225f..32b6449a438b 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -198,8 +198,13 @@ static bool amd_override_acpi_psd(unsigned int cpu_id)
 	if (c->x86_vendor == X86_VENDOR_AMD) {
 		if (!check_amd_hwpstate_cpu(cpu_id))
 			return false;
-
-		return c->x86 < 0x19;
+		/*
+		 * CPU's before Zen3 (except some Zen2) need the
+		 * override.
+		 */
+		return (c->x86 < 0x19) &&
+			!(c->x86 == 0x17 && c->x86_model == 0x60 &&
+			  c->x86_stepping == 0x1);
 	}
 
 	return false;
-- 
2.29.2


  parent reply	other threads:[~2020-12-10 22:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10 22:56 [PATCH 0/2] Add processor to the ignore PSD override list Punit Agrawal
2020-12-10 22:56 ` [PATCH 1/2] cpufreq: acpi-cpufreq: Re-factor overriding ACPI PSD Punit Agrawal
2020-12-10 22:56 ` Punit Agrawal [this message]
2020-12-10 23:03   ` [PATCH 2/2] cpufreq: acpi-cpufreq: Add processor to the ignore PSD override list Borislav Petkov
2020-12-11 23:36     ` Punit Agrawal

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=20201210225640.317719-3-punitagrawal@gmail.com \
    --to=punitagrawal@gmail.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=wei.huang2@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