summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2013-07-01 17:01:56 +0300
committerOhad Ben-Cohen <ohad@wizery.com>2013-07-01 17:01:56 +0300
commitb6356a013a0933e42556c2def806f06caf459acf (patch)
tree6ebbecfc88e67ca1058e20d2a6c5c34d72db11d5 /drivers/remoteproc
parente4760363ea14b7b707ba68ab780c8ecf98a84c15 (diff)
downloadlinux-b6356a013a0933e42556c2def806f06caf459acf.tar.gz
linux-b6356a013a0933e42556c2def806f06caf459acf.tar.bz2
linux-b6356a013a0933e42556c2def806f06caf459acf.zip
remoteproc: free carveout memories only after unmapping them
It is not preferable to have the allocated pages for carveout memories freed before they are unmapped. The code that deals with the cleanup of carveout memories is therefore moved after the corresponding mapping entries were cleaned up. This is mostly a no-op since the remote processors are already stopped when the cleanup function is called, but this will make the cleanup code follow the exact reverse path of allocation. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/remoteproc_core.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 7e33536b5c2b..9fef20022ab4 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -762,13 +762,6 @@ static void rproc_resource_cleanup(struct rproc *rproc)
kfree(entry);
}
- /* clean up carveout allocations */
- list_for_each_entry_safe(entry, tmp, &rproc->carveouts, node) {
- dma_free_coherent(dev->parent, entry->len, entry->va, entry->dma);
- list_del(&entry->node);
- kfree(entry);
- }
-
/* clean up iommu mapping entries */
list_for_each_entry_safe(entry, tmp, &rproc->mappings, node) {
size_t unmapped;
@@ -783,6 +776,13 @@ static void rproc_resource_cleanup(struct rproc *rproc)
list_del(&entry->node);
kfree(entry);
}
+
+ /* clean up carveout allocations */
+ list_for_each_entry_safe(entry, tmp, &rproc->carveouts, node) {
+ dma_free_coherent(dev->parent, entry->len, entry->va, entry->dma);
+ list_del(&entry->node);
+ kfree(entry);
+ }
}
/*