All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cristian Marussi <cristian.marussi@arm.com>
To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com,
	Jonathan.Cameron@huawei.com, f.fainelli@gmail.com,
	etienne.carriere@linaro.org, vincent.guittot@linaro.org,
	souvik.chakravarty@arm.com, wleavitt@marvell.com,
	peter.hilber@opensynergy.com, nicola.mazzucato@arm.com,
	tarek.el-sherbiny@arm.com, quic_kshivnan@quicinc.com
Subject: Re: [PATCH v6 17/17] firmware: arm_scmi: Add per-channel Raw injection support
Date: Wed, 11 Jan 2023 21:30:34 +0000	[thread overview]
Message-ID: <Y78qa9IBKUE7MZWO@e120937-lin> (raw)
In-Reply-To: <20221229182253.948175-18-cristian.marussi@arm.com>

On Thu, Dec 29, 2022 at 06:22:53PM +0000, Cristian Marussi wrote:
> On a system configured with multiple transport channels, expose a few
> additional debugfs per-channel entries to allow a user to explicitly select
> which transport channel to use for the SCMI message injection.
> 
> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
> ---
>  Documentation/ABI/testing/debugfs-scmi-raw |  43 +++++++
>  drivers/firmware/arm_scmi/driver.c         |  30 ++++-
>  drivers/firmware/arm_scmi/protocols.h      |   3 +
>  drivers/firmware/arm_scmi/raw_mode.c       | 142 ++++++++++++++++++---
>  drivers/firmware/arm_scmi/raw_mode.h       |   3 +-
>  5 files changed, 201 insertions(+), 20 deletions(-)
> 
> diff --git a/Documentation/ABI/testing/debugfs-scmi-raw b/Documentation/ABI/testing/debugfs-scmi-raw
> index 45817d465b1f..5468ec08c084 100644
> --- a/Documentation/ABI/testing/debugfs-scmi-raw
> +++ b/Documentation/ABI/testing/debugfs-scmi-raw
> @@ -64,3 +64,46 @@ Description:	SCMI Raw stack reset facility; writing a value to this entry
>  		Can be used to reset and clean the SCMI Raw stack between to
>  		different test-run.
>  Users:		Debugging, any userspace test suite
> +
> +What:		/sys/kernel/debug/scmi/<n>/raw/channels/<m>/message
> +Date:		March 2023
> +KernelVersion:	6.3
> +Contact:	cristian.marussi@arm.com
> +Description:	SCMI Raw synchronous message injection/snooping facility; write
> +		a complete SCMI synchronous command message (header included)
> +		in little-endian binary format to have it sent to the configured
> +		backend SCMI server for instance <n> through the <m> transport
> +		channel.
> +		Any subsequently received response can be read from this same
> +		entry if it arrived on channel <m> within the configured
> +		timeout.
> +		Each write to the entry causes one command request to be built
> +		and sent while the replies are read back one message at time
> +		(receiving an EOF at each message boundary).
> +		Note that these per-channel entries rooted at <..>/channels
> +		exist only if the transport is configured to have more than
> +		one channel.
> +Users:		Debugging, any userspace test suite
> +
> +What:		/sys/kernel/debug/scmi/<n>/raw/channels/<m>/message_async
> +Date:		March 2023
> +KernelVersion:	6.3
> +Contact:	cristian.marussi@arm.com
> +Description:	SCMI Raw asynchronous message injection/snooping facility; write
> +		a complete SCMI asynchronous command message (header included)
> +		in little-endian binary format to have it sent to the configured
> +		backend SCMI server for instance <n> through the <m> transport
> +		channel.
> +		Any subsequently received response can be read from this same
> +		entry if it arrived on channel <m> within the configured
> +		timeout.
> +		Any additional delayed response received afterwards can be read
> +		from this same entry too if it arrived within the configured
> +		timeout.
> +		Each write to the entry causes one command request to be built
> +		and sent while the replies are read back one message at time
> +		(receiving an EOF at each message boundary).
> +		Note that these per-channel entries rooted at <..>/channels
> +		exist only if the transport is configured to have more than
> +		one channel.
> +Users:		Debugging, any userspace test suite
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index da60f218aed9..2d7e669d6dc4 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -42,6 +42,8 @@
>  #define CREATE_TRACE_POINTS
>  #include <trace/events/scmi.h>
>  
> +#define SCMI_MAX_CHANNELS	256
> +
>  static DEFINE_IDA(scmi_id);
>  
>  static DEFINE_IDR(scmi_protocols);
> @@ -127,6 +129,8 @@ struct scmi_debug_info {
>   * @handle: Instance of SCMI handle to send to clients
>   * @tx_minfo: Universal Transmit Message management info
>   * @rx_minfo: Universal Receive Message management info
> + * @channels: The list of configured channels.
> + * @num_chans: Number of channels described in @channels
>   * @tx_idr: IDR object to map protocol id to Tx channel info pointer
>   * @rx_idr: IDR object to map protocol id to Rx channel info pointer
>   * @protocols: IDR for protocols' instance descriptors initialized for
> @@ -162,6 +166,8 @@ struct scmi_info {
>  	struct scmi_handle handle;
>  	struct scmi_xfers_info tx_minfo;
>  	struct scmi_xfers_info rx_minfo;
> +	unsigned int channels[SCMI_MAX_CHANNELS];
> +	int num_chans;

I have a small rework for V7 to get rid of these channels/num_chans
additional fields that are un-needed and can be retrieved dynamically
when raw mode is initialized.

Thanks,
Cristian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Cristian Marussi <cristian.marussi@arm.com>
To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com,
	Jonathan.Cameron@huawei.com, f.fainelli@gmail.com,
	etienne.carriere@linaro.org, vincent.guittot@linaro.org,
	souvik.chakravarty@arm.com, wleavitt@marvell.com,
	peter.hilber@opensynergy.com, nicola.mazzucato@arm.com,
	tarek.el-sherbiny@arm.com, quic_kshivnan@quicinc.com
Subject: Re: [PATCH v6 17/17] firmware: arm_scmi: Add per-channel Raw injection support
Date: Wed, 11 Jan 2023 21:30:34 +0000	[thread overview]
Message-ID: <Y78qa9IBKUE7MZWO@e120937-lin> (raw)
In-Reply-To: <20221229182253.948175-18-cristian.marussi@arm.com>

On Thu, Dec 29, 2022 at 06:22:53PM +0000, Cristian Marussi wrote:
> On a system configured with multiple transport channels, expose a few
> additional debugfs per-channel entries to allow a user to explicitly select
> which transport channel to use for the SCMI message injection.
> 
> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
> ---
>  Documentation/ABI/testing/debugfs-scmi-raw |  43 +++++++
>  drivers/firmware/arm_scmi/driver.c         |  30 ++++-
>  drivers/firmware/arm_scmi/protocols.h      |   3 +
>  drivers/firmware/arm_scmi/raw_mode.c       | 142 ++++++++++++++++++---
>  drivers/firmware/arm_scmi/raw_mode.h       |   3 +-
>  5 files changed, 201 insertions(+), 20 deletions(-)
> 
> diff --git a/Documentation/ABI/testing/debugfs-scmi-raw b/Documentation/ABI/testing/debugfs-scmi-raw
> index 45817d465b1f..5468ec08c084 100644
> --- a/Documentation/ABI/testing/debugfs-scmi-raw
> +++ b/Documentation/ABI/testing/debugfs-scmi-raw
> @@ -64,3 +64,46 @@ Description:	SCMI Raw stack reset facility; writing a value to this entry
>  		Can be used to reset and clean the SCMI Raw stack between to
>  		different test-run.
>  Users:		Debugging, any userspace test suite
> +
> +What:		/sys/kernel/debug/scmi/<n>/raw/channels/<m>/message
> +Date:		March 2023
> +KernelVersion:	6.3
> +Contact:	cristian.marussi@arm.com
> +Description:	SCMI Raw synchronous message injection/snooping facility; write
> +		a complete SCMI synchronous command message (header included)
> +		in little-endian binary format to have it sent to the configured
> +		backend SCMI server for instance <n> through the <m> transport
> +		channel.
> +		Any subsequently received response can be read from this same
> +		entry if it arrived on channel <m> within the configured
> +		timeout.
> +		Each write to the entry causes one command request to be built
> +		and sent while the replies are read back one message at time
> +		(receiving an EOF at each message boundary).
> +		Note that these per-channel entries rooted at <..>/channels
> +		exist only if the transport is configured to have more than
> +		one channel.
> +Users:		Debugging, any userspace test suite
> +
> +What:		/sys/kernel/debug/scmi/<n>/raw/channels/<m>/message_async
> +Date:		March 2023
> +KernelVersion:	6.3
> +Contact:	cristian.marussi@arm.com
> +Description:	SCMI Raw asynchronous message injection/snooping facility; write
> +		a complete SCMI asynchronous command message (header included)
> +		in little-endian binary format to have it sent to the configured
> +		backend SCMI server for instance <n> through the <m> transport
> +		channel.
> +		Any subsequently received response can be read from this same
> +		entry if it arrived on channel <m> within the configured
> +		timeout.
> +		Any additional delayed response received afterwards can be read
> +		from this same entry too if it arrived within the configured
> +		timeout.
> +		Each write to the entry causes one command request to be built
> +		and sent while the replies are read back one message at time
> +		(receiving an EOF at each message boundary).
> +		Note that these per-channel entries rooted at <..>/channels
> +		exist only if the transport is configured to have more than
> +		one channel.
> +Users:		Debugging, any userspace test suite
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index da60f218aed9..2d7e669d6dc4 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -42,6 +42,8 @@
>  #define CREATE_TRACE_POINTS
>  #include <trace/events/scmi.h>
>  
> +#define SCMI_MAX_CHANNELS	256
> +
>  static DEFINE_IDA(scmi_id);
>  
>  static DEFINE_IDR(scmi_protocols);
> @@ -127,6 +129,8 @@ struct scmi_debug_info {
>   * @handle: Instance of SCMI handle to send to clients
>   * @tx_minfo: Universal Transmit Message management info
>   * @rx_minfo: Universal Receive Message management info
> + * @channels: The list of configured channels.
> + * @num_chans: Number of channels described in @channels
>   * @tx_idr: IDR object to map protocol id to Tx channel info pointer
>   * @rx_idr: IDR object to map protocol id to Rx channel info pointer
>   * @protocols: IDR for protocols' instance descriptors initialized for
> @@ -162,6 +166,8 @@ struct scmi_info {
>  	struct scmi_handle handle;
>  	struct scmi_xfers_info tx_minfo;
>  	struct scmi_xfers_info rx_minfo;
> +	unsigned int channels[SCMI_MAX_CHANNELS];
> +	int num_chans;

I have a small rework for V7 to get rid of these channels/num_chans
additional fields that are un-needed and can be retrieved dynamically
when raw mode is initialized.

Thanks,
Cristian

  reply	other threads:[~2023-01-11 21:31 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-29 18:22 [PATCH v6 00/17] Introduce a unified API for SCMI Server testing Cristian Marussi
2022-12-29 18:22 ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 01/17] firmware: arm_scmi: Refactor xfer in-flight registration routines Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 02/17] firmware: arm_scmi: Refactor polling helpers Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 03/17] firmware: arm_scmi: Refactor scmi_wait_for_message_response Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 04/17] firmware: arm_scmi: Add flags field to xfer Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 05/17] firmware: arm_scmi: Add xfer Raw helpers Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 06/17] firmware: arm_scmi: Move errors defs and code to common.h Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 07/17] firmware: arm_scmi: Add internal platform/channel IDs Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 08/17] include: trace: Add platform and channel instance references Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 09/17] debugfs: Export debugfs_create_str symbol Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2023-01-19 15:35   ` Greg Kroah-Hartman
2023-01-19 15:35     ` Greg Kroah-Hartman
2022-12-29 18:22 ` [PATCH v6 10/17] firmware: arm_scmi: Populate a common SCMI debugsfs root Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 11/17] firmware: arm_scmi: Add debugfs ABI documentation for common entries Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 12/17] firmware: arm_scmi: Add core Raw transmission support Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 13/17] firmware: arm_scmi: Add debugfs ABI documentation for Raw mode Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 14/17] firmware: arm_scmi: Reject SCMI drivers while in " Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 15/17] firmware: arm_scmi: Call Raw mode hooks from the core stack Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 16/17] firmware: arm_scmi: Add Raw mode coexistence support Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2022-12-29 18:22 ` [PATCH v6 17/17] firmware: arm_scmi: Add per-channel Raw injection support Cristian Marussi
2022-12-29 18:22   ` Cristian Marussi
2023-01-11 21:30   ` Cristian Marussi [this message]
2023-01-11 21:30     ` 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=Y78qa9IBKUE7MZWO@e120937-lin \
    --to=cristian.marussi@arm.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=etienne.carriere@linaro.org \
    --cc=f.fainelli@gmail.com \
    --cc=james.quinlan@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicola.mazzucato@arm.com \
    --cc=peter.hilber@opensynergy.com \
    --cc=quic_kshivnan@quicinc.com \
    --cc=souvik.chakravarty@arm.com \
    --cc=sudeep.holla@arm.com \
    --cc=tarek.el-sherbiny@arm.com \
    --cc=vincent.guittot@linaro.org \
    --cc=wleavitt@marvell.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.