Skip to content

Commit

Permalink
misc: fastrpc: consider address offset before sending to DSP
Browse files Browse the repository at this point in the history
While passing address phy address to DSP, take care of the offset
calculated from virtual address vma.

Fixes: c68cfb7 ("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>
  • Loading branch information
Srinivas Kandagatla authored and Greg Kroah-Hartman committed Mar 27, 2019
1 parent 977e6c8 commit 80f3afd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/misc/fastrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 80f3afd

Please sign in to comment.