MSR and MMIO RAPL interface have different sets of registers, thus the RAPL register address should be obtained from interface specific structure, i.e. struct rapl_if_private, instead.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -95,11 +95,15 @@ struct rapl_domain { · 94 unmodified lines | |||
| 95 | * @platform_rapl_domain: Optional. Some RAPL interface may have platform | 95 | * @platform_rapl_domain: Optional. Some RAPL interface may have platform |
| 96 | * level RAPL control. | 96 | * level RAPL control. |
| 97 | * @pcap_rapl_online: CPU hotplug state for each RAPL interface. | 97 | * @pcap_rapl_online: CPU hotplug state for each RAPL interface. |
| 98 | * @reg_unit: Register for getting energy/power/time unit. | ||
| 99 | * @regs: Register sets for different RAPL Domains. | ||
| 98 | */ | 100 | */ |
| 99 | struct rapl_if_priv { | 101 | struct rapl_if_priv { |
| 100 | struct powercap_control_type *control_type; | 102 | struct powercap_control_type *control_type; |
| 101 | struct rapl_domain *platform_rapl_domain; | 103 | struct rapl_domain *platform_rapl_domain; |
| 102 | enum cpuhp_state pcap_rapl_online; | 104 | enum cpuhp_state pcap_rapl_online; |
| 105 | u32 reg_unit; | ||
| 106 | u32 regs[RAPL_DOMAIN_MAX][RAPL_DOMAIN_REG_MAX]; | ||
| 103 | }; | 107 | }; |
| 104 | 108 | ||
| 105 | /* maximum rapl package domain name: package-%d-die-%d */ | 109 | /* maximum rapl package domain name: package-%d-die-%d */ |