summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorXi Pardee <xi.pardee@linux.intel.com>2026-01-08 14:31:41 -0800
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2026-01-13 16:31:39 +0200
commit99e243c2b170c59f349e1b2a772a6f6a30430b4d (patch)
tree06bf86ccc3b3d55de4d1a527e0c56ed4c3684a72 /drivers/platform
parent92911c91b5b7049cb634ef912feab086fd54ed43 (diff)
platform/x86/intel/pmc: Enable substate residencies for multiple PMCs
Enable substate residencies support for multiple PMCs. Previously substate residencies were shown only for the primary PMC. This change enables substate residencies for all available PMCs. The output of substate_residencies with this patch will be similar to this: pmc0 Substate Residency S0i2.0 0 S0i2.1 0 S0i2.2 0 pmc1 Substate Residency S0i2.0 0 S0i2.1 0 S0i2.2 0 pmc2 Substate Residency S0i2.0 0 Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com> Link: https://patch.msgid.link/20260108223144.504267-4-xi.pardee@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/intel/pmc/core.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
index c76934ad7bf1..e16f9630b908 100644
--- a/drivers/platform/x86/intel/pmc/core.c
+++ b/drivers/platform/x86/intel/pmc/core.c
@@ -776,16 +776,26 @@ static inline u64 adjust_lpm_residency(struct pmc *pmc, u32 offset,
static int pmc_core_substate_res_show(struct seq_file *s, void *unused)
{
struct pmc_dev *pmcdev = s->private;
- struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
- const int lpm_adj_x2 = pmc->map->lpm_res_counter_step_x2;
- u32 offset = pmc->map->lpm_residency_offset;
- u8 mode;
+ unsigned int pmc_idx;
+
+ for (pmc_idx = 0; pmc_idx < ARRAY_SIZE(pmcdev->pmcs); ++pmc_idx) {
+ int lpm_adj_x2;
+ struct pmc *pmc;
+ u32 offset;
+ u8 mode;
- seq_printf(s, "%-10s %-15s\n", "Substate", "Residency");
+ pmc = pmcdev->pmcs[pmc_idx];
+ if (!pmc)
+ continue;
- pmc_for_each_mode(mode, pmc) {
- seq_printf(s, "%-10s %-15llu\n", pmc_lpm_modes[mode],
- adjust_lpm_residency(pmc, offset + (4 * mode), lpm_adj_x2));
+ lpm_adj_x2 = pmc->map->lpm_res_counter_step_x2;
+ offset = pmc->map->lpm_residency_offset;
+
+ seq_printf(s, "pmc%u %10s %15s\n", pmc_idx, "Substate", "Residency");
+ pmc_for_each_mode(mode, pmc) {
+ seq_printf(s, "%15s %15llu\n", pmc_lpm_modes[mode],
+ adjust_lpm_residency(pmc, offset + (4 * mode), lpm_adj_x2));
+ }
}
return 0;