[PATCH v15 25/35] firmware: arm_scmi: Add Telemetry debugfs SHMTI dump support

Jonathan Cameron jonathan.cameron at oss.qualcomm.com
Tue Nov 10 14:54:21 PST 2026


On Mon,  9 Nov 2026 09:12:11 +0000
Cristian Marussi <cristian.marussi at arm.com> wrote:

> Expose one debugfs entry for each discovered SHMTI that can be used to
> dump the related SHMTI in binary form from TBGN up to TEND markers.
> 
> No processing is done kernel side, beside using proper accessors for
> device memory.
> 
> Signed-off-by: Cristian Marussi <cristian.marussi at arm.com>

Seems fine, one trivial inline. I find it hard to care about this
particular option though.

> ---
>  drivers/firmware/arm_scmi/telemetry.c | 103 ++++++++++++++++++++++++++
>  1 file changed, 103 insertions(+)
> 
> diff --git a/drivers/firmware/arm_scmi/telemetry.c b/drivers/firmware/arm_scmi/telemetry.c
> index c21700bd1b43..7582fe295a23 100644
> --- a/drivers/firmware/arm_scmi/telemetry.c
> +++ b/drivers/firmware/arm_scmi/telemetry.c

> @@ -1683,6 +1694,91 @@ scmi_telemetry_enumerate_common_intervals(struct telemetry_info *ti)
>  					ti->info.intervals);
>  }
>  
> +static int scmi_telemetry_dbg_shmti_open(struct inode *inode, struct file *filp)
> +{
> +	struct scmi_telemetry_dbg_shmti *sblob;
> +	struct telemetry_shmti *shmti;
> +
> +	if (!inode->i_private)
> +		return -ENODEV;
> +
> +	shmti = inode->i_private;
> +	sblob = kzalloc_obj(*sblob);

Use some __free magic then appropriate no_free_ptr() after
it can't fail any more.

Trivial but might as well.

> +	if (!sblob)
> +		return -ENOMEM;
> +
> +	sblob->shmti = shmti;
> +	sblob->buf = kvzalloc(shmti->info.len, GFP_KERNEL);
> +	if (!sblob->buf) {
> +		kfree(sblob);
> +		return -ENOMEM;
> +	}
> +
> +	mutex_init(&sblob->mtx);
> +
> +	filp->private_data = sblob;
> +
> +	return 0;
> +}
> 




More information about the linux-arm-kernel mailing list