All of lore.kernel.org
 help / color / mirror / Atom feed
From: oceanhe@zoho.com.cn
To: srinivas.pandruvada@linux.intel.com, lenb@kernel.org
Cc: rjw@rjwysocki.net, viresh.kumar@linaro.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ocean He <hehy1@lenovo.com>
Subject: [PATCH] cpufreq: intel_pstate: warn if HWP Native mode and OOB mode are both set
Date: Sun, 29 Jul 2018 00:14:56 -0400	[thread overview]
Message-ID: <1532837696-11505-1-git-send-email-oceanhe@zoho.com.cn> (raw)

From: Ocean He <hehy1@lenovo.com>

Refer to Intel HWPM Compliance Guide (Document Number: 566474): Bit[6] or
bit[8] of MSR MISC_PWR_MGMT is set only when BIOS select either HWP Native
mode or HWP OOB mode. Bit[6] and bit[8] cannot be set both at the same
time.

Add a warning message if intel_pstate detects both HWP Native mode and
HWP OOB mode are set at the same time.

Signed-off-by: Ocean He <hehy1@lenovo.com>
---
 drivers/cpufreq/intel_pstate.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 3c39712..678d3f2 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -2455,8 +2455,12 @@ static bool __init intel_pstate_platform_pwr_mgmt_exists(void)
 	id = x86_match_cpu(intel_pstate_cpu_oob_ids);
 	if (id) {
 		rdmsrl(MSR_MISC_PWR_MGMT, misc_pwr);
-		if ( misc_pwr & (1 << 8))
+		if (misc_pwr & (1 << 8)) {
+			if (misc_pwr & (1 << 6))
+				pr_warn(FW_WARN
+					"HWP Native mode and OOB mode cannot be set both at the same time.\n");
 			return true;
+		}
 	}
 
 	idx = acpi_match_platform_list(plat_info);
-- 
1.8.3.1



             reply	other threads:[~2018-07-29  4:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-29  4:14 oceanhe [this message]
2018-09-14  9:09 ` [PATCH] cpufreq: intel_pstate: warn if HWP Native mode and OOB mode are both set Rafael J. Wysocki

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=1532837696-11505-1-git-send-email-oceanhe@zoho.com.cn \
    --to=oceanhe@zoho.com.cn \
    --cc=hehy1@lenovo.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=srinivas.pandruvada@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.