Linux Remote Processor Subsystem development
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: ohad@wizery.com, linux-remoteproc@vger.kernel.org,
	linux-kernel@vger.kernel.org, loic.pallardy@st.com,
	arnaud.pouliquen@st.com, s-anna@ti.com
Subject: Re: [PATCH v4 2/9] remoteproc: Add new attach() remoteproc operation
Date: Sun, 21 Jun 2020 23:36:38 -0700	[thread overview]
Message-ID: <20200622063638.GC149351@builder.lan> (raw)
In-Reply-To: <20200601175139.22097-3-mathieu.poirier@linaro.org>

On Mon 01 Jun 10:51 PDT 2020, Mathieu Poirier wrote:

> Add an new attach() operation in order to properly deal with
> scenarios where the remoteproc core needs to attach to a
> remote processor that has been booted by another entity.
> 
> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---
>  drivers/remoteproc/remoteproc_internal.h | 8 ++++++++
>  include/linux/remoteproc.h               | 2 ++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h
> index 4ba7cb59d3e8..fc710866f8ce 100644
> --- a/drivers/remoteproc/remoteproc_internal.h
> +++ b/drivers/remoteproc/remoteproc_internal.h
> @@ -79,6 +79,14 @@ static inline int rproc_unprepare_device(struct rproc *rproc)
>  	return 0;
>  }
>  
> +static inline int rproc_attach_device(struct rproc *rproc)
> +{
> +	if (rproc->ops->attach)
> +		return rproc->ops->attach(rproc);
> +
> +	return 0;

Afaict we don't allow the registration of a remoteproc in DETACHED state
without an "attach" function specified and as such we shouldn't be able
to end up here.

On the other hand I think it would make sense to have a system where
"attach" simply just means bring up the communication with the remote
processor, so let's keep it as is and we can adjust it as necessary
later.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> +}
> +
>  static inline
>  int rproc_fw_sanity_check(struct rproc *rproc, const struct firmware *fw)
>  {
> diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
> index 21182ad2d059..bf6a310ba870 100644
> --- a/include/linux/remoteproc.h
> +++ b/include/linux/remoteproc.h
> @@ -359,6 +359,7 @@ enum rsc_handling_status {
>   * @unprepare:	unprepare device after stop
>   * @start:	power on the device and boot it
>   * @stop:	power off the device
> + * @attach:	attach to a device that his already powered up
>   * @kick:	kick a virtqueue (virtqueue id given as a parameter)
>   * @da_to_va:	optional platform hook to perform address translations
>   * @parse_fw:	parse firmware to extract information (e.g. resource table)
> @@ -379,6 +380,7 @@ struct rproc_ops {
>  	int (*unprepare)(struct rproc *rproc);
>  	int (*start)(struct rproc *rproc);
>  	int (*stop)(struct rproc *rproc);
> +	int (*attach)(struct rproc *rproc);
>  	void (*kick)(struct rproc *rproc, int vqid);
>  	void * (*da_to_va)(struct rproc *rproc, u64 da, size_t len);
>  	int (*parse_fw)(struct rproc *rproc, const struct firmware *fw);
> -- 
> 2.20.1
> 

  reply	other threads:[~2020-06-22  6:39 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01 17:51 [PATCH v4 0/9] remoteproc: Add support for attaching with rproc Mathieu Poirier
2020-06-01 17:51 ` [PATCH v4 1/9] remoteproc: Add new RPROC_DETACHED state Mathieu Poirier
2020-06-22  6:25   ` Bjorn Andersson
2020-06-01 17:51 ` [PATCH v4 2/9] remoteproc: Add new attach() remoteproc operation Mathieu Poirier
2020-06-22  6:36   ` Bjorn Andersson [this message]
2020-06-01 17:51 ` [PATCH v4 3/9] remoteproc: Introducing function rproc_attach() Mathieu Poirier
2020-06-22  7:07   ` Bjorn Andersson
2020-06-22  7:18     ` Bjorn Andersson
2020-06-23 19:37       ` Mathieu Poirier
2020-06-01 17:51 ` [PATCH v4 4/9] remoteproc: Introducing function rproc_actuate() Mathieu Poirier
2020-06-22  7:18   ` Bjorn Andersson
2020-06-01 17:51 ` [PATCH v4 5/9] remoteproc: Introducing function rproc_validate() Mathieu Poirier
2020-06-22  7:25   ` Bjorn Andersson
2020-06-23 19:38     ` Mathieu Poirier
2020-06-01 17:51 ` [PATCH v4 6/9] remoteproc: Refactor function rproc_boot() Mathieu Poirier
2020-06-22  7:25   ` Bjorn Andersson
2020-06-01 17:51 ` [PATCH v4 7/9] remoteproc: Refactor function rproc_trigger_auto_boot() Mathieu Poirier
2020-06-22  7:25   ` Bjorn Andersson
2020-06-01 17:51 ` [PATCH v4 8/9] remoteproc: Refactor function rproc_free_vring() Mathieu Poirier
2020-06-22  7:27   ` Bjorn Andersson
2020-06-01 17:51 ` [PATCH v4 9/9] remoteproc: Properly handle firmware name when attaching Mathieu Poirier
2020-06-04 14:16   ` Arnaud POULIQUEN
2020-06-04 20:14     ` Mathieu Poirier
2020-06-22  7:33   ` Bjorn Andersson
2020-06-23 19:48     ` Mathieu Poirier
2020-06-23 20:09       ` Bjorn Andersson
2020-06-04 14:24 ` [PATCH v4 0/9] remoteproc: Add support for attaching with rproc Arnaud POULIQUEN
2020-06-04 20:27   ` Mathieu Poirier

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=20200622063638.GC149351@builder.lan \
    --to=bjorn.andersson@linaro.org \
    --cc=arnaud.pouliquen@st.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=loic.pallardy@st.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=ohad@wizery.com \
    --cc=s-anna@ti.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