Commit 57e4f155 authored by Tomas Winkler's avatar Tomas Winkler Committed by Joonas Lahtinen

mei: debugfs: add pxp mode to devstate in debugfs

Add pxp mode devstate to debugfs to monitor pxp state machine progress.
This is useful to debug issues in scenarios in which the pxp state
needs to be re-initialized, like during power transitions such as
suspend/resume. With this debugfs the state could be monitored
to ensure that pxp is in the ready state.

CC: Vitaly Lubart <vitaly.lubart@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
Reviewed-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-15-tomas.winkler@intel.comAcked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
parent 267cb870
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
/* /*
* Copyright (c) 2012-2016, Intel Corporation. All rights reserved * Copyright (c) 2012-2022, Intel Corporation. All rights reserved
* Intel Management Engine Interface (Intel MEI) Linux driver * Intel Management Engine Interface (Intel MEI) Linux driver
*/ */
...@@ -86,6 +86,20 @@ static int mei_dbgfs_active_show(struct seq_file *m, void *unused) ...@@ -86,6 +86,20 @@ static int mei_dbgfs_active_show(struct seq_file *m, void *unused)
} }
DEFINE_SHOW_ATTRIBUTE(mei_dbgfs_active); DEFINE_SHOW_ATTRIBUTE(mei_dbgfs_active);
static const char *mei_dev_pxp_mode_str(enum mei_dev_pxp_mode state)
{
#define MEI_PXP_MODE(state) case MEI_DEV_PXP_##state: return #state
switch (state) {
MEI_PXP_MODE(DEFAULT);
MEI_PXP_MODE(INIT);
MEI_PXP_MODE(SETUP);
MEI_PXP_MODE(READY);
default:
return "unknown";
}
#undef MEI_PXP_MODE
}
static int mei_dbgfs_devstate_show(struct seq_file *m, void *unused) static int mei_dbgfs_devstate_show(struct seq_file *m, void *unused)
{ {
struct mei_device *dev = m->private; struct mei_device *dev = m->private;
...@@ -112,6 +126,9 @@ static int mei_dbgfs_devstate_show(struct seq_file *m, void *unused) ...@@ -112,6 +126,9 @@ static int mei_dbgfs_devstate_show(struct seq_file *m, void *unused)
seq_printf(m, "pg: %s, %s\n", seq_printf(m, "pg: %s, %s\n",
mei_pg_is_enabled(dev) ? "ENABLED" : "DISABLED", mei_pg_is_enabled(dev) ? "ENABLED" : "DISABLED",
mei_pg_state_str(mei_pg_state(dev))); mei_pg_state_str(mei_pg_state(dev)));
seq_printf(m, "pxp: %s\n", mei_dev_pxp_mode_str(dev->pxp_mode));
return 0; return 0;
} }
DEFINE_SHOW_ATTRIBUTE(mei_dbgfs_devstate); DEFINE_SHOW_ATTRIBUTE(mei_dbgfs_devstate);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment