powercap, intel_rapl.c, fix BIOS lock check
PATCH v2 1/1 powercap, intel_rapl.c, fix BIOS lock check
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.
[v2]: fix brackets
--- drivers/powercap/intel_rapl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/powercap/intel_rapl.c +5 -2
@@ -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 ; } }
Signature · 1 line
1.7.9.3
Quoted 21 lines · On Wed, 9 Dec 2015 08:31:12 -0500 Prarit Bhargava <[email protected]> wrote:
Intel RAPL initialized on several systems where the BIOS lock bit (msr
0x610, bit 63) was set. This occured because the return value ofrapl_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 BIOSand does not initialize for the package.
Cc "Rafael J. Wysocki" <[email protected]>Cc Jacob Pan <[email protected]>Cc Radivoje Jovanovic <[email protected]>Cc Seiichi Ikarashi <[email protected]>Cc Mathias Krause <[email protected]>Cc Ajay Thomas <[email protected]>Signed-off-by Prarit Bhargava <[email protected]>
Quoted 1 line
[v2]: fix brackets
Good catch by Seiichi, thanks.
Quoted 24 lines · Jacob Pan
Quoted 21 lines · On Wed, 9 Dec 2015 08:31:12 -0500 Prarit Bhargava <[email protected]> wrote:
Intel RAPL initialized on several systems where the BIOS lock bit (msr
0x610, bit 63) was set. This occured because the return value ofrapl_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 BIOSand does not initialize for the package.
Cc "Rafael J. Wysocki" <[email protected]>Cc Jacob Pan <[email protected]>Cc Radivoje Jovanovic <[email protected]>Cc Seiichi Ikarashi <[email protected]>Cc Mathias Krause <[email protected]>Cc Ajay Thomas <[email protected]>Signed-off-by Prarit Bhargava <[email protected]>
Quoted 3 lines
Quoted 1 line
[v2]: fix brackets
Acked-by Jacob Pan <[email protected]>
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
Quoted 2 lines · On Thu, 10 Dec 2015 00:38:27 +0100 "Rafael J. Wysocki" <[email protected]>…
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.
Quoted 6 lines · Jacob Pan
Quoted 2 lines · On Thu, 10 Dec 2015 00:38:27 +0100 "Rafael J. Wysocki" <[email protected]>…
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
Quoted 10 lines · Rafael J. Wysocki
Quoted 6 lines · Jacob Pan
Quoted 2 lines · On Thu, 10 Dec 2015 00:38:27 +0100 "Rafael J. Wysocki" <[email protected]>…
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.
Quoted 3 lines
Thanks,
Rafael
Quoted 2 lines · On Thu, 10 Dec 2015 01:52:37 +0100 "Rafael J. Wysocki" <[email protected]>…
So which "stable" series in particular should it go to? All applicable?
yes. rapl is there since SNB, quite some time.