[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220629221334.434307-4-gayatri.kammela@linux.intel.com>
Date: Wed, 29 Jun 2022 15:13:33 -0700
From: Gayatri Kammela <gayatri.kammela@...ux.intel.com>
To: hdegoede@...hat.com
Cc: markgross@...nel.org, david.e.box@...ux.intel.com,
srinivas.pandruvada@...el.com, platform-driver-x86@...r.kernel.org,
linux-kernel@...r.kernel.org,
Gayatri Kammela <gayatri.kammela@...ux.intel.com>
Subject: [PATCH v1 3/4] platform/x86/intel/pmt: telemetry: Fix fixed region handling
From: "David E. Box" <david.e.box@...ux.intel.com>
Use the telem_type and the fixed block guid to determine if an entry is a
fixed region. For certain platforms we don't support this.
Cc: Srinivas Pandruvada <srinivas.pandruvada@...el.com>
Signed-off-by: David E. Box <david.e.box@...ux.intel.com>
Signed-off-by: Gayatri Kammela <gayatri.kammela@...ux.intel.com>
---
drivers/platform/x86/intel/pmt/telemetry.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/intel/pmt/telemetry.c b/drivers/platform/x86/intel/pmt/telemetry.c
index f73ecfd4a309..5e4009c05ecf 100644
--- a/drivers/platform/x86/intel/pmt/telemetry.c
+++ b/drivers/platform/x86/intel/pmt/telemetry.c
@@ -23,12 +23,19 @@
#define TELEM_GUID_OFFSET 0x4
#define TELEM_BASE_OFFSET 0x8
#define TELEM_ACCESS(v) ((v) & GENMASK(3, 0))
+#define TELEM_TYPE(v) (((v) & GENMASK(7, 4)) >> 4)
/* size is in bytes */
#define TELEM_SIZE(v) (((v) & GENMASK(27, 12)) >> 10)
/* Used by client hardware to identify a fixed telemetry entry*/
#define TELEM_CLIENT_FIXED_BLOCK_GUID 0x10000000
+enum telem_type {
+ TELEM_TYPE_PUNIT = 0,
+ TELEM_TYPE_CRASHLOG,
+ TELEM_TYPE_PUNIT_FIXED,
+};
+
struct pmt_telem_priv {
int num_entries;
struct intel_pmt_entry entry[];
@@ -39,10 +46,15 @@ static bool pmt_telem_region_overlaps(struct intel_pmt_entry *entry,
{
u32 guid = readl(entry->disc_table + TELEM_GUID_OFFSET);
- if (guid != TELEM_CLIENT_FIXED_BLOCK_GUID)
- return false;
+ if (intel_pmt_is_early_client_hw(dev)) {
+ u32 type = TELEM_TYPE(readl(entry->disc_table));
+
+ if ((type == TELEM_TYPE_PUNIT_FIXED) ||
+ (guid == TELEM_CLIENT_FIXED_BLOCK_GUID))
+ return true;
+ }
- return intel_pmt_is_early_client_hw(dev);
+ return false;
}
static int pmt_telem_header_decode(struct intel_pmt_entry *entry,
--
2.32.0
Powered by blists - more mailing lists