Linux Power Management development
 help / color / mirror / Atom feed
From: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
To: <rafael@kernel.org>, <len.brown@intel.com>, <pavel@ucw.cz>,
	<tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>,
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, <hpa@zytor.com>,
	<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <CobeChen@zhaoxin.com>, <TimGuo@zhaoxin.com>,
	<LindaChai@zhaoxin.com>, <LeoLiu@zhaoxin.com>
Subject: [PATCH] x86/cstate: Add Zhaoxin ACPI Cx FFH MWAIT support
Date: Wed, 22 Jun 2022 11:29:41 +0800	[thread overview]
Message-ID: <bccae278-e735-4681-cb3a-41359e42032b@zhaoxin.com> (raw)

Recent Zhaoxin CPUs support X86_FEATURE_MWAIT that implies the
MONITOR/MWAIT instructions can be used for ACPI Cx state. The BIOS
declares Cx state in _CST object to use FFH on Zhaoxin systems. So
let function ffh_cstate_init() support Zhaoxin too.

Signed-off-by: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
---
  arch/x86/kernel/acpi/cstate.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
index 7945eae..d4185e1 100644
--- a/arch/x86/kernel/acpi/cstate.c
+++ b/arch/x86/kernel/acpi/cstate.c
@@ -213,7 +213,9 @@ static int __init ffh_cstate_init(void)

  	if (c->x86_vendor != X86_VENDOR_INTEL &&
  	    c->x86_vendor != X86_VENDOR_AMD &&
-	    c->x86_vendor != X86_VENDOR_HYGON)
+	    c->x86_vendor != X86_VENDOR_HYGON &&
+	    c->x86_vendor != X86_VENDOR_CENTAUR &&
+	    c->x86_vendor != X86_VENDOR_ZHAOXIN)
  		return -1;

  	cpu_cstate_entry = alloc_percpu(struct cstate_entry);
-- 
2.7.4

             reply	other threads:[~2022-06-22  3:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22  3:29 Tony W Wang-oc [this message]
2022-06-22 13:38 ` [PATCH] x86/cstate: Add Zhaoxin ACPI Cx FFH MWAIT support Rafael J. Wysocki
2022-06-23  1:10   ` Tony W Wang-oc

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=bccae278-e735-4681-cb3a-41359e42032b@zhaoxin.com \
    --to=tonywwang-oc@zhaoxin.com \
    --cc=CobeChen@zhaoxin.com \
    --cc=LeoLiu@zhaoxin.com \
    --cc=LindaChai@zhaoxin.com \
    --cc=TimGuo@zhaoxin.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=rafael@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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