Skip to content

Commit 80f3afd

Browse files
Srinivas-Kandagatlagregkh
authored andcommitted
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: c68cfb7 ("misc: fastrpc: Add support for context Invoke method") Signed-off-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 977e6c8 commit 80f3afd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/misc/fastrpc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,16 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)
679679
pages[i].size = roundup(len, PAGE_SIZE);
680680

681681
if (ctx->maps[i]) {
682+
struct vm_area_struct *vma = NULL;
683+
682684
rpra[i].pv = (u64) ctx->args[i].ptr;
683685
pages[i].addr = ctx->maps[i]->phys;
686+
687+
vma = find_vma(current->mm, ctx->args[i].ptr);
688+
if (vma)
689+
pages[i].addr += ctx->args[i].ptr -
690+
vma->vm_start;
691+
684692
} else {
685693
rlen -= ALIGN(args, FASTRPC_ALIGN) - args;
686694
args = ALIGN(args, FASTRPC_ALIGN);

0 commit comments

Comments
 (0)