All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabien Dessenne <fabien.dessenne@st.com>
To: Bjorn Andersson <bjorn.andersson@linaro.org>,
	linux-remoteproc@vger.kernel.org,
	Arnaud Pouliquen <arnaud.pouliquen@st.com>,
	Loic Pallardy <loic.pallardy@st.com>,
	Oleksij
Cc: Fabien Dessenne <fabien.dessenne@st.com>,
	Suman Anna <s-anna@ti.com>, Alex Elder <elder@linaro.org>
Subject: [RFC v2 4/5] remoteproc: probe the system resource manager
Date: Wed, 27 Jun 2018 10:06:21 +0200	[thread overview]
Message-ID: <1530086782-5046-5-git-send-email-fabien.dessenne@st.com> (raw)
In-Reply-To: <1530086782-5046-1-git-send-email-fabien.dessenne@st.com>

When a remote processor registers, populate the device tree to probe
the SRM core driver

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
---
 drivers/remoteproc/remoteproc_core.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 283b258..a67f918 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -41,6 +41,7 @@
 #include <linux/crc32.h>
 #include <linux/virtio_ids.h>
 #include <linux/virtio_ring.h>
+#include <linux/of_platform.h>
 #include <asm/byteorder.h>
 
 #include "remoteproc_internal.h"
@@ -1485,6 +1486,11 @@ int rproc_add(struct rproc *rproc)
 			return ret;
 	}
 
+	/* add resource manager device */
+	ret = devm_of_platform_populate(dev->parent);
+	if (ret < 0)
+		return ret;
+
 	/* expose to rproc_get_by_phandle users */
 	mutex_lock(&rproc_list_mutex);
 	list_add(&rproc->node, &rproc_list);
@@ -1705,6 +1711,8 @@ int rproc_del(struct rproc *rproc)
 	list_del(&rproc->node);
 	mutex_unlock(&rproc_list_mutex);
 
+	of_platform_depopulate(rproc->dev.parent);
+
 	device_del(&rproc->dev);
 
 	return 0;
-- 
2.7.4

  parent reply	other threads:[~2018-06-27  8:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-27  8:06 [RFC v2 0/5] System resource management Fabien Dessenne
2018-06-27  8:06 ` [RFC v2 1/5] dt-bindings: remoteproc: add system resource manager (SRM) Fabien Dessenne
2018-06-27  8:06 ` [RFC v2 2/5] remoteproc: add system resource manager core Fabien Dessenne
2018-06-27  8:06 ` [RFC v2 3/5] remoteproc: add system resource manager device Fabien Dessenne
2018-06-27  8:06 ` Fabien Dessenne [this message]
2018-06-27  8:06 ` [RFC v2 5/5] remoteproc: srm: introduce dynamic resource manager Fabien Dessenne

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=1530086782-5046-5-git-send-email-fabien.dessenne@st.com \
    --to=fabien.dessenne@st.com \
    --cc=arnaud.pouliquen@st.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=elder@linaro.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=loic.pallardy@st.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 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.