Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Xi Pardee and committed by
Ilpo Järvinen
99e243c2 92911c91

+18 -8
+18 -8
drivers/platform/x86/intel/pmc/core.c
··· 776 776 static int pmc_core_substate_res_show(struct seq_file *s, void *unused) 777 777 { 778 778 struct pmc_dev *pmcdev = s->private; 779 - struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; 780 - const int lpm_adj_x2 = pmc->map->lpm_res_counter_step_x2; 781 - u32 offset = pmc->map->lpm_residency_offset; 782 - u8 mode; 779 + unsigned int pmc_idx; 783 780 784 - seq_printf(s, "%-10s %-15s\n", "Substate", "Residency"); 781 + for (pmc_idx = 0; pmc_idx < ARRAY_SIZE(pmcdev->pmcs); ++pmc_idx) { 782 + int lpm_adj_x2; 783 + struct pmc *pmc; 784 + u32 offset; 785 + u8 mode; 785 786 786 - pmc_for_each_mode(mode, pmc) { 787 - seq_printf(s, "%-10s %-15llu\n", pmc_lpm_modes[mode], 788 - adjust_lpm_residency(pmc, offset + (4 * mode), lpm_adj_x2)); 787 + pmc = pmcdev->pmcs[pmc_idx]; 788 + if (!pmc) 789 + continue; 790 + 791 + lpm_adj_x2 = pmc->map->lpm_res_counter_step_x2; 792 + offset = pmc->map->lpm_residency_offset; 793 + 794 + seq_printf(s, "pmc%u %10s %15s\n", pmc_idx, "Substate", "Residency"); 795 + pmc_for_each_mode(mode, pmc) { 796 + seq_printf(s, "%15s %15llu\n", pmc_lpm_modes[mode], 797 + adjust_lpm_residency(pmc, offset + (4 * mode), lpm_adj_x2)); 798 + } 789 799 } 790 800 791 801 return 0;