From: Cristian Marussi <cristian.marussi@arm.com>
To: Elif Topuz <elif.topuz@arm.com>
Cc: Cristian Marussi <cristian.marussi@arm.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, arm-scmi@vger.kernel.org,
linux-fsdevel@vger.kernel.org, sudeep.holla@arm.com,
james.quinlan@broadcom.com, f.fainelli@gmail.com,
vincent.guittot@linaro.org, etienne.carriere@st.com,
peng.fan@oss.nxp.com, michal.simek@amd.com,
dan.carpenter@linaro.org, d-gole@ti.com,
jonathan.cameron@huawei.com, lukasz.luba@arm.com,
philip.radford@arm.com, souvik.chakravarty@arm.com
Subject: Re: [PATCH v2 05/17] firmware: arm_scmi: Add Telemetry protocol support
Date: Thu, 26 Mar 2026 13:32:26 +0000 [thread overview]
Message-ID: <acU1arT1tMZVbe2m@pluto> (raw)
In-Reply-To: <02534a48-6795-4948-9348-fe507e8810fd@arm.com>
On Fri, Jan 23, 2026 at 11:00:46AM +0000, Elif Topuz wrote:
>
> Hi Cristian,
HI Elif,
a long overdue reply from me !
Thanks for having a look at this series...
>
> On 14/01/2026 11:46, Cristian Marussi wrote:
> > Add basic support for SCMI V4.0 Telemetry protocol including SHMTI,
> > FastChannels, Notifications and Single Sample Reads collection methods.
> >
> > Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
> > ---
> > v1 --> v2
> > - Add proper ioread accessors for TDCF areas
> > - Rework resource allocation logic and lifecycle
> > - Introduce new resources accessors and res_get() operation to
> > implement lazy enumeration
> > - Support boot-on telemetry:
> > + Add DE_ENABLED_LIST cmd support
> > + Add CONFIG_GET cmd support
> > + Add TDCF_SCAN for best effort enumeration
> > + Harden driver against out-of-spec FW with out of spec cmds
> > - Use FCs list
> > - Rework de_info_lookup to a moer general de_lookup
> > - Fixed reset to use CONFIG_GET and DE_ENABLED_LIST to gather initial
> > state
> > - Using sign_extend32 helper
> > - Added counted_by marker where appropriate
> > ---
> > drivers/firmware/arm_scmi/Makefile | 2 +-
> > drivers/firmware/arm_scmi/driver.c | 2 +
> > drivers/firmware/arm_scmi/protocols.h | 1 +
> > drivers/firmware/arm_scmi/telemetry.c | 2671 +++++++++++++++++++++++++
> > include/linux/scmi_protocol.h | 188 +-
> > 5 files changed, 2862 insertions(+), 2 deletions(-)
> > create mode 100644 drivers/firmware/arm_scmi/telemetry.c
> >
[snip]
> > + /* Build composing DES string */
> > + for (int i = 0; i < ti->info.base.num_groups; i++) {
> > + struct scmi_telemetry_group *grp = &rinfo->grps[i];
> > + size_t bufsize = grp->info->num_des * 11 + 1;
> > + char *buf = grp->des_str;
> > +
> > + for (int j = 0; j < grp->info->num_des; j++) {
> > + char term = j != (grp->info->num_des - 1) ? ' ' : '\0';
> > + int len;
> > +
> > + len = scnprintf(buf, bufsize, "0x%04X%c",
>
> I think it should be 0x%08X%c to print 8 bytes.
>
Good catch ! I will fix..
> > + rinfo->des[grp->des[j]]->info->id, term);
> > +
> > + buf += len;
> > + bufsize -= len;
> > + }
> > + }
> > +
[snip]
> > +
> > +static int scmi_telemetry_tdcf_line_parse(struct telemetry_info *ti,
> > + struct payload __iomem *payld,
> > + struct telemetry_shmti *shmti,
> > + enum scan_mode mode)
> > +{
> > + int used_qwords;
> > +
> > + used_qwords = (USE_LINE_TS(payld) && TS_VALID(payld)) ?
> > + QWORDS_TS_LINE_DATA_PAYLD : QWORDS_LINE_DATA_PAYLD;
>
> If I understand correctly from the "chat with ATG" comments below, when
> timestamp is disabled (after DE is enabled with timestamp), physically ts line
> is still there (use_line_ts = 1 and ts_valid = 0). That's why I think we need to
> drop TS_VALID(payld) check. Otherwise qwords will be QWORDS_LINE_DATA_PAYLD
> although ts line exists.
>
> Also, for the alpha version of the spec, the combination of use_line_ts = 1 and
> ts_valid = 0 doesn't seem to be possible as I understand. But I think beta
> version allows us?
Yes indeed ALPHA_0 definition of TS Line fields was ambiguos but now in
BETA the field is more explicitly called as LineExtension bit field...so
the code in the upcoming V3 will change accordingly.
>
> > +
> > + /* Invalid lines are not an error, could simply be disabled DEs */
> > + if (DATA_INVALID(payld))
> > + return used_qwords;
> > +
> > + if (!IS_BLK_TS(payld))
> > + scmi_telemetry_tdcf_data_parse(ti, payld, shmti, mode);
> > + else
> > + scmi_telemetry_tdcf_blkts_parse(ti, payld, shmti);
> > +
> > + return used_qwords;
> > +}
> > +
> > +static int scmi_telemetry_shmti_scan(struct telemetry_info *ti,
> > + unsigned int shmti_id, u64 ts,
> > + enum scan_mode mode)
>
> ts is not used in the function.
>
Yes indeed I have removed it in V3.
> > +{
> > + struct telemetry_shmti *shmti = &ti->shmti[shmti_id];
> > + struct tdcf __iomem *tdcf = shmti->base;
> > + int retries = SCMI_TLM_TDCF_MAX_RETRIES;
> > + u64 startm = 0, endm = TDCF_BAD_END_SEQ;
> > + void *eplg = SHMTI_EPLG(shmti);
> > +
> > + if (!tdcf)
> > + return -ENODEV;
> > +
[snip]
> > +
> > + de_id = le32_to_cpu(payld->id);
> > + de = xa_load(&ti->xa_des, de_id);
> > + if (!de || !de->enabled) {
> > + dev_err(ti->ph->dev,
> > + "MSG - Received INVALID DE - ID:%u enabled:%d\n",
>
> enabled:%c?
>
Yep
> > + de_id, de ? (de->enabled ? 'Y' : 'N') : 'X');
> > + continue;
[snip]
> > struct scmi_power_state_changed_report {
> > @@ -1114,4 +1292,12 @@ struct scmi_powercap_meas_changed_report {
> > unsigned int domain_id;
> > unsigned int power;
> > };
> > +
> > +struct scmi_telemetry_update_report {
> > + ktime_t timestamp;
> > + unsigned int agent_id;
> > + int status;
> > + unsigned int num_dwords;
> > + unsigned int dwords[];
> > +};
> > #endif /* _LINUX_SCMI_PROTOCOL_H */
>
> Thanks,
> Elif
Thanks for the review !
Cristian
PS: (nitpick) you should trim your review replies to remove all the long
bunch of code that you are not comenting on (leaving a [snip] placeholder
as I did above)... it helps finding your comments in the sea of code...
next prev parent reply other threads:[~2026-03-26 13:32 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-14 11:46 [PATCH v2 00/17] Introduce SCMI Telemetry FS support Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 01/17] firmware: arm_scmi: Define a common SCMI_MAX_PROTOCOLS value Cristian Marussi
2026-01-19 11:18 ` Jonathan Cameron
2026-01-19 15:43 ` Cristian Marussi
2026-01-20 6:44 ` Dhruva Gole
2026-01-20 10:55 ` Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 02/17] firmware: arm_scmi: Reduce the scope of protocols mutex Cristian Marussi
2026-01-19 11:21 ` Jonathan Cameron
2026-01-19 15:45 ` Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 03/17] firmware: arm_scmi: Allow protocols to register for notifications Cristian Marussi
2026-01-19 11:33 ` Jonathan Cameron
2026-01-19 15:49 ` Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 04/17] uapi: Add ARM SCMI definitions Cristian Marussi
2026-01-19 11:43 ` Jonathan Cameron
2026-01-19 15:51 ` Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 05/17] firmware: arm_scmi: Add Telemetry protocol support Cristian Marussi
2026-01-19 16:29 ` Jonathan Cameron
2026-01-19 18:25 ` Cristian Marussi
2026-01-23 11:00 ` Elif Topuz
2026-03-26 13:32 ` Cristian Marussi [this message]
2026-01-14 11:46 ` [PATCH v2 06/17] include: trace: Add Telemetry trace events Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 07/17] firmware: arm_scmi: Use new Telemetry traces Cristian Marussi
2026-01-23 11:43 ` Elif Topuz
2026-03-26 15:35 ` Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 08/17] firmware: arm_scmi: Add System Telemetry driver Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 09/17] fs/stlmfs: Document ARM SCMI Telemetry filesystem Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 10/17] firmware: arm_scmi: Add System Telemetry ioctls support Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 11/17] fs/stlmfs: Document alternative ioctl based binary interface Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 12/17] firmware: arm_scmi: Add Telemetry components view Cristian Marussi
2026-01-16 13:35 ` Elif Topuz
2026-01-19 15:42 ` Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 13/17] fs/stlmfs: Document alternative topological view Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 14/17] [RFC] docs: stlmfs: Document ARM SCMI Telemetry FS ABI Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 15/17] [RFC] firmware: arm_scmi: Add lazy population support to Telemetry FS Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 16/17] fs/stlmfs: Document lazy mode and related mount option Cristian Marussi
2026-01-14 11:46 ` [PATCH v2 17/17] [RFC] tools/scmi: Add SCMI Telemetry testing tool 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=acU1arT1tMZVbe2m@pluto \
--to=cristian.marussi@arm.com \
--cc=arm-scmi@vger.kernel.org \
--cc=d-gole@ti.com \
--cc=dan.carpenter@linaro.org \
--cc=elif.topuz@arm.com \
--cc=etienne.carriere@st.com \
--cc=f.fainelli@gmail.com \
--cc=james.quinlan@broadcom.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=michal.simek@amd.com \
--cc=peng.fan@oss.nxp.com \
--cc=philip.radford@arm.com \
--cc=souvik.chakravarty@arm.com \
--cc=sudeep.holla@arm.com \
--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