summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid E. Box <david.e.box@linux.intel.com>2026-06-12 14:01:43 -0700
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2026-06-15 02:12:54 +0300
commitb3de79d932bdcee4b2b9c8f9a058516699cf1c50 (patch)
tree4a9ca4f2b0b55e040447615e5a098dc3dc2af141
parentacd3b94f8604aeee2b62f8fd18e95a0474546288 (diff)
platform/x86/intel/pmt/crashlog: Split init into pre-decode
Refactor crashlog initialization to use the PMT namespace pre-decode hook: - Add pmt_crashlog_pre_decode() to parse type/version, select the crashlog_info, initialize the control mutex, and set entry->attr_grp. - Simplify pmt_crashlog_header_decode() to only read header fields from the discovery table. - Wire the namespace with .pmt_pre_decode = pmt_crashlog_pre_decode. This separates structural initialization from header parsing, aligning crashlog with the PMT class pre/post decode flow. Signed-off-by: David E. Box <david.e.box@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://patch.msgid.link/ed8cda8456c97132cf2d2b4ff6a5cffb1ce3a666.1781294741.git.david.e.box@linux.intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
-rw-r--r--drivers/platform/x86/intel/pmt/crashlog.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/platform/x86/intel/pmt/crashlog.c b/drivers/platform/x86/intel/pmt/crashlog.c
index b0393c9c5b4b..f936daf99e4d 100644
--- a/drivers/platform/x86/intel/pmt/crashlog.c
+++ b/drivers/platform/x86/intel/pmt/crashlog.c
@@ -496,11 +496,9 @@ static const struct crashlog_info *select_crashlog_info(u32 type, u32 version)
return &crashlog_type1_ver2;
}
-static int pmt_crashlog_header_decode(struct intel_pmt_entry *entry,
- struct device *dev)
+static int pmt_crashlog_pre_decode(struct intel_vsec_device *ivdev,
+ struct intel_pmt_entry *entry)
{
- void __iomem *disc_table = entry->disc_table;
- struct intel_pmt_header *header = &entry->header;
struct crashlog_entry *crashlog;
u32 version;
u32 type;
@@ -513,6 +511,16 @@ static int pmt_crashlog_header_decode(struct intel_pmt_entry *entry,
mutex_init(&crashlog->control_mutex);
crashlog->info = select_crashlog_info(type, version);
+ entry->attr_grp = crashlog->info->attr_grp;
+
+ return 0;
+}
+
+static int pmt_crashlog_header_decode(struct intel_pmt_entry *entry,
+ struct device *dev)
+{
+ void __iomem *disc_table = entry->disc_table;
+ struct intel_pmt_header *header = &entry->header;
header->access_type = GET_ACCESS(readl(disc_table));
header->guid = readl(disc_table + GUID_OFFSET);
@@ -521,8 +529,6 @@ static int pmt_crashlog_header_decode(struct intel_pmt_entry *entry,
/* Size is measured in DWORDS, but accessor returns bytes */
header->size = GET_SIZE(readl(disc_table + SIZE_OFFSET));
- entry->attr_grp = crashlog->info->attr_grp;
-
return 0;
}
@@ -530,6 +536,7 @@ static DEFINE_XARRAY_ALLOC(crashlog_array);
static struct intel_pmt_namespace pmt_crashlog_ns = {
.name = "crashlog",
.xa = &crashlog_array,
+ .pmt_pre_decode = pmt_crashlog_pre_decode,
.pmt_header_decode = pmt_crashlog_header_decode,
};