aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoic Pallardy <loic.pallardy@st.com>2018-07-27 09:14:36 -0400
committerBjorn Andersson <bjorn.andersson@linaro.org>2018-10-10 01:38:37 -0400
commit3bc8140b157c973f3746cc72d31b3fe0fa7a4117 (patch)
tree0e815c024a8e63b894e8347bed7f2a5366b02232
parentbbcda30271752bb7490f2e2aef5411dbcae69116 (diff)
remoteproc: configure IOMMU only if device address requested
If there is no IOMMU associate to remote processor device, remoteproc_core won't be able to satisfy device address requested in firmware resource table. Return an error as configuration won't be coherent. Signed-off-by: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
-rw-r--r--drivers/remoteproc/remoteproc_core.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index aa6206706fe3..8ca752cbcfe9 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -657,7 +657,15 @@ static int rproc_handle_carveout(struct rproc *rproc,
657 * to use the iommu-based DMA API: we expect 'dma' to contain the 657 * to use the iommu-based DMA API: we expect 'dma' to contain the
658 * physical address in this case. 658 * physical address in this case.
659 */ 659 */
660 if (rproc->domain) { 660
661 if (rsc->da != FW_RSC_ADDR_ANY && !rproc->domain) {
662 dev_err(dev->parent,
663 "Bad carveout rsc configuration\n");
664 ret = -ENOMEM;
665 goto dma_free;
666 }
667
668 if (rsc->da != FW_RSC_ADDR_ANY && rproc->domain) {
661 mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); 669 mapping = kzalloc(sizeof(*mapping), GFP_KERNEL);
662 if (!mapping) { 670 if (!mapping) {
663 ret = -ENOMEM; 671 ret = -ENOMEM;