diff options
author | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2019-03-07 13:12:26 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-27 20:09:58 +0300 |
commit | 80f3afd72bd4149c57daf852905476b43bb47647 (patch) | |
tree | ad60a1c7d5b8f8ae8d3b94b9d7222d1dd53ea109 /drivers/misc/fastrpc.c | |
parent | 977e6c8d1d18061e083080c3657631eec17ca3ff (diff) | |
download | linux-80f3afd72bd4149c57daf852905476b43bb47647.tar.xz |
misc: fastrpc: consider address offset before sending to DSP
While passing address phy address to DSP, take care of the offset
calculated from virtual address vma.
Fixes: c68cfb718c8f ("misc: fastrpc: Add support for context Invoke method")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/fastrpc.c')
-rw-r--r-- | drivers/misc/fastrpc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 8e43f3d85bfd..5440735c94ba 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -679,8 +679,16 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx) pages[i].size = roundup(len, PAGE_SIZE); if (ctx->maps[i]) { + struct vm_area_struct *vma = NULL; + rpra[i].pv = (u64) ctx->args[i].ptr; pages[i].addr = ctx->maps[i]->phys; + + vma = find_vma(current->mm, ctx->args[i].ptr); + if (vma) + pages[i].addr += ctx->args[i].ptr - + vma->vm_start; + } else { rlen -= ALIGN(args, FASTRPC_ALIGN) - args; args = ALIGN(args, FASTRPC_ALIGN); |