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>
This commit is contained in:

committed by
Rafael J. Wysocki

parent
7a57e9f112
commit
f1e8d7560d
@@ -79,8 +79,10 @@ struct rapl_power_limit {
|
||||
|
||||
struct rapl_package;
|
||||
|
||||
#define RAPL_DOMAIN_NAME_LENGTH 16
|
||||
|
||||
struct rapl_domain {
|
||||
const char *name;
|
||||
char name[RAPL_DOMAIN_NAME_LENGTH];
|
||||
enum rapl_domain_type id;
|
||||
u64 regs[RAPL_DOMAIN_REG_MAX];
|
||||
struct powercap_zone power_zone;
|
||||
@@ -152,7 +154,4 @@ struct rapl_package *rapl_find_package_domain(int cpu, struct rapl_if_priv *priv
|
||||
struct rapl_package *rapl_add_package(int cpu, struct rapl_if_priv *priv);
|
||||
void rapl_remove_package(struct rapl_package *rp);
|
||||
|
||||
int rapl_add_platform_domain(struct rapl_if_priv *priv);
|
||||
void rapl_remove_platform_domain(struct rapl_if_priv *priv);
|
||||
|
||||
#endif /* __INTEL_RAPL_H__ */
|
||||
|
Reference in New Issue
Block a user