Skip to content

Commit a6fe07c

Browse files
kaneche1jwrdegoede
authored andcommitted
platform/x86/intel/pmc: Show live substate requirements
While debugging runtime s0ix, we do need to check which required IPs are not power gated. This patch adds code to show live substate status vs requirements in sys/kernel/debug/pmc_core/substate_requirements to help runtime s0ix debug. Signed-off-by: Kane Chen <kane.chen@intel.com> Link: https://lore.kernel.org/r/20240719122807.3853292-1-kane.chen@intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent 4c29e80 commit a6fe07c

File tree

1 file changed

+11
-1
lines changed
  • drivers/platform/x86/intel/pmc

1 file changed

+11
-1
lines changed

drivers/platform/x86/intel/pmc/core.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,13 +794,15 @@ static void pmc_core_substate_req_header_show(struct seq_file *s, int pmc_index)
794794
pmc_for_each_mode(i, mode, pmcdev)
795795
seq_printf(s, " %9s |", pmc_lpm_modes[mode]);
796796

797-
seq_printf(s, " %9s |\n", "Status");
797+
seq_printf(s, " %9s |", "Status");
798+
seq_printf(s, " %11s |\n", "Live Status");
798799
}
799800

800801
static int pmc_core_substate_req_regs_show(struct seq_file *s, void *unused)
801802
{
802803
struct pmc_dev *pmcdev = s->private;
803804
u32 sts_offset;
805+
u32 sts_offset_live;
804806
u32 *lpm_req_regs;
805807
unsigned int mp, pmc_index;
806808
int num_maps;
@@ -815,6 +817,7 @@ static int pmc_core_substate_req_regs_show(struct seq_file *s, void *unused)
815817
maps = pmc->map->lpm_sts;
816818
num_maps = pmc->map->lpm_num_maps;
817819
sts_offset = pmc->map->lpm_status_offset;
820+
sts_offset_live = pmc->map->lpm_live_status_offset;
818821
lpm_req_regs = pmc->lpm_req_regs;
819822

820823
/*
@@ -832,6 +835,7 @@ static int pmc_core_substate_req_regs_show(struct seq_file *s, void *unused)
832835
for (mp = 0; mp < num_maps; mp++) {
833836
u32 req_mask = 0;
834837
u32 lpm_status;
838+
u32 lpm_status_live;
835839
const struct pmc_bit_map *map;
836840
int mode, idx, i, len = 32;
837841

@@ -846,6 +850,9 @@ static int pmc_core_substate_req_regs_show(struct seq_file *s, void *unused)
846850
/* Get the last latched status for this map */
847851
lpm_status = pmc_core_reg_read(pmc, sts_offset + (mp * 4));
848852

853+
/* Get the runtime status for this map */
854+
lpm_status_live = pmc_core_reg_read(pmc, sts_offset_live + (mp * 4));
855+
849856
/* Loop over elements in this map */
850857
map = maps[mp];
851858
for (i = 0; map[i].name && i < len; i++) {
@@ -872,6 +879,9 @@ static int pmc_core_substate_req_regs_show(struct seq_file *s, void *unused)
872879
/* In Status column, show the last captured state of this agent */
873880
seq_printf(s, " %9s |", lpm_status & bit_mask ? "Yes" : " ");
874881

882+
/* In Live status column, show the live state of this agent */
883+
seq_printf(s, " %11s |", lpm_status_live & bit_mask ? "Yes" : " ");
884+
875885
seq_puts(s, "\n");
876886
}
877887
}

0 commit comments

Comments
 (0)