From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Jeya R <jeyr@codeaurora.org>,
ekangupt@qti.qualcomm.com, linux-arm-msm@vger.kernel.org
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
fastrpc.upstream@qti.qualcomm.com
Subject: Re: [PATCH 1/2] misc: fastrpc: Add fdlist implementation
Date: Tue, 30 Nov 2021 13:12:27 +0000 [thread overview]
Message-ID: <cadd374b-cb22-9eaf-0513-67b34ccbbcf1@linaro.org> (raw)
In-Reply-To: <1638276897-6146-3-git-send-email-jeyr@codeaurora.org>
Hi Jeya,
This is version 2 of the patchset which is not reflected in the subject
line.
On 30/11/2021 12:54, Jeya R wrote:
> Add fdlist implementation to support dma handles. fdlist is populated
> by DSP if any map is no longer used and it is freed during put_args.
>
> Signed-off-by: Jeya R <jeyr@codeaurora.org>
> ---
> drivers/misc/fastrpc.c | 22 ++++++++++++++++++++--
> 1 file changed, 20 insertions(+), 2 deletions(-)
Have you missed comments my comments on this patch
https://www.spinics.net/lists/linux-arm-msm/msg99023.html
--srini
>
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index 39aca77..3c937ff 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -353,7 +353,7 @@ static void fastrpc_context_free(struct kref *ref)
> ctx = container_of(ref, struct fastrpc_invoke_ctx, refcount);
> cctx = ctx->cctx;
>
> - for (i = 0; i < ctx->nscalars; i++)
> + for (i = 0; i < ctx->nbufs; i++)
> fastrpc_map_put(ctx->maps[i]);
>
> if (ctx->buf)
> @@ -785,6 +785,7 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)
> err = fastrpc_buf_alloc(ctx->fl, dev, pkt_size, &ctx->buf);
> if (err)
> return err;
> + memset(ctx->buf->virt, 0, pkt_size);
>
> rpra = ctx->buf->virt;
> list = ctx->buf->virt + ctx->nscalars * sizeof(*rpra);
> @@ -887,9 +888,19 @@ static int fastrpc_put_args(struct fastrpc_invoke_ctx *ctx,
> u32 kernel)
> {
> struct fastrpc_remote_arg *rpra = ctx->rpra;
> - int i, inbufs;
> + struct fastrpc_map *mmap = NULL;
> + struct fastrpc_invoke_buf *list;
> + struct fastrpc_phy_page *pages;
> + u64 *fdlist;
> + int i, inbufs, outbufs, handles;
>
> inbufs = REMOTE_SCALARS_INBUFS(ctx->sc);
> + outbufs = REMOTE_SCALARS_OUTBUFS(ctx->sc);
> + handles = REMOTE_SCALARS_INHANDLES(ctx->sc) + REMOTE_SCALARS_OUTHANDLES(ctx->sc);
> + list = ctx->buf->virt + ctx->nscalars * sizeof(*rpra);
> + pages = ctx->buf->virt + ctx->nscalars * (sizeof(*list) +
> + sizeof(*rpra));
> + fdlist = (uint64_t *)(pages + inbufs + outbufs + handles);
>
> for (i = inbufs; i < ctx->nbufs; ++i) {
> if (!ctx->maps[i]) {
> @@ -906,6 +917,13 @@ static int fastrpc_put_args(struct fastrpc_invoke_ctx *ctx,
> }
> }
>
> + for (i = 0; i < FASTRPC_MAX_FDLIST; i++) {
> + if (!fdlist[i])
> + break;
> + if (!fastrpc_map_find(fl, (int)fdlist[i], &mmap))
> + fastrpc_map_put(mmap);
> + }
> +
> return 0;
> }
>
>
next prev parent reply other threads:[~2021-11-30 13:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1638276897-6146-1-git-send-email-jeyr@codeaurora.org>
2021-11-30 12:54 ` [PATCH 1/2] misc: fastrpc: Add fdlist implementation Jeya R
2021-11-30 13:12 ` Srinivas Kandagatla [this message]
2021-11-30 12:54 ` [PATCH 2/2] misc: fastrpc: Add dma handle implementation Jeya R
2021-11-30 12:57 [PATCH 0/3] Add vmid property and mapping attribute Jeya R
2021-11-30 12:57 ` [PATCH 1/2] misc: fastrpc: Add fdlist implementation Jeya R
2021-11-30 20:20 ` kernel test robot
2021-11-30 23:52 ` kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2021-11-29 5:28 [PATCH 0/2] Add DMA handle implementation Jeya R
2021-11-29 5:28 ` [PATCH 1/2] misc: fastrpc: Add fdlist implementation Jeya R
2021-11-29 7:40 ` kernel test robot
2021-11-29 8:00 ` kernel test robot
2021-11-29 15:12 ` Srinivas Kandagatla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cadd374b-cb22-9eaf-0513-67b34ccbbcf1@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=ekangupt@qti.qualcomm.com \
--cc=fastrpc.upstream@qti.qualcomm.com \
--cc=gregkh@linuxfoundation.org \
--cc=jeyr@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox