Skip to content

Commit 438aef8

Browse files
xpardee-createij-intel
authored andcommitted
platform/x86:intel/pmc: Add support to show ltr_ignore value
Add a column in ltr_show output to show if the IP has been ignored. A mutex lock is used to protect the critical section as other processes might try to write to the LTR ignore register at the same time. Signed-off-by: Xi Pardee <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 4455e2b commit 438aef8

File tree

1 file changed

+13
-2
lines changed
  • drivers/platform/x86/intel/pmc

1 file changed

+13
-2
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,13 +623,24 @@ static int pmc_core_ltr_show(struct seq_file *s, void *unused)
623623
for (i = 0; i < ARRAY_SIZE(pmcdev->pmcs); ++i) {
624624
struct pmc *pmc;
625625
const struct pmc_bit_map *map;
626+
u32 ltr_ign_reg;
626627

627628
pmc = pmcdev->pmcs[i];
628629
if (!pmc)
629630
continue;
630631

632+
scoped_guard(mutex, &pmcdev->lock)
633+
ltr_ign_reg = pmc_core_reg_read(pmc, pmc->map->ltr_ignore_offset);
634+
631635
map = pmc->map->ltr_show_sts;
632636
for (index = 0; map[index].name; index++) {
637+
bool ltr_ign_data;
638+
639+
if (index > pmc->map->ltr_ignore_max)
640+
ltr_ign_data = false;
641+
else
642+
ltr_ign_data = ltr_ign_reg & BIT(index);
643+
633644
decoded_snoop_ltr = decoded_non_snoop_ltr = 0;
634645
ltr_raw_data = pmc_core_reg_read(pmc,
635646
map[index].bit_mask);
@@ -647,10 +658,10 @@ static int pmc_core_ltr_show(struct seq_file *s, void *unused)
647658
decoded_snoop_ltr = val * convert_ltr_scale(scale);
648659
}
649660

650-
seq_printf(s, "%d\tPMC%d:%-32s\tLTR: RAW: 0x%-16x\tNon-Snoop(ns): %-16llu\tSnoop(ns): %-16llu\n",
661+
seq_printf(s, "%d\tPMC%d:%-32s\tLTR: RAW: 0x%-16x\tNon-Snoop(ns): %-16llu\tSnoop(ns): %-16llu\tLTR_IGNORE: %d\n",
651662
ltr_index, i, map[index].name, ltr_raw_data,
652663
decoded_non_snoop_ltr,
653-
decoded_snoop_ltr);
664+
decoded_snoop_ltr, ltr_ign_data);
654665
ltr_index++;
655666
}
656667
}

0 commit comments

Comments
 (0)