linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Cristian Marussi <cristian.marussi@arm.com>
Cc: <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <sudeep.holla@arm.com>,
	<lukasz.luba@arm.com>, <james.quinlan@broadcom.com>
Subject: Re: [RFC PATCH v3 01/13] firmware: arm_scmi: Add receive buffer support for notifications
Date: Mon, 2 Mar 2020 14:52:13 +0000	[thread overview]
Message-ID: <20200302145213.00003304@Huawei.com> (raw)
In-Reply-To: <20200224144124.2008-2-cristian.marussi@arm.com>

On Mon, 24 Feb 2020 14:41:12 +0000
Cristian Marussi <cristian.marussi@arm.com> wrote:

> From: Sudeep Holla <sudeep.holla@arm.com>
> 
> With all the plumbing in place, let's just add the separate dedicated
> receive buffers to handle notifications that can arrive asynchronously
> from the platform firmware to OS.
> 
> Also add one check to see if the platform supports any receive channels
> before allocating the receive buffers: since those buffers are optionally
> supported though, the whole xfer initialization is also postponed to be
> able to check for their existence in advance.
> 
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> [Changed parameters in __scmi_xfer_info_init()]
> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Looks good to me.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
> V1 --> V2:
> - reviewed commit message
> - reviewed parameters of __scmi_xfer_info_init()
> ---
>  drivers/firmware/arm_scmi/driver.c | 24 ++++++++++++++++++------
>  1 file changed, 18 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index dbec767222e9..efb660c34b57 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -76,6 +76,7 @@ struct scmi_xfers_info {
>   *	implementation version and (sub-)vendor identification.
>   * @handle: Instance of SCMI handle to send to clients
>   * @tx_minfo: Universal Transmit Message management info
> + * @rx_minfo: Universal Receive Message management info
>   * @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_imp: List of protocols implemented, currently maximum of
> @@ -89,6 +90,7 @@ struct scmi_info {
>  	struct scmi_revision_info version;
>  	struct scmi_handle handle;
>  	struct scmi_xfers_info tx_minfo;
> +	struct scmi_xfers_info rx_minfo;
>  	struct idr tx_idr;
>  	struct idr rx_idr;
>  	u8 *protocols_imp;
> @@ -525,13 +527,13 @@ int scmi_handle_put(const struct scmi_handle *handle)
>  	return 0;
>  }
>  
> -static int scmi_xfer_info_init(struct scmi_info *sinfo)
> +static int __scmi_xfer_info_init(struct scmi_info *sinfo,
> +				 struct scmi_xfers_info *info)
>  {
>  	int i;
>  	struct scmi_xfer *xfer;
>  	struct device *dev = sinfo->dev;
>  	const struct scmi_desc *desc = sinfo->desc;
> -	struct scmi_xfers_info *info = &sinfo->tx_minfo;
>  
>  	/* Pre-allocated messages, no more than what hdr.seq can support */
>  	if (WARN_ON(desc->max_msg >= MSG_TOKEN_MAX)) {
> @@ -566,6 +568,16 @@ static int scmi_xfer_info_init(struct scmi_info *sinfo)
>  	return 0;
>  }
>  
> +static int scmi_xfer_info_init(struct scmi_info *sinfo)
> +{
> +	int ret = __scmi_xfer_info_init(sinfo, &sinfo->tx_minfo);
> +
> +	if (!ret && idr_find(&sinfo->rx_idr, SCMI_PROTOCOL_BASE))
> +		ret = __scmi_xfer_info_init(sinfo, &sinfo->rx_minfo);
> +
> +	return ret;
> +}
> +
>  static int scmi_chan_setup(struct scmi_info *info, struct device *dev,
>  			   int prot_id, bool tx)
>  {
> @@ -699,10 +711,6 @@ static int scmi_probe(struct platform_device *pdev)
>  	info->desc = desc;
>  	INIT_LIST_HEAD(&info->node);
>  
> -	ret = scmi_xfer_info_init(info);
> -	if (ret)
> -		return ret;
> -
>  	platform_set_drvdata(pdev, info);
>  	idr_init(&info->tx_idr);
>  	idr_init(&info->rx_idr);
> @@ -715,6 +723,10 @@ static int scmi_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> +	ret = scmi_xfer_info_init(info);
> +	if (ret)
> +		return ret;
> +
>  	ret = scmi_base_protocol_init(handle);
>  	if (ret) {
>  		dev_err(dev, "unable to communicate with SCMI(%d)\n", ret);



  reply	other threads:[~2020-03-02 14:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24 14:41 [RFC PATCH v3 00/13] SCMI Notifications Core Support Cristian Marussi
2020-02-24 14:41 ` [RFC PATCH v3 01/13] firmware: arm_scmi: Add receive buffer support for notifications Cristian Marussi
2020-03-02 14:52   ` Jonathan Cameron [this message]
2020-03-02 15:47     ` Cristian Marussi
2020-02-24 14:41 ` [RFC PATCH v3 02/13] firmware: arm_scmi: Update protocol commands and notification list Cristian Marussi
2020-02-24 14:41 ` [RFC PATCH v3 03/13] firmware: arm_scmi: Add notifications support in transport layer Cristian Marussi
2020-02-24 14:41 ` [RFC PATCH v3 04/13] firmware: arm_scmi: Add support for notifications message processing Cristian Marussi
2020-02-24 14:41 ` [RFC PATCH v3 05/13] firmware: arm_scmi: Add notification protocol-registration Cristian Marussi
2020-02-24 14:41 ` [RFC PATCH v3 06/13] firmware: arm_scmi: Add notification callbacks-registration Cristian Marussi
2020-02-24 14:41 ` [RFC PATCH v3 07/13] firmware: arm_scmi: Add notification dispatch and delivery Cristian Marussi
2020-02-24 14:41 ` [RFC PATCH v3 08/13] firmware: arm_scmi: Enable notification core Cristian Marussi
2020-02-24 14:41 ` [RFC PATCH v3 09/13] firmware: arm_scmi: Add Power notifications support Cristian Marussi
2020-02-24 14:41 ` [RFC PATCH v3 10/13] firmware: arm_scmi: Add Perf " Cristian Marussi
2020-02-24 14:41 ` [RFC PATCH v3 11/13] firmware: arm_scmi: Add Sensor " Cristian Marussi
2020-02-24 14:41 ` [RFC PATCH v3 12/13] firmware: arm_scmi: Add Reset " Cristian Marussi
2020-02-24 14:41 ` [RFC PATCH v3 13/13] firmware: arm_scmi: Add Base " 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=20200302145213.00003304@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=cristian.marussi@arm.com \
    --cc=james.quinlan@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=sudeep.holla@arm.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 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).