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


Groups > linux.kernel > #1287501 > unrolled thread

[PATCH v2] powercap, intel_rapl.c, fix BIOS lock check

Started byPrarit Bhargava <prarit@redhat.com>
First post2015-12-09 14:40 +0100
Last post2015-12-11 17:40 +0100
Articles 7 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] powercap, intel_rapl.c, fix BIOS lock check Prarit Bhargava <prarit@redhat.com> - 2015-12-09 14:40 +0100
    Re: [PATCH v2] powercap, intel_rapl.c, fix BIOS lock check Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-09 18:00 +0100
      Re: [PATCH v2] powercap, intel_rapl.c, fix BIOS lock check "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-12-10 00:10 +0100
        Re: [PATCH v2] powercap, intel_rapl.c, fix BIOS lock check Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-10 00:40 +0100
          Re: [PATCH v2] powercap, intel_rapl.c, fix BIOS lock check "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-12-10 01:30 +0100
            Re: [PATCH v2] powercap, intel_rapl.c, fix BIOS lock check Prarit Bhargava <prarit@redhat.com> - 2015-12-10 12:10 +0100
            Re: [PATCH v2] powercap, intel_rapl.c, fix BIOS lock check Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-11 17:40 +0100

#1287501 — [PATCH v2] powercap, intel_rapl.c, fix BIOS lock check

FromPrarit Bhargava <prarit@redhat.com>
Date2015-12-09 14:40 +0100
Subject[PATCH v2] powercap, intel_rapl.c, fix BIOS lock check
Message-ID<qDN8n-xe-39@gated-at.bofh.it>
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.

Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: Radivoje Jovanovic <radivoje.jovanovic@intel.com>
Cc: Seiichi Ikarashi <s.ikarashi@jp.fujitsu.com>
Cc: Mathias Krause <minipli@googlemail.com>
Cc: Ajay Thomas <ajay.thomas.david.rajamanickam@intel.com>
Signed-off-by: Prarit Bhargava <prarit@redhat.com>

[v2]: fix brackets
---
 drivers/powercap/intel_rapl.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/powercap/intel_rapl.c b/drivers/powercap/intel_rapl.c
index cc97f08..48747c2 100644
--- a/drivers/powercap/intel_rapl.c
+++ b/drivers/powercap/intel_rapl.c
@@ -1341,10 +1341,13 @@ static int rapl_detect_domains(struct rapl_package *rp, int cpu)
 
 	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;
 		}
 	}
 
-- 
1.7.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1287644

FromJacob Pan <jacob.jun.pan@linux.intel.com>
Date2015-12-09 18:00 +0100
Message-ID<qDQfV-2uA-29@gated-at.bofh.it>
In reply to#1287501
On Wed,  9 Dec 2015 08:31:12 -0500
Prarit Bhargava <prarit@redhat.com> wrote:

> 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.
> 
> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
> Cc: Radivoje Jovanovic <radivoje.jovanovic@intel.com>
> Cc: Seiichi Ikarashi <s.ikarashi@jp.fujitsu.com>
> Cc: Mathias Krause <minipli@googlemail.com>
> Cc: Ajay Thomas <ajay.thomas.david.rajamanickam@intel.com>
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> 
> [v2]: fix brackets

Acked-by: Jacob Pan <jacob.jun.pan@linux.intel.com>

Good catch by Seiichi, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1287984

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2015-12-10 00:10 +0100
Message-ID<qDW1Z-6ob-25@gated-at.bofh.it>
In reply to#1287644
On Wednesday, December 09, 2015 08:53:55 AM Jacob Pan wrote:
> On Wed,  9 Dec 2015 08:31:12 -0500
> Prarit Bhargava <prarit@redhat.com> wrote:
> 
> > 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.
> > 
> > Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> > Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
> > Cc: Radivoje Jovanovic <radivoje.jovanovic@intel.com>
> > Cc: Seiichi Ikarashi <s.ikarashi@jp.fujitsu.com>
> > Cc: Mathias Krause <minipli@googlemail.com>
> > Cc: Ajay Thomas <ajay.thomas.david.rajamanickam@intel.com>
> > Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> > 
> > [v2]: fix brackets
> 
> Acked-by: Jacob Pan <jacob.jun.pan@linux.intel.com>

OK, I've put it into my bleeding-edge branch as 4.5 candidate, but do we
want it in "stable" and therefore should it be pushed for 4.4?

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1288058

FromJacob Pan <jacob.jun.pan@linux.intel.com>
Date2015-12-10 00:40 +0100
Message-ID<qDWv0-6yV-17@gated-at.bofh.it>
In reply to#1287984
On Thu, 10 Dec 2015 00:38:27 +0100
"Rafael J. Wysocki" <rjw@rjwysocki.net> wrote:

> OK, I've put it into my bleeding-edge branch as 4.5 candidate, but do
> we want it in "stable" and therefore should it be pushed for 4.4?
yes, it is a bug fix that may affect many systems locked by BIOS.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1288078

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2015-12-10 01:30 +0100
Message-ID<qDXho-76y-11@gated-at.bofh.it>
In reply to#1288058
On Wednesday, December 09, 2015 03:31:23 PM Jacob Pan wrote:
> On Thu, 10 Dec 2015 00:38:27 +0100
> "Rafael J. Wysocki" <rjw@rjwysocki.net> wrote:
> 
> > OK, I've put it into my bleeding-edge branch as 4.5 candidate, but do
> > we want it in "stable" and therefore should it be pushed for 4.4?
> yes, it is a bug fix that may affect many systems locked by BIOS.

So which "stable" series in particular should it go to?  All applicable?

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1288444

FromPrarit Bhargava <prarit@redhat.com>
Date2015-12-10 12:10 +0100
Message-ID<qE7gJ-5pn-1@gated-at.bofh.it>
In reply to#1288078

On 12/09/2015 07:52 PM, Rafael J. Wysocki wrote:
> On Wednesday, December 09, 2015 03:31:23 PM Jacob Pan wrote:
>> On Thu, 10 Dec 2015 00:38:27 +0100
>> "Rafael J. Wysocki" <rjw@rjwysocki.net> wrote:
>>
>>> OK, I've put it into my bleeding-edge branch as 4.5 candidate, but do
>>> we want it in "stable" and therefore should it be pushed for 4.4?
>> yes, it is a bug fix that may affect many systems locked by BIOS.
> 
> So which "stable" series in particular should it go to?  All applicable?
> 

Yes, all applicable IMO.

P.

> Thanks,
> Rafael
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1289720

FromJacob Pan <jacob.jun.pan@linux.intel.com>
Date2015-12-11 17:40 +0100
Message-ID<qEyTD-6WC-5@gated-at.bofh.it>
In reply to#1288078
On Thu, 10 Dec 2015 01:52:37 +0100
"Rafael J. Wysocki" <rjw@rjwysocki.net> wrote:

> So which "stable" series in particular should it go to?  All
> applicable?
yes. rapl is there since SNB, quite some time.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web