Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
To: Sudeep Holla <sudeep.holla@kernel.org>
Cc: arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	kernel-team@meta.com, Cristian Marussi <cristian.marussi@arm.com>,
	Breno Leitao <leitao@debian.org>
Subject: Re: [PATCH v3 5/9] firmware: arm_scmi: Pass protocol ID to chan_available() transport callback
Date: Mon, 24 Aug 2026 10:45:16 -0700	[thread overview]
Message-ID: <20260824104516.00002b8c@oss.qualcomm.com> (raw)
In-Reply-To: <20260813-acpi_scmi_pcc-v3-5-cb6b88b4ebb3@kernel.org>

On Thu, 13 Aug 2026 12:33:00 +0100
Sudeep Holla <sudeep.holla@kernel.org> wrote:

> Extend the SCMI transport_ops chan_available() callback to include the
> protocol ID (prot_id) as an argument. This allows transports to determine
> channel availability based on the specific protocol being used, improving
> flexibility in platforms that share transport channels across multiple
> protocols. This will be useful when ACPI PCC transport gets added.
> 
> Updated all existing users and definitions of chan_available() in
> SCMI core and transport drivers (mailbox, optee, etc.) accordingly.
> 
> No functional change.
> 
> Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>

Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>


> ---
>  drivers/firmware/arm_scmi/common.h             | 3 ++-
>  drivers/firmware/arm_scmi/driver.c             | 2 +-
>  drivers/firmware/arm_scmi/transports/mailbox.c | 3 ++-
>  drivers/firmware/arm_scmi/transports/optee.c   | 3 ++-
>  drivers/firmware/arm_scmi/transports/smc.c     | 3 ++-
>  drivers/firmware/arm_scmi/transports/virtio.c  | 3 ++-
>  6 files changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
> index 042867c28b88..1ab4543e0f4a 100644
> --- a/drivers/firmware/arm_scmi/common.h
> +++ b/drivers/firmware/arm_scmi/common.h
> @@ -207,7 +207,8 @@ struct scmi_chan_info {
>   * @poll_done: Callback to poll transfer status
>   */
>  struct scmi_transport_ops {
> -	bool (*chan_available)(struct fwnode_handle *fwnode, int idx);
> +	bool (*chan_available)(struct fwnode_handle *fwnode, int prot_id,
> +			       int idx);
>  	int (*chan_setup)(struct scmi_chan_info *cinfo, struct device *dev,
>  			  bool tx);
>  	int (*chan_free)(int id, void *p, void *data);
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index 9ad827c6a9ab..aad678db0f6e 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -2768,7 +2768,7 @@ static int scmi_chan_setup(struct scmi_info *info, struct fwnode_handle *fwnode,
>  	if (idr_find(idr, prot_id))
>  		return -EEXIST;
>  
> -	if (!info->desc->ops->chan_available(fwnode, idx)) {
> +	if (!info->desc->ops->chan_available(fwnode, prot_id, idx)) {
>  		cinfo = idr_find(idr, SCMI_PROTOCOL_BASE);
>  		if (unlikely(!cinfo)) /* Possible only if platform has no Rx */
>  			return -EINVAL;
> diff --git a/drivers/firmware/arm_scmi/transports/mailbox.c b/drivers/firmware/arm_scmi/transports/mailbox.c
> index b692cae4ff25..56af2cb0f424 100644
> --- a/drivers/firmware/arm_scmi/transports/mailbox.c
> +++ b/drivers/firmware/arm_scmi/transports/mailbox.c
> @@ -77,7 +77,8 @@ static void rx_callback(struct mbox_client *cl, void *m)
>  		      core->shmem->read_header(smbox->shmem), NULL);
>  }
>  
> -static bool mailbox_chan_available(struct fwnode_handle *fwnode, int idx)
> +static bool
> +mailbox_chan_available(struct fwnode_handle *fwnode, int prot_id, int idx)
>  {
>  	int num_mb;
>  	struct device_node *of_node = to_of_node(fwnode);
> diff --git a/drivers/firmware/arm_scmi/transports/optee.c b/drivers/firmware/arm_scmi/transports/optee.c
> index 07d3affa0964..6022f74d28f3 100644
> --- a/drivers/firmware/arm_scmi/transports/optee.c
> +++ b/drivers/firmware/arm_scmi/transports/optee.c
> @@ -314,7 +314,8 @@ static int invoke_process_msg_channel(struct scmi_optee_channel *channel, size_t
>  	return 0;
>  }
>  
> -static bool scmi_optee_chan_available(struct fwnode_handle *fwnode, int idx)
> +static bool
> +scmi_optee_chan_available(struct fwnode_handle *fwnode, int prot_id, int idx)
>  {
>  	u32 channel_id;
>  	struct device_node *of_node = to_of_node(fwnode);
> diff --git a/drivers/firmware/arm_scmi/transports/smc.c b/drivers/firmware/arm_scmi/transports/smc.c
> index 1079cd01190b..ee9e44468c1e 100644
> --- a/drivers/firmware/arm_scmi/transports/smc.c
> +++ b/drivers/firmware/arm_scmi/transports/smc.c
> @@ -84,7 +84,8 @@ static irqreturn_t smc_msg_done_isr(int irq, void *data)
>  	return IRQ_HANDLED;
>  }
>  
> -static bool smc_chan_available(struct fwnode_handle *fwnode, int idx)
> +static bool
> +smc_chan_available(struct fwnode_handle *fwnode, int prot_id, int idx)
>  {
>  	struct device_node *of_node = to_of_node(fwnode);
>  	struct device_node *np __free(device_node) = NULL;
> diff --git a/drivers/firmware/arm_scmi/transports/virtio.c b/drivers/firmware/arm_scmi/transports/virtio.c
> index 6b060d61e0ca..3d608c8c4fe8 100644
> --- a/drivers/firmware/arm_scmi/transports/virtio.c
> +++ b/drivers/firmware/arm_scmi/transports/virtio.c
> @@ -375,7 +375,8 @@ static unsigned int virtio_get_max_msg(struct scmi_chan_info *base_cinfo)
>  	return vioch->max_msg;
>  }
>  
> -static bool virtio_chan_available(struct fwnode_handle *fwnode, int idx)
> +static bool
> +virtio_chan_available(struct fwnode_handle *fwnode, int prot_id, int idx)
>  {
>  	struct scmi_vio_channel *channels, *vioch = NULL;
>  
> 



  reply	other threads:[~2026-08-24 17:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 11:32 [PATCH v3 0/9] firmware: arm_scmi: Refactoring and enablement of ACPI PCC transport Sudeep Holla
2026-08-13 11:32 ` [PATCH v3 1/9] firmware: arm_scmi: Set fwnode for the generated SCMI platform device Sudeep Holla
2026-08-24 16:51   ` Jonathan Cameron
2026-08-13 11:32 ` [PATCH v3 2/9] firmware: arm_scmi: Extend transport driver macro to support ACPI Sudeep Holla
2026-08-24 17:04   ` Jonathan Cameron
2026-08-13 11:32 ` [PATCH v3 3/9] firmware: arm_scmi: Convert OF-only paths to generic fwnode in SCMI core Sudeep Holla
2026-08-24 17:39   ` Jonathan Cameron
2026-08-13 11:32 ` [PATCH v3 4/9] firmware: arm_scmi: Fall back to ACPI HID when "compatible" is absent Sudeep Holla
2026-08-24 17:43   ` Jonathan Cameron
2026-08-13 11:33 ` [PATCH v3 5/9] firmware: arm_scmi: Pass protocol ID to chan_available() transport callback Sudeep Holla
2026-08-24 17:45   ` Jonathan Cameron [this message]
2026-08-13 11:33 ` [PATCH v3 6/9] firmware: arm_scmi: Refactor protocol device creation logic Sudeep Holla
2026-08-24 17:49   ` Jonathan Cameron
2026-08-13 11:33 ` [PATCH v3 7/9] firmware: arm_scmi: Add ACPI PCC transport Sudeep Holla
2026-08-24 20:17   ` Jonathan Cameron
2026-08-13 11:33 ` [PATCH v3 8/9] firmware: arm_scmi: Initialise known ACPI protocol devices and channels Sudeep Holla
2026-08-24 20:21   ` Jonathan Cameron
2026-08-13 11:33 ` [PATCH v3 9/9] firmware: arm_scmi: Validate PCC shared memory signature Sudeep Holla
2026-08-24 20:24   ` Jonathan Cameron

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=20260824104516.00002b8c@oss.qualcomm.com \
    --to=jonathan.cameron@oss.qualcomm.com \
    --cc=arm-scmi@vger.kernel.org \
    --cc=cristian.marussi@arm.com \
    --cc=kernel-team@meta.com \
    --cc=leitao@debian.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=sudeep.holla@kernel.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