[PATCH 09/10] sysfs debug
Ilpo Järvinen
ilpo.jarvinen at linux.intel.com
Sat May 31 05:53:54 UTC 2025
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. :-)
> +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