diff options
author | Dylan Van Assche <[email protected]> | 2024-07-05 08:58:59 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2024-07-05 10:01:43 +0200 |
commit | ba2174057252b296ed73fdfa60235a9e20e807ce (patch) | |
tree | d15e2110e5262e4a97d672e58320d99c5ad83b03 | |
parent | c3c0363bc72d4d0907a6d446d7424b3f022ce82a (diff) |
misc: fastrpc: use coherent pool for untranslated Compute Banks
Use fastrpc_remote_heap_alloc to allocate from the FastRPC device
instead of the Compute Bank when the session ID is 0. This ensures
that the allocation is inside the coherent DMA pool which is already
accessible to the DSP. This is necessary to support FastRPC devices
which do not have dedicated Compute Banks such as the SLPI on the SDM845.
The latter uses an allocated CMA region instead of FastRPC Compute Banks.
Signed-off-by: Dylan Van Assche <[email protected]>
Reviewed-by: Caleb Connolly <[email protected]>
Reviewed-by: Ekansh Gupta <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Srinivas Kandagatla <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/misc/fastrpc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 1c045f9a75a4..95931abc3770 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -953,7 +953,10 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx) ctx->msg_sz = pkt_size; - err = fastrpc_buf_alloc(ctx->fl, dev, pkt_size, &ctx->buf); + if (ctx->fl->sctx->sid) + err = fastrpc_buf_alloc(ctx->fl, dev, pkt_size, &ctx->buf); + else + err = fastrpc_remote_heap_alloc(ctx->fl, dev, pkt_size, &ctx->buf); if (err) return err; |