Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

misc: fastrpc: Add fastrpc_remote_heap_alloc

Split fastrpc_buf_alloc in such a way it allows allocation of remote
heap too and add fastrpc_remote_heap_alloc to do so.

Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221125071405.148786-5-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Abel Vesa and committed by
Greg Kroah-Hartman
6f18c7e8 1ce91d45

+27 -4
+27 -4
drivers/misc/fastrpc.c
··· 369 369 kfree(buf); 370 370 } 371 371 372 - static int fastrpc_buf_alloc(struct fastrpc_user *fl, struct device *dev, 372 + static int __fastrpc_buf_alloc(struct fastrpc_user *fl, struct device *dev, 373 373 u64 size, struct fastrpc_buf **obuf) 374 374 { 375 375 struct fastrpc_buf *buf; ··· 397 397 return -ENOMEM; 398 398 } 399 399 400 - if (fl->sctx && fl->sctx->sid) 401 - buf->phys += ((u64)fl->sctx->sid << 32); 402 - 403 400 *obuf = buf; 404 401 405 402 return 0; 403 + } 404 + 405 + static int fastrpc_buf_alloc(struct fastrpc_user *fl, struct device *dev, 406 + u64 size, struct fastrpc_buf **obuf) 407 + { 408 + int ret; 409 + struct fastrpc_buf *buf; 410 + 411 + ret = __fastrpc_buf_alloc(fl, dev, size, obuf); 412 + if (ret) 413 + return ret; 414 + 415 + buf = *obuf; 416 + 417 + if (fl->sctx && fl->sctx->sid) 418 + buf->phys += ((u64)fl->sctx->sid << 32); 419 + 420 + return 0; 421 + } 422 + 423 + static int fastrpc_remote_heap_alloc(struct fastrpc_user *fl, struct device *dev, 424 + u64 size, struct fastrpc_buf **obuf) 425 + { 426 + struct device *rdev = &fl->cctx->rpdev->dev; 427 + 428 + return __fastrpc_buf_alloc(fl, rdev, size, obuf); 406 429 } 407 430 408 431 static void fastrpc_channel_ctx_free(struct kref *ref)