]> 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)
commit1bfebcd1758330c24530424d5dfc8d06906207e6
treef585f43c5fac9f2f864029402f7e1da33e48b9a1
parent4c6c29dc34068979eed48fa84c80342447edc175
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