Skip to content

Commit fe6518d

Browse files
Ekansh Guptagregkh
authored andcommitted
misc: fastrpc: Pass proper scm arguments for static process init
Memory is allocated for dynamic loading when audio daemon is trying to attach to audioPD on DSP side. This memory is allocated from reserved CMA memory region and needs ownership assignment to new VMID in order to use it from audioPD. In the current implementation, arguments are not correctly passed to the scm call which might result in failure of dynamic loading on audioPD. Added changes to pass correct arguments during daemon attach request. Fixes: 0871561 ("misc: fastrpc: Add support for audiopd") Cc: stable <stable@kernel.org> Tested-by: Ekansh Gupta <quic_ekangupt@quicinc.com> Signed-off-by: Ekansh Gupta <quic_ekangupt@quicinc.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230811115643.38578-4-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a2cb9cd commit fe6518d

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

drivers/misc/fastrpc.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,13 +1325,18 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
13251325
return 0;
13261326
err_invoke:
13271327
if (fl->cctx->vmcount) {
1328-
struct qcom_scm_vmperm perm;
1328+
u64 src_perms = 0;
1329+
struct qcom_scm_vmperm dst_perms;
1330+
u32 i;
13291331

1330-
perm.vmid = QCOM_SCM_VMID_HLOS;
1331-
perm.perm = QCOM_SCM_PERM_RWX;
1332+
for (i = 0; i < fl->cctx->vmcount; i++)
1333+
src_perms |= BIT(fl->cctx->vmperms[i].vmid);
1334+
1335+
dst_perms.vmid = QCOM_SCM_VMID_HLOS;
1336+
dst_perms.perm = QCOM_SCM_PERM_RWX;
13321337
err = qcom_scm_assign_mem(fl->cctx->remote_heap->phys,
13331338
(u64)fl->cctx->remote_heap->size,
1334-
&fl->cctx->perms, &perm, 1);
1339+
&src_perms, &dst_perms, 1);
13351340
if (err)
13361341
dev_err(fl->sctx->dev, "Failed to assign memory phys 0x%llx size 0x%llx err %d",
13371342
fl->cctx->remote_heap->phys, fl->cctx->remote_heap->size, err);

0 commit comments

Comments
 (0)