From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Cristian Marussi <cristian.marussi@arm.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, arm-scmi@vger.kernel.org,
linux-doc@vger.kernel.org
Cc: sudeep.holla@kernel.org, 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, d-gole@ti.com, jic23@kernel.org,
elif.topuz@arm.com, lukasz.luba@arm.com, philip.radford@arm.com,
souvik.chakravarty@arm.com, leitao@kernel.org, kas@kernel.org,
puranjay@kernel.org, usama.arif@linux.dev, kernel-team@meta.com
Subject: Re: [PATCH v12 06/25] firmware: arm_scmi: Add basic Telemetry support
Date: Tue, 22 Sep 2026 16:42:59 +0200 [thread overview]
Message-ID: <8fd34672-493b-4d70-a2bd-1fe434b5ccda@kernel.org> (raw)
In-Reply-To: <20260920091928.2014972-7-cristian.marussi@arm.com>
On 9/20/26 11:19, Cristian Marussi wrote:
> Add SCMIv4.0 Telemetry basic support to enable initialization and resources
> enumeration: add all the telemetry messages definitions and parsing logic
> but only a few simple state gathering protocol operations.
As someone unfamiliar with the spec, it would be nice to summarize which parts
of the spec this patch implements, so it's easier to cross-reference.
Same for the other patches. :)
It's a lot to review. So having a better description to guide the reviewer
through the patch would really help. I assume we could split this up further, like
a) Add basic definition (mechanical from the spec)
b) Add telemetry stub and hook it up
c) query attributes
d) intialize X
...
Will result in quite some patches .... so I won't suggest that just yet. Maybe
people familiar with the spec have it easier revieweing this.
> +
> +enum scmi_telemetry_protocol_cmd {
> + TELEMETRY_LIST_SHMTI = 0x3,
> + TELEMETRY_DE_DESCRIPTION = 0x4,
> + TELEMETRY_LIST_UPDATE_INTERVALS = 0x5,
> + TELEMETRY_DE_CONFIGURE = 0x6,
> + TELEMETRY_DE_ENABLED_LIST = 0x7,
> + TELEMETRY_CONFIG_SET = 0x8,
> + TELEMETRY_READING_COMPLETE = TELEMETRY_CONFIG_SET,
TELEMETRY_READING_COMPLETE is not really a command but listed as a "delated
response". Should this be something separate (and not mangled into protocol_cmd
?). Or is "_cmd" not the right term for this collection?
I have no SCMI experience, so it might be a rather supid queestion.
[...]
> +struct scmi_de_desc {
> + __le32 id;
I'll make a couple of generic comments, that should apply to most definitions in
here.
In the spec some of these things are prefixed by "de" e.g., "de_id".
Was this deliberate? Having the spec match the implementation allows for easier
grepping of stuff.
> + __le32 grp_id;
Spec calls this "group_id"
> + __le32 data_sz;
Spec calls this "de_data_size" etc.
If there is good reason to use slightly different names, best to spell that out
in the patch description.
> + __le32 attr_1;
E.g., grepping the spec for "attr_1" I get no hits. So I have to remember that
the spec might call this "de_attributes_1"
> +#define IS_NAME_SUPPORTED(d) (le32_get_bits((d)->attr_1, BIT(31)))
DE_ATTRIBUTES_1_NAME_SPECIFIED would be clearer. in general, spelling out to
which field a define belongs *might* make it harder to get stuff wrong.
(spec calls it "Named specified" which sounds like a bug)
Same for the other definitions. Again, maybe diverging from the spec is fine.
Personally, I would try to stay as close as possible to the naming in the spec.
[...]
> +
> +static void scmi_telemetry_free_tde_put(struct telemetry_info *ti,
> + struct telemetry_de *tde)
> +{
> + struct scmi_telemetry_de_info *info;
> +
> + guard(mutex)(&ti->free_mtx);
> + /* Save clear and restore */
> + info = READ_ONCE(tde->de.info);
Where is the matching WRITE_ONCE? IOW, who is expected to modify this concurrently?
> + memset(info, 0, sizeof(*info));
> + memset(tde, 0, offsetof(struct telemetry_de, mtx));
> + tde->de.info = info;
> + list_add_tail(&tde->item, &ti->free_des);
> +}
> +
[...]
> +
> +static int scmi_telemetry_protocol_init(const struct scmi_protocol_handle *ph)
> +{
> + struct device *dev = ph->dev;
> + struct telemetry_info *ti;
> + int ret;
> +
> + dev_dbg(dev, "Telemetry Version %d.%d\n",
> + PROTOCOL_REV_MAJOR(ph->version), PROTOCOL_REV_MINOR(ph->version));
> +
> + ti = devm_kzalloc(dev, sizeof(*ti), GFP_KERNEL);
> + if (!ti)
> + return -ENOMEM;
> +
> + ti->ph = ph;
> +
> + ret = scmi_telemetry_protocol_attributes_get(ti);
> + if (ret) {
> + dev_err(dev, FW_BUG "Cannot retrieve protocol attributes. Abort.\n");
> + return ret;
> + }
> +
> + ret = scmi_telemetry_instance_init(ti);
> + if (ret) {
> + dev_err(dev, "Cannot initialize instance. Abort.\n");
> + return ret;
> + }
> +
> + ret = scmi_telemetry_enumerate_common_intervals(ti);
> + if (ret) {
> + dev_err(dev, FW_BUG "Cannot enumerate update intervals. Abort.\n");
> + return ret;
> + }
> +
> + ret = scmi_telemetry_enumerate_shmti(ti);
> + if (ret) {
> + dev_err(dev, FW_BUG "Cannot enumerate SHMTIs. Abort.\n");
> + return ret;
> + }
> +
> + ti->info.base.version = ph->version;
I'm surprised that there is nothing to cleanup on the error paths, but at least
the devm_ stuff is being taken care of I guess.
It's a lot of code, so I only managed to skim briefly over most of it.
--
Cheers,
David
next prev parent reply other threads:[~2026-09-22 14:43 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 9:19 [PATCH v12 00/25] Introduce SCMI " Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 01/25] firmware: arm_scmi: Add new SCMIv4.0 error codes definitions Cristian Marussi
2026-09-22 12:20 ` David Hildenbrand (Arm)
2026-09-22 17:32 ` Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 02/25] firmware: arm_scmi: Allow registration of unknown-size events/reports Cristian Marussi
2026-09-22 13:15 ` David Hildenbrand (Arm)
2026-09-23 10:55 ` Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 03/25] firmware: arm_scmi: Introduce protocol instance notifiers Cristian Marussi
2026-09-22 13:44 ` David Hildenbrand (Arm)
2026-09-23 15:03 ` Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 04/25] dt-bindings: firmware: arm,scmi: Add support for telemetry protocol Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 05/25] include: trace: Add Telemetry trace events Cristian Marussi
2026-09-22 13:48 ` David Hildenbrand (Arm)
2026-09-23 12:02 ` Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 06/25] firmware: arm_scmi: Add basic Telemetry support Cristian Marussi
2026-09-22 14:42 ` David Hildenbrand (Arm) [this message]
2026-09-23 14:43 ` Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 07/25] firmware: arm_scmi: Add support to parse SHMTIs areas Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 08/25] firmware: arm_scmi: Add Telemetry configuration operations Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 09/25] firmware: arm_scmi: Add Telemetry DataEvent read capabilities Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 10/25] firmware: arm_scmi: Add support for Telemetry reset Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 11/25] firmware: arm_scmi: Add Telemetry notification support Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 12/25] firmware: arm_scmi: Add support for boot-on Telemetry Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 13/25] firmware: arm-scmi: Add telemetry generic event support Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 14/25] firmware: arm_scmi: Add Telemetry generation counter event Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 15/25] firmware: arm_scmi: Add common per-protocol debugfs support Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 16/25] firmware: arm_scmi: Add Telemetry debugfs SHMTI dump support Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 17/25] firmware: arm_scmi: Add Telemetry debugfs ABI documentation Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 18/25] firmware: arm_scmi: Expose per-instance identifier Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 19/25] firmware: arm_scmi: Add un-managed methods to get/put protocols operations Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 20/25] uapi: Add ARM SCMI Telemetry definitions Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 21/25] firmware: arm_scmi: Add System Telemetry driver Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 22/25] docs: ioctl-number: Add SCMI Ioctls Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 23/25] [RFC] Documentation: Add SCMI System Telemetry documentation Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 24/25] [RFC] tools/scmi: Add SCMI Telemetry testing tool Cristian Marussi
2026-09-20 9:19 ` [PATCH v12 25/25] [RFC] kselftest/arm64: Add SCMI Telemetry UAPI compliance testcases 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=8fd34672-493b-4d70-a2bd-1fe434b5ccda@kernel.org \
--to=david@kernel.org \
--cc=arm-scmi@vger.kernel.org \
--cc=cristian.marussi@arm.com \
--cc=d-gole@ti.com \
--cc=elif.topuz@arm.com \
--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=lukasz.luba@arm.com \
--cc=michal.simek@amd.com \
--cc=peng.fan@oss.nxp.com \
--cc=philip.radford@arm.com \
--cc=puranjay@kernel.org \
--cc=souvik.chakravarty@arm.com \
--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
all inboxes | Powered by JetHome®