]> git.baikalelectronics.ru Git - kernel.git/commit
powercap/intel_rapl: enumerate Psys RAPL domain together with package RAPL domain
authorZhang Rui <rui.zhang@intel.com>
Tue, 13 Oct 2020 07:42:41 +0000 (15:42 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 16 Oct 2020 15:35:36 +0000 (17:35 +0200)
commite8b0519af337b65d81664fd14db256eea3ce52ea
treef585f43c5fac9f2f864029402f7e1da33e48b9a1
parent5fdeb52aeeb5e56e8f241a91794bce9fc127430c
powercap/intel_rapl: enumerate Psys RAPL domain together with package RAPL domain

On multi-package systems, the Psys MSR is only valid for CPUs on
specific package (master package). The current code makes the
assumption that package 0 is the master package, but this is not
true on new platforms like SPR.

Fix the problem by emuerating the Psys RAPL domain for every
package, so CPUs in slave packages will read 0 for the Psys energy
counter and only CPUs in master packages can get a valid reading
and register the Psys RAPL domain.

The sysfs I/F for the Psys RAPL domain is not changed.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/powercap/intel_rapl_common.c
drivers/powercap/intel_rapl_msr.c
include/linux/intel_rapl.h