[PATCH 09/10] sysfs debug
Ruhl, Michael J
michael.j.ruhl at intel.com
Mon Jun 2 15:07:50 UTC 2025
>-----Original Message-----
>From: Ilpo Järvinen <ilpo.jarvinen at linux.intel.com>
>Sent: Saturday, May 31, 2025 1:54 AM
>To: Ruhl, Michael J <michael.j.ruhl at intel.com>
>Cc: platform-driver-x86 at vger.kernel.org; intel-xe at lists.freedesktop.org; Hans
>de Goede <hdegoede at redhat.com>; De Marchi, Lucas
><lucas.demarchi at intel.com>; Vivi, Rodrigo <rodrigo.vivi at intel.com>
>Subject: Re: [PATCH 09/10] sysfs debug
>
>On Fri, 30 May 2025, Michael J. Ruhl wrote:
>
>No changelog.
>
>> Signed-off-by: Michael J. Ruhl <michael.j.ruhl at intel.com>
>> ---
>> drivers/platform/x86/intel/pmt/crashlog.c | 31
>+++++++++++++++++++++++
>> 1 file changed, 31 insertions(+)
>>
>> diff --git a/drivers/platform/x86/intel/pmt/crashlog.c
>b/drivers/platform/x86/intel/pmt/crashlog.c
>> index 7291c93d71df..985f2c685841 100644
>> --- a/drivers/platform/x86/intel/pmt/crashlog.c
>> +++ b/drivers/platform/x86/intel/pmt/crashlog.c
>> @@ -469,6 +469,34 @@ trigger_store(struct device *dev, struct
>device_attribute *attr,
>> }
>> static DEVICE_ATTR_RW(trigger);
>>
>> +#define DEBUG_REGISTER_INFO
>> +#ifdef DEBUG_REGISTER_INFO
>
>Ah, I see, this is probably your debug/test patch you included by
>accident. :-)
Yup. Sorry for the noise. I will attempt to send only relevant patches next time.
Thanks,
M
>> +static ssize_t
>> +status_show(struct device *dev, struct device_attribute *attr, char *buf)
>> +{
>> + struct crashlog_entry *crashlog = dev_get_drvdata(dev);
>> + u32 status = readl(crashlog->entry.disc_table + crashlog->info-
>>status.offset);
>> + u32 control = readl(crashlog->entry.disc_table + crashlog->info-
>>control.offset);
>> + int len = 0;
>> +
>> + len += sysfs_emit_at(buf, len, "clear_support: 0x%08x\n", status &
>crashlog->info->status.clear_supported);
>> + len += sysfs_emit_at(buf, len, "rearmed: 0x%08x\n", status & crashlog-
>>info->status.rearmed);
>> + len += sysfs_emit_at(buf, len, "error: 0x%08x\n", status & crashlog-
>>info->status.error);
>> + len += sysfs_emit_at(buf, len, "consumed: 0x%08x\n", status &
>crashlog->info->status.consumed);
>> + len += sysfs_emit_at(buf, len, "disable: 0x%08x\n", status & crashlog-
>>info->status.disabled);
>> + len += sysfs_emit_at(buf, len, "cleared: 0x%08x\n", status & crashlog-
>>info->status.cleared);
>> + len += sysfs_emit_at(buf, len, "in_progress: 0x%08x\n", status &
>crashlog->info->status.in_progress);
>> + len += sysfs_emit_at(buf, len, "complete: 0x%08x\n", status & crashlog-
>>info->status.complete);
>> + len += sysfs_emit_at(buf, len, "sts_off: 0x%02x ctl_off: 0x%02x\n",
>crashlog->info->status.offset,
>> + crashlog->info->control.offset);
>> + len += sysfs_emit_at(buf, len, "status: 0x%08x\n", status);
>> + len += sysfs_emit_at(buf, len, "control: 0x%08x\n", control);
>> +
>> + return len;
>> +}
>> +static DEVICE_ATTR_RO(status);
>> +#endif
>> +
>> static struct attribute *pmt_crashlog_attrs[] = {
>> &dev_attr_enable.attr,
>> &dev_attr_trigger.attr,
>> @@ -482,6 +510,9 @@ static struct attribute *pmt_crashlog_ver2_attrs[] = {
>> &dev_attr_error.attr,
>> &dev_attr_rearm.attr,
>> &dev_attr_trigger.attr,
>> +#ifdef DEBUG_REGISTER_INFO
>> + &dev_attr_status.attr,
>> +#endif
>> NULL
>> };
>>
>>
>
>--
> i.
More information about the Intel-xe
mailing list