linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaud Pouliquen <arnaud.pouliquen@st.com>
To: Bjorn Andersson <bjorn.andersson@linaro.org>,
	Ohad Ben-Cohen <ohad@wizery.com>,
	Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: <linux-remoteproc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<arnaud.pouliquen@st.com>
Subject: [RFC 08/18] remoteproc: Externalize carveout functions
Date: Thu, 16 Apr 2020 18:13:21 +0200	[thread overview]
Message-ID: <20200416161331.7606-9-arnaud.pouliquen@st.com> (raw)
In-Reply-To: <20200416161331.7606-1-arnaud.pouliquen@st.com>

The carveout functions are also used for the vring memories.
Externalize related functions to prepare migration of
the vring management in rproc virtio.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
---
 drivers/remoteproc/remoteproc_core.c     | 18 +++++++-----------
 drivers/remoteproc/remoteproc_internal.h |  4 ++++
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index cb40aae12b98..ac57cd8016be 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -51,11 +51,6 @@ static LIST_HEAD(rproc_list);
 typedef int (*rproc_handle_resource_t)(struct rproc *rproc,
 				 void *, int offset, int avail);
 
-static int rproc_alloc_carveout(struct rproc *rproc,
-				struct rproc_mem_entry *mem);
-static int rproc_release_carveout(struct rproc *rproc,
-				  struct rproc_mem_entry *mem);
-
 /* Unique indices for remoteproc devices */
 static DEFINE_IDA(rproc_dev_index);
 
@@ -281,8 +276,8 @@ rproc_find_carveout_by_name(struct rproc *rproc, const char *name, ...)
  *
  * Return: 0 if carveout matches request else error
  */
-static int rproc_check_carveout_da(struct rproc *rproc,
-				   struct rproc_mem_entry *mem, u32 da, u32 len)
+int rproc_check_carveout_da(struct rproc *rproc,
+			    struct rproc_mem_entry *mem, u32 da, u32 len)
 {
 	struct device *dev = &rproc->dev;
 	int delta;
@@ -315,6 +310,7 @@ static int rproc_check_carveout_da(struct rproc *rproc,
 
 	return 0;
 }
+EXPORT_SYMBOL(rproc_check_carveout_da);
 
 int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
 {
@@ -695,8 +691,7 @@ static int rproc_handle_devmem(struct rproc *rproc, struct fw_rsc_devmem *rsc,
  * This function allocate specified memory entry @mem using
  * dma_alloc_coherent() as default allocator
  */
-static int rproc_alloc_carveout(struct rproc *rproc,
-				struct rproc_mem_entry *mem)
+int rproc_alloc_carveout(struct rproc *rproc, struct rproc_mem_entry *mem)
 {
 	struct rproc_mem_entry *mapping = NULL;
 	struct device *dev = &rproc->dev;
@@ -791,6 +786,7 @@ static int rproc_alloc_carveout(struct rproc *rproc,
 	dma_free_coherent(dev->parent, mem->len, va, dma);
 	return ret;
 }
+EXPORT_SYMBOL(rproc_alloc_carveout);
 
 /**
  * rproc_release_carveout() - release acquired carveout
@@ -800,8 +796,7 @@ static int rproc_alloc_carveout(struct rproc *rproc,
  * This function releases specified memory entry @mem allocated via
  * rproc_alloc_carveout() function by @rproc.
  */
-static int rproc_release_carveout(struct rproc *rproc,
-				  struct rproc_mem_entry *mem)
+int rproc_release_carveout(struct rproc *rproc, struct rproc_mem_entry *mem)
 {
 	struct device *dev = &rproc->dev;
 
@@ -809,6 +804,7 @@ static int rproc_release_carveout(struct rproc *rproc,
 	dma_free_coherent(dev->parent, mem->len, mem->va, mem->dma);
 	return 0;
 }
+EXPORT_SYMBOL(rproc_release_carveout);
 
 /**
  * rproc_handle_carveout() - handle phys contig memory allocation requests
diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h
index f5eaffac2fcd..f230296908ac 100644
--- a/drivers/remoteproc/remoteproc_internal.h
+++ b/drivers/remoteproc/remoteproc_internal.h
@@ -71,6 +71,10 @@ struct resource_table *rproc_elf_find_loaded_rsc_table(struct rproc *rproc,
 						       const struct firmware *fw);
 struct rproc_mem_entry *
 rproc_find_carveout_by_name(struct rproc *rproc, const char *name, ...);
+int rproc_check_carveout_da(struct rproc *rproc, struct rproc_mem_entry *mem,
+			    u32 da, u32 len);
+int rproc_alloc_carveout(struct rproc *rproc, struct rproc_mem_entry *mem);
+int rproc_release_carveout(struct rproc *rproc, struct rproc_mem_entry *mem);
 
 static inline
 int rproc_fw_sanity_check(struct rproc *rproc, const struct firmware *fw)
-- 
2.17.1


  parent reply	other threads:[~2020-04-16 16:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16 16:13 [RFC 00/18] remoteproc: Decorelate virtio from core Arnaud Pouliquen
2020-04-16 16:13 ` [RFC 01/18] remoteproc: Store resource table address in rvdev Arnaud Pouliquen
2020-04-16 16:13 ` [RFC 02/18] remoteproc: Introduce virtio device add/remove functions in core Arnaud Pouliquen
2020-04-21 20:41   ` Mathieu Poirier
2020-04-22 12:30     ` Arnaud POULIQUEN
2020-04-22 16:57   ` Mathieu Poirier
2020-04-16 16:13 ` [RFC 03/18] remoteproc: Move rvdev management in rproc_virtio Arnaud Pouliquen
2020-04-21 22:18   ` Mathieu Poirier
2020-04-22 17:26   ` Mathieu Poirier
2020-04-16 16:13 ` [RFC 04/18] remoteproc: Add rproc_get_by_node helper Arnaud Pouliquen
2020-04-16 16:13 ` [RFC 05/18] remoteproc: Create platform device for vdev Arnaud Pouliquen
2020-04-16 16:13 ` [RFC 06/18] remoteproc: Add component in core for child devices synchronization Arnaud Pouliquen
2020-04-16 16:13 ` [RFC 07/18] remoteproc: Add component bind/unbind for virtio platform Arnaud Pouliquen
2020-04-16 16:13 ` Arnaud Pouliquen [this message]
2020-04-16 16:13 ` [RFC 09/18] remoteproc: Move vring management from core to virtio Arnaud Pouliquen
2020-04-16 16:13 ` [RFC 10/18] remoteproc: Add capability to populate rproc subnode devices Arnaud Pouliquen
2020-04-16 16:13 ` [RFC 11/18] remoteproc: Add child node component in rproc match list Arnaud Pouliquen
2020-04-16 16:13 ` [RFC 12/18] remoteproc: Support of pre-registered virtio device Arnaud Pouliquen
2020-04-16 16:13 ` [RFC 13/18] remoteproc: Add memory default allocator helper Arnaud Pouliquen
2020-04-16 16:13 ` [RFC 14/18] remoteproc: Add pa to da translation API Arnaud Pouliquen
2020-04-16 16:13 ` [RFC 15/18] remoteproc: associate memory entry to a device Arnaud Pouliquen
2020-04-16 16:13 ` [RFC 16/18] remoteproc: Parse virtio node for memory region Arnaud Pouliquen
2020-04-16 16:13 ` [RFC 17/18] remoteproc: stm32: Add the pa to da ops Arnaud Pouliquen
2020-04-16 16:13 ` [RFC 18/18] ARM: dts: stm32: Declare a virtio device Arnaud Pouliquen
2020-04-23 17:26 ` [RFC 00/18] remoteproc: Decorelate virtio from core 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=20200416161331.7606-9-arnaud.pouliquen@st.com \
    --to=arnaud.pouliquen@st.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=ohad@wizery.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).