* Re: [PATCH 4/4] firmware: arm_scmi: Add new inflight tracing functionality [not found] <PAWPR08MB99669F0D3EB80C4ACAA90DFA897DA@PAWPR08MB9966.eurprd08.prod.outlook.com> @ 2025-06-19 15:42 ` Cristian Marussi 0 siblings, 0 replies; 4+ messages in thread From: Cristian Marussi @ 2025-06-19 15:42 UTC (permalink / raw) To: Philip Radford Cc: Dan Carpenter, cristian.marussi, linux-kernel, linux-arm-kernel, arm-scmi On Thu, Jun 19, 2025 at 04:13:57PM +0100, Philip Radford wrote: > > -----Original Message----- > > From: Dan Carpenter <dan.carpenter@linaro.org> > > Sent: Thursday, June 19, 2025 3:38 PM > > To: Philip Radford <Philip.Radford@arm.com> > > Hi, > > > Cc: linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; arm- > > scmi@vger.kernel.org; Sudeep Holla <Sudeep.Holla@arm.com>; Cristian > > Marussi <Cristian.Marussi@arm.com>; Luke Parkin <Luke.Parkin@arm.com> > > Subject: Re: [PATCH 4/4] firmware: arm_scmi: Add new inflight tracing > > functionality Hi Phil, please reply to all the recipient of the original mail-thread when answering a review, so we remain on the list. (mutt -> g .. I think :P) (I added the CCs to this) Thanks, Cristian ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 0/4] firmware: arm_scmi: Add xfer inflight debug and trace @ 2025-06-19 12:20 Philip Radford 2025-06-19 12:20 ` [PATCH 4/4] firmware: arm_scmi: Add new inflight tracing functionality Philip Radford 0 siblings, 1 reply; 4+ messages in thread From: Philip Radford @ 2025-06-19 12:20 UTC (permalink / raw) To: linux-kernel, linux-arm-kernel, arm-scmi Cc: sudeep.holla, cristian.marussi, luke.parkin, philip.radford Hi all, This series adds a new counter to the Arm SCMI firmware driver to track the number of in-flight message transfers during debug and trace. This will be useful for examining behaviour under a large load with regards to concurrent messages being sent and received. As the counter only gives a live value, printing the value in trace allows logging of the in-flight xfers. The series is divided into four small patches: Patch [1/4] - Adds a fuction to decrement debug counters, similar to the existing counter to increment debug counters Patch [2/4] - Adds a new xfers_inflight debug counter to track active transfers Patch [3/4] - Enhances two tracepoints (scmi_xfer_begin and scmi_xfer_end) to include the number of in-flight transfers, setting default values of 0 Patch [4/4] - Adds a function (scmi_inflight_count) that retrieves the current in-flight count for use in tracing Based on v6.16-rc2 Regards, Phil Philip Radford (4): firmware: arm_scmi: Add debug decrement counter firmware: arm_scmi: Add xfer_inflight counter include: trace: Add inflight_xfer counter tracepoint firmware: arm_scmi: Add new inflight tracing functionality drivers/firmware/arm_scmi/common.h | 8 ++++++++ drivers/firmware/arm_scmi/driver.c | 28 ++++++++++++++++++++++++++-- drivers/firmware/arm_scmi/raw_mode.c | 6 ++++-- include/trace/events/scmi.h | 24 ++++++++++++++---------- 4 files changed, 52 insertions(+), 14 deletions(-) -- 2.25.1 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 4/4] firmware: arm_scmi: Add new inflight tracing functionality 2025-06-19 12:20 [PATCH 0/4] firmware: arm_scmi: Add xfer inflight debug and trace Philip Radford @ 2025-06-19 12:20 ` Philip Radford 2025-06-19 14:37 ` Dan Carpenter 2025-06-26 11:17 ` Cristian Marussi 0 siblings, 2 replies; 4+ messages in thread From: Philip Radford @ 2025-06-19 12:20 UTC (permalink / raw) To: linux-kernel, linux-arm-kernel, arm-scmi Cc: sudeep.holla, cristian.marussi, luke.parkin, philip.radford Adds scmi_inflight_count function to fetch the current xfer inflight count to use in trace Signed-off-by: Philip Radford <philip.radford@arm.com> --- drivers/firmware/arm_scmi/common.h | 1 + drivers/firmware/arm_scmi/driver.c | 17 +++++++++++++++-- drivers/firmware/arm_scmi/raw_mode.c | 5 +++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h index ad9232c982ce..07b9e629276d 100644 --- a/drivers/firmware/arm_scmi/common.h +++ b/drivers/firmware/arm_scmi/common.h @@ -505,4 +505,5 @@ static struct platform_driver __drv = { \ void scmi_notification_instance_data_set(const struct scmi_handle *handle, void *priv); void *scmi_notification_instance_data_get(const struct scmi_handle *handle); +int scmi_inflight_count(const struct scmi_handle *handle); #endif /* _SCMI_COMMON_H */ diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index c6657582c9ab..d128d497f96e 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -1443,7 +1443,8 @@ static int do_xfer(const struct scmi_protocol_handle *ph, trace_scmi_xfer_begin(xfer->transfer_id, xfer->hdr.id, xfer->hdr.protocol_id, xfer->hdr.seq, - xfer->hdr.poll_completion, 0); + xfer->hdr.poll_completion, + scmi_inflight_count(&info->handle)); /* Clear any stale status */ xfer->hdr.status = SCMI_SUCCESS; @@ -1479,7 +1480,8 @@ static int do_xfer(const struct scmi_protocol_handle *ph, info->desc->ops->mark_txdone(cinfo, ret, xfer); trace_scmi_xfer_end(xfer->transfer_id, xfer->hdr.id, - xfer->hdr.protocol_id, xfer->hdr.seq, ret, 0); + xfer->hdr.protocol_id, xfer->hdr.seq, ret, + scmi_inflight_count(&info->handle)); return ret; } @@ -3416,6 +3418,17 @@ static struct dentry *scmi_debugfs_init(void) return d; } +int scmi_inflight_count(const struct scmi_handle *handle) +{ + if (IS_ENABLED(CONFIG_ARM_SCMI_DEBUG_COUNTERS)) { + struct scmi_info *info = handle_to_scmi_info(handle); + + return atomic_read(&info->dbg->counters[XFERS_INFLIGHT]); + } else { + return 0; + } +} + static int __init scmi_driver_init(void) { scmi_quirks_initialize(); diff --git a/drivers/firmware/arm_scmi/raw_mode.c b/drivers/firmware/arm_scmi/raw_mode.c index 2ccb6b3f0e64..eebe1a5297ef 100644 --- a/drivers/firmware/arm_scmi/raw_mode.c +++ b/drivers/firmware/arm_scmi/raw_mode.c @@ -476,7 +476,7 @@ static void scmi_xfer_raw_worker(struct work_struct *work) trace_scmi_xfer_end(xfer->transfer_id, xfer->hdr.id, xfer->hdr.protocol_id, xfer->hdr.seq, - ret, 0); + ret, scmi_inflight_count(raw->handle)); /* Wait also for an async delayed response if needed */ if (!ret && xfer->async_done) { @@ -643,7 +643,8 @@ static int scmi_do_xfer_raw_start(struct scmi_raw_mode_info *raw, trace_scmi_xfer_begin(xfer->transfer_id, xfer->hdr.id, xfer->hdr.protocol_id, xfer->hdr.seq, - xfer->hdr.poll_completion, 0); + xfer->hdr.poll_completion, + scmi_inflight_count(raw->handle)); ret = raw->desc->ops->send_message(rw->cinfo, xfer); if (ret) { -- 2.25.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 4/4] firmware: arm_scmi: Add new inflight tracing functionality 2025-06-19 12:20 ` [PATCH 4/4] firmware: arm_scmi: Add new inflight tracing functionality Philip Radford @ 2025-06-19 14:37 ` Dan Carpenter 2025-06-26 11:17 ` Cristian Marussi 1 sibling, 0 replies; 4+ messages in thread From: Dan Carpenter @ 2025-06-19 14:37 UTC (permalink / raw) To: Philip Radford Cc: linux-kernel, linux-arm-kernel, arm-scmi, sudeep.holla, cristian.marussi, luke.parkin On Thu, Jun 19, 2025 at 12:20:04PM +0000, Philip Radford wrote: > Adds scmi_inflight_count function to fetch the current xfer > inflight count to use in trace > > Signed-off-by: Philip Radford <philip.radford@arm.com> > --- > drivers/firmware/arm_scmi/common.h | 1 + > drivers/firmware/arm_scmi/driver.c | 17 +++++++++++++++-- > drivers/firmware/arm_scmi/raw_mode.c | 5 +++-- > 3 files changed, 19 insertions(+), 4 deletions(-) > > diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h > index ad9232c982ce..07b9e629276d 100644 > --- a/drivers/firmware/arm_scmi/common.h > +++ b/drivers/firmware/arm_scmi/common.h > @@ -505,4 +505,5 @@ static struct platform_driver __drv = { \ > void scmi_notification_instance_data_set(const struct scmi_handle *handle, > void *priv); > void *scmi_notification_instance_data_get(const struct scmi_handle *handle); > +int scmi_inflight_count(const struct scmi_handle *handle); > #endif /* _SCMI_COMMON_H */ > diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c > index c6657582c9ab..d128d497f96e 100644 > --- a/drivers/firmware/arm_scmi/driver.c > +++ b/drivers/firmware/arm_scmi/driver.c > @@ -1443,7 +1443,8 @@ static int do_xfer(const struct scmi_protocol_handle *ph, > > trace_scmi_xfer_begin(xfer->transfer_id, xfer->hdr.id, > xfer->hdr.protocol_id, xfer->hdr.seq, > - xfer->hdr.poll_completion, 0); > + xfer->hdr.poll_completion, > + scmi_inflight_count(&info->handle)); White space is messed up. It might be better to fold this into patch 3? regards, dan carpenter ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 4/4] firmware: arm_scmi: Add new inflight tracing functionality 2025-06-19 12:20 ` [PATCH 4/4] firmware: arm_scmi: Add new inflight tracing functionality Philip Radford 2025-06-19 14:37 ` Dan Carpenter @ 2025-06-26 11:17 ` Cristian Marussi 1 sibling, 0 replies; 4+ messages in thread From: Cristian Marussi @ 2025-06-26 11:17 UTC (permalink / raw) To: Philip Radford Cc: linux-kernel, linux-arm-kernel, arm-scmi, sudeep.holla, cristian.marussi, luke.parkin On Thu, Jun 19, 2025 at 12:20:04PM +0000, Philip Radford wrote: > Adds scmi_inflight_count function to fetch the current xfer > inflight count to use in trace > Hi, I agree with Dan's comments on patches 3 and 4...once those comments are addressed, for me: Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Thanks, Cristian ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-06-26 11:17 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <PAWPR08MB99669F0D3EB80C4ACAA90DFA897DA@PAWPR08MB9966.eurprd08.prod.outlook.com> 2025-06-19 15:42 ` [PATCH 4/4] firmware: arm_scmi: Add new inflight tracing functionality Cristian Marussi 2025-06-19 12:20 [PATCH 0/4] firmware: arm_scmi: Add xfer inflight debug and trace Philip Radford 2025-06-19 12:20 ` [PATCH 4/4] firmware: arm_scmi: Add new inflight tracing functionality Philip Radford 2025-06-19 14:37 ` Dan Carpenter 2025-06-26 11:17 ` Cristian Marussi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).