lkml.org 
[lkml]   [2018]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 01/17] remoteproc: configure IOMMU only if device address requested
    Date
    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>
    ---
    drivers/remoteproc/remoteproc_core.c | 10 +++++++++-
    1 file changed, 9 insertions(+), 1 deletion(-)

    diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
    index 4cd1a8e..437fabf 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,
    * 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;
    --
    1.9.1
    \
     
     \ /
      Last update: 2018-07-27 15:17    [W:2.252 / U:0.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site