Commit 847afd7b authored by Jeya R's avatar Jeya R Committed by Greg Kroah-Hartman
Browse files

misc: fastrpc: copy to user only for non-DMA-BUF heap buffers



fastrpc_put_args is copying all the output buffers to user. For large
number of output context buffers, this might cause performance
degradation. Copying is not needed for DMA-BUF heap buffers.

Signed-off-by: default avatarJeya R <jeyr@codeaurora.org>
Link: https://lore.kernel.org/r/1632386272-18139-1-git-send-email-jeyr@codeaurora.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 304b0ba0
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -890,6 +890,7 @@ static int fastrpc_put_args(struct fastrpc_invoke_ctx *ctx,
	inbufs = REMOTE_SCALARS_INBUFS(ctx->sc);

	for (i = inbufs; i < ctx->nbufs; ++i) {
		if (!ctx->maps[i]) {
			void *src = (void *)(uintptr_t)rpra[i].pv;
			void *dst = (void *)(uintptr_t)ctx->args[i].ptr;
			u64 len = rpra[i].len;
@@ -901,6 +902,7 @@ static int fastrpc_put_args(struct fastrpc_invoke_ctx *ctx,
				memcpy(dst, src, len);
			}
		}
	}

	return 0;
}