[Intel-gfx] [PATCH v7 13/15] mei: debugfs: add pxp mode to devstate in debugfs

Ceraolo Spurio, Daniele daniele.ceraolospurio at intel.com
Thu Sep 1 21:20:49 UTC 2022



On 8/6/2022 5:26 AM, Tomas Winkler wrote:
> 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 at intel.com>
> Signed-off-by: Tomas Winkler <tomas.winkler at intel.com>
> Signed-off-by: Alexander Usyskin <alexander.usyskin at intel.com>

Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>

Daniele

> ---
>   drivers/misc/mei/debugfs.c | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
>
> diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c
> index 1ce61e9e24fc..4074fec866a6 100644
> --- a/drivers/misc/mei/debugfs.c
> +++ b/drivers/misc/mei/debugfs.c
> @@ -86,6 +86,20 @@ static int mei_dbgfs_active_show(struct seq_file *m, void *unused)
>   }
>   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)
>   {
>   	struct mei_device *dev = m->private;
> @@ -112,6 +126,9 @@ static int mei_dbgfs_devstate_show(struct seq_file *m, void *unused)
>   	seq_printf(m, "pg:  %s, %s\n",
>   		   mei_pg_is_enabled(dev) ? "ENABLED" : "DISABLED",
>   		   mei_pg_state_str(mei_pg_state(dev)));
> +
> +	seq_printf(m, "pxp: %s\n", mei_dev_pxp_mode_str(dev->pxp_mode));
> +
>   	return 0;
>   }
>   DEFINE_SHOW_ATTRIBUTE(mei_dbgfs_devstate);



More information about the Intel-gfx mailing list