public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Xi Pardee <xi.pardee@linux.intel.com>
To: xi.pardee@linux.intel.com, irenic.rajneesh@gmail.com,
	david.e.box@linux.intel.com, hdegoede@redhat.com,
	ilpo.jarvinen@linux.intel.com,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 5/9] platform/x86:intel/pmc: Add support to show ltr_ignore value
Date: Mon, 24 Jun 2024 13:32:14 -0700	[thread overview]
Message-ID: <20240624203218.2428475-6-xi.pardee@linux.intel.com> (raw)
In-Reply-To: <20240624203218.2428475-1-xi.pardee@linux.intel.com>

From: Xi Pardee <xi.pardee@intel.com>

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 <xi.pardee@intel.com>
---
 drivers/platform/x86/intel/pmc/core.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
index cb7dd22e7406..3f271ca48164 100644
--- a/drivers/platform/x86/intel/pmc/core.c
+++ b/drivers/platform/x86/intel/pmc/core.c
@@ -623,13 +623,24 @@ static int pmc_core_ltr_show(struct seq_file *s, void *unused)
 	for (i = 0; i < ARRAY_SIZE(pmcdev->pmcs); ++i) {
 		struct pmc *pmc;
 		const struct pmc_bit_map *map;
+		u32 ltr_ign_reg;
 
 		pmc = pmcdev->pmcs[i];
 		if (!pmc)
 			continue;
 
+		scoped_guard(mutex, &pmcdev->lock)
+			ltr_ign_reg = pmc_core_reg_read(pmc, pmc->map->ltr_ignore_offset);
+
 		map = pmc->map->ltr_show_sts;
 		for (index = 0; map[index].name; index++) {
+			bool ltr_ign_data;
+
+			if (index > pmc->map->ltr_ignore_max)
+				ltr_ign_data = false;
+			else
+				ltr_ign_data = ltr_ign_reg & BIT(index);
+
 			decoded_snoop_ltr = decoded_non_snoop_ltr = 0;
 			ltr_raw_data = pmc_core_reg_read(pmc,
 							 map[index].bit_mask);
@@ -647,10 +658,10 @@ static int pmc_core_ltr_show(struct seq_file *s, void *unused)
 				decoded_snoop_ltr = val * convert_ltr_scale(scale);
 			}
 
-			seq_printf(s, "%d\tPMC%d:%-32s\tLTR: RAW: 0x%-16x\tNon-Snoop(ns): %-16llu\tSnoop(ns): %-16llu\n",
+			seq_printf(s, "%d\tPMC%d:%-32s\tLTR: RAW: 0x%-16x\tNon-Snoop(ns): %-16llu\tSnoop(ns): %-16llu\tLTR_IGNORE: %d\n",
 				   ltr_index, i, map[index].name, ltr_raw_data,
 				   decoded_non_snoop_ltr,
-				   decoded_snoop_ltr);
+				   decoded_snoop_ltr, ltr_ign_data);
 			ltr_index++;
 		}
 	}
-- 
2.34.1


  parent reply	other threads:[~2024-06-24 20:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24 20:32 [PATCH 0/9] LTR ignore feature improvement Xi Pardee
2024-06-24 20:32 ` [PATCH 1/9] platform/x86:intel/pmc: Use the return value of pmc_core_send_msg Xi Pardee
2024-06-24 20:32 ` [PATCH 2/9] platform/x86:intel/pmc: Simplify mutex usage with cleanup helpers Xi Pardee
2024-06-24 20:32 ` [PATCH 3/9] platform/x86:intel/pmc: Convert index variables to be unsigned Xi Pardee
2024-07-08  7:56   ` Ilpo Järvinen
2024-06-24 20:32 ` [PATCH 4/9] platform/x86:intel/pmc: Move pmc assignment closer to first usage Xi Pardee
2024-06-24 20:32 ` Xi Pardee [this message]
2024-06-24 20:32 ` [PATCH 6/9] platform/x86:intel/pmc: Remove unneeded min_t check Xi Pardee
2024-06-24 20:32 ` [PATCH 7/9] platform/x86:intel/pmc: Use DEFINE_SHOW_STORE_ATTRIBUTE macro Xi Pardee
2024-06-24 20:32 ` [PATCH 8/9] platform/x86:intel/pmc: Use the Elvis operator Xi Pardee
2024-06-24 20:32 ` [PATCH 9/9] platform/x86:intel/pmc: Add support to undo ltr_ignore Xi Pardee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240624203218.2428475-6-xi.pardee@linux.intel.com \
    --to=xi.pardee@linux.intel.com \
    --cc=david.e.box@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=irenic.rajneesh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox