Skip to content

Commit

Permalink
remoteproc: configure IOMMU only if device address requested
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Loic Pallardy authored and Bjorn Andersson committed Oct 10, 2018
1 parent bbcda30 commit 3bc8140
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/remoteproc/remoteproc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,15 @@ static int rproc_handle_carveout(struct rproc *rproc,
* to use the iommu-based DMA API: we expect 'dma' to contain the
* physical address in this case.
*/
if (rproc->domain) {

if (rsc->da != FW_RSC_ADDR_ANY && !rproc->domain) {
dev_err(dev->parent,
"Bad carveout rsc configuration\n");
ret = -ENOMEM;
goto dma_free;
}

if (rsc->da != FW_RSC_ADDR_ANY && rproc->domain) {
mapping = kzalloc(sizeof(*mapping), GFP_KERNEL);
if (!mapping) {
ret = -ENOMEM;
Expand Down

0 comments on commit 3bc8140

Please sign in to comment.