Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1347592

[PATCH 3.14 083/130] powercap / RAPL: fix BIOS lock check

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 3.14 083/130] powercap / RAPL: fix BIOS lock check
Date Wed, 02 Mar 2016 03:00:05 +0100
Message-ID <r84f3-EO-67@gated-at.bofh.it> (permalink)
References <r82dd-7Iy-13@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; s=mandrill; d=linuxfoundation.org; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Date:MIME-Version:Content-Type:Content-Transfer-Encoding; i=gregkh@linuxfoundation.org; bh=68qgJoPxjk1gQBsmRdLndX9qk34=; b=XOoB0ggFv9TZadK5cO57Q6J56wL5LQptbvFh4zIdGj8GSH7QM3cTa/nV8OrklzlqPO+xIY0fj0SV Z8ZGDgd7ocKLYVqdDNBrYRVsi6hzjX+275et9rkF2Ck/sfOQx3pYZyBlCIlZu+qaiakiEOwB+ojr fzsi0UOegBMunt2m70I=
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; i=@mandrillapp.com; q=dns/txt; s=mandrill; t=1456876279; h=From : Subject : To : Cc : Message-Id : In-Reply-To : References : Date : MIME-Version : Content-Type : Content-Transfer-Encoding : From : Subject : Date : X-Mandrill-User : List-Unsubscribe; bh=VM5h4C/gRGUBC7sGOlJDgF1X0SMbu06Y4zoKoI7XXqg=; b=mFoTZ21/eLSCu7pH27Si8TrbMSFUXVN3E/sqeipBVy9cvPzi2JGBF8pwUam+qr68u4GivW j2E865mMMeu6wixoM7nS7rFUMzJJyuU7An5Ex6WOT3bemfQc5Y9zPodi3Rg/E0KFRR6wsPa8 3FL9sAIouvaWg43aUa5+NuS98oYZA=
X-Mailer git-send-email 2.7.2
X-Report-Abuse Please forward a copy of this message, including all headers, to abuse@mandrill.com
X-Report-Abuse You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30481620.402f870b4a9f4a2085ef4a5b4ecc6360
X-Mandrill-User md_30481620
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 46
Organization linux.* mail to news gateway
X-Original-Cc Greg Kroah-Hartman <gregkh@linuxfoundation.org>, <stable@vger.kernel.org>, Prarit Bhargava <prarit@redhat.com>, Jacob Pan <jacob.jun.pan@linux.intel.com>, "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
X-Original-Date Tue, 01 Mar 2016 23:51:19 +0000
X-Original-Message-ID <20160301234502.743511000@linuxfoundation.org>
X-Original-References <20160301234459.768886030@linuxfoundation.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1347592

Show key headers only | View raw


3.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Prarit Bhargava <prarit@redhat.com>

commit 79a21dbfae3cd40d5a801778071a9967b79c2c20 upstream.

Intel RAPL initialized on several systems where the BIOS lock bit (msr
0x610, bit 63) was set.  This occured because the return value of
rapl_read_data_raw() was being checked, rather than the value of the variable
passed in, locked.

This patch properly implments the rapl_read_data_raw() call to check the
variable locked, and now the Intel RAPL driver outputs the warning:

	intel_rapl: RAPL package 0 domain package locked by BIOS

and does not initialize for the package.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/powercap/intel_rapl.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/drivers/powercap/intel_rapl.c
+++ b/drivers/powercap/intel_rapl.c
@@ -1194,10 +1194,13 @@ static int rapl_detect_domains(struct ra
 
 	for (rd = rp->domains; rd < rp->domains + rp->nr_domains; rd++) {
 		/* check if the domain is locked by BIOS */
-		if (rapl_read_data_raw(rd, FW_LOCK, false, &locked)) {
+		ret = rapl_read_data_raw(rd, FW_LOCK, false, &locked);
+		if (ret)
+			return ret;
+		if (locked) {
 			pr_info("RAPL package %d domain %s locked by BIOS\n",
 				rp->id, rd->name);
-				rd->state |= DOMAIN_STATE_BIOS_LOCKED;
+			rd->state |= DOMAIN_STATE_BIOS_LOCKED;
 		}
 	}

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 3.14 083/130] powercap / RAPL: fix BIOS lock check Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-02 03:00 +0100

csiph-web