Linux Documentation
 help / color / mirror / Atom feed
From: Fayssal Benmlih <Fayssal.Benmlih@arm.com>
To: Cristian Marussi <Cristian.Marussi@arm.com>
Cc: "arm-scmi@vger.kernel.org" <arm-scmi@vger.kernel.org>,
	"corbet@lwn.net" <corbet@lwn.net>,
	"d-gole@ti.com" <d-gole@ti.com>,
	"david@kernel.org" <david@kernel.org>,
	Elif Topuz <Elif.Topuz@arm.com>,
	"etienne.carriere@st.com" <etienne.carriere@st.com>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	"james.quinlan@broadcom.com" <james.quinlan@broadcom.com>,
	"jic23@kernel.org" <jic23@kernel.org>,
	"kas@kernel.org" <kas@kernel.org>,
	"kernel-team@meta.com" <kernel-team@meta.com>,
	"leitao@kernel.org" <leitao@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Lukasz Luba <Lukasz.Luba@arm.com>,
	"michal.simek@amd.com" <michal.simek@amd.com>,
	"peng.fan@oss.nxp.com" <peng.fan@oss.nxp.com>,
	Philip Radford <Philip.Radford@arm.com>,
	"puranjay@kernel.org" <puranjay@kernel.org>,
	"skhan@linuxfoundation.org" <skhan@linuxfoundation.org>,
	Souvik Chakravarty <Souvik.Chakravarty@arm.com>,
	"sudeep.holla@kernel.org" <sudeep.holla@kernel.org>,
	"usama.arif@linux.dev" <usama.arif@linux.dev>,
	"vincent.guittot@linaro.org" <vincent.guittot@linaro.org>
Subject: Re: [PATCH v7 22/23] [RFC] Documentation: Add SCMI System Telemetry documentation
Date: Mon, 3 Aug 2026 22:36:25 +0000	[thread overview]
Message-ID: <66DE0696-9526-494F-90D0-FCB54565DA4D@contoso.com> (raw)
In-Reply-To: <<20260802145618.1952804-23-cristian.marussi@arm.com>>

Hi Cristian,

A few documentation issues remain inline.

>  - SCMI_TLM_GET_ABI_INFO: Gather ABI versioning detail and basic SCMI
>    Telemetry features like number of resources and supported features.

Please explain the distinction between abi_features and the SCMI instance
features. In particular, reset is usable only when both the ABI and the
firmware instance advertise support.

>  - SCMI_TLM_GET_CFG / SCMI_TLM_SET_CFG: Get or set the whole instance,
>    or a specific group, configuration.
>
>  - SCMI_TLM_GET_DE_CFG / SCMI_TLM_SET_DE_CFG: Get or set the
>    configuration of a specific DataEvent.
>
>  - SCMI_TLM_GET_ALL_CFG / SCMI_TLM_SET_ALL_CFG: Get or set the
>    cumulative configuration of ALL the DataEvents defined on the
>    platform.

Please state that this configuration is global to the SCMI instance, not
per-open-file state.

The documentation should also define concurrent-caller behavior, whether
multi-command operations can interleave, partial failure of SET_ALL_CFG
and batch operations, and which commands require write access or
privilege.

>  - SCMI_TLM_EVENT_REGISTER: Subscribe/unsubscribe to a Telemetry event.

This ioctl name does not exist in the V7 UAPI. The defined command is
SCMI_TLM_EVENT_SUBSCRIBE.

Please also document subscription ownership and lifetime, including what
happens when the telemetry fd or eventfd is closed without an explicit
unsubscribe.

>  - SCMI_TLM_BATCH_READ: Report the last samples for the DataEvents IDs
>    specified within the samples input params.

Please document the per-entry status representation, whether the status
array is optional, what happens to successful entries when a later item
fails without statuses, and the maximum permitted batch count.

>  - SCMI_TLM_GET_SHMTI_LIST: Gather a list of open file descriptors, one
>    for each SHMTI memory area defined for this instance, that can be used
>    to memory-map such areas in the calling process address space [...]

The mmap ABI still needs to specify:

- the exact PAGE_ALIGN(offset + len) mapping length;
- permitted vm_pgoff, protection and sharing flags;
- that returned fds are read-only and close-on-exec;
- cacheability and coherency expectations;
- fd and VMA lifetime across removal, reset and reconfiguration;
- cleanup using munmap() and close();
- security requirements for bytes surrounding an unaligned SHMTI.

> 		/* Enable Telemetry as a whole, set a 400ms update interval */
> 		cfg.enable = 1;
> 		cfg.active.secs = 400;
> 		cfg.active.exp = -3;

Please document the permitted secs/exp ranges and how a requested value is
matched against discrete or segmented advertised intervals.

> 		struct scmi_tlm_de_sample samples[3] = {};
> 		struct scmi_tlm_data_read data = {};
> [...]
> 		data.num_samples = 3;
> 		data.samples = (unsigned long)samples;
>
> 		ret = ioctl(fd, SCMI_TLM_BATCH_READ, &data);

V7's batch handler expects struct scmi_tlm_batch, including item_sz,
items, and optional states. This example still passes struct
scmi_tlm_data_read, so it fails item_sz validation and is smaller than the
structure copied by the handler.

Please update the example to use the V7 batch ABI.

> 		for (int i = 0; i < 3; i++)
> 			fprintf(stdout, "%llu: 0x%08X -> %llu\n",
> 					samples[i].tstamp, samples[i].id,
> 					samples[i].val);

Please document the timestamp domain, clock-rate conversion, wrap
behavior, and whether it can be correlated with a Linux clock.

> 		if (ret)
> 			return ret;
> [...]
> 		return 0;

The example still leaks fd on all successful and most error exits. Please
use one cleanup path and close fd before returning. Examples involving
SHMTIs or batches should similarly demonstrate freeing arrays, closing
returned anonymous fds and unmapping mappings.

Thanks,
Fayçal



       reply	other threads:[~2026-08-03 22:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<20260802145618.1952804-23-cristian.marussi@arm.com>
2026-08-03 22:36 ` Fayssal Benmlih [this message]
2026-08-02 14:55 [PATCH v7 00/23] Introduce SCMI Telemetry support Cristian Marussi
2026-08-02 14:56 ` [PATCH v7 22/23] [RFC] Documentation: Add SCMI System Telemetry documentation Cristian Marussi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66DE0696-9526-494F-90D0-FCB54565DA4D@contoso.com \
    --to=fayssal.benmlih@arm.com \
    --cc=Cristian.Marussi@arm.com \
    --cc=Elif.Topuz@arm.com \
    --cc=Lukasz.Luba@arm.com \
    --cc=Philip.Radford@arm.com \
    --cc=Souvik.Chakravarty@arm.com \
    --cc=arm-scmi@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=d-gole@ti.com \
    --cc=david@kernel.org \
    --cc=etienne.carriere@st.com \
    --cc=f.fainelli@gmail.com \
    --cc=james.quinlan@broadcom.com \
    --cc=jic23@kernel.org \
    --cc=kas@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=leitao@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=puranjay@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=sudeep.holla@kernel.org \
    --cc=usama.arif@linux.dev \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox