From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Ekansh Gupta <quic_ekangupt@quicinc.com>, linux-arm-msm@vger.kernel.org
Cc: ekangupt@qti.qualcomm.com, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, fastrpc.upstream@qti.qualcomm.com
Subject: Re: [PATCH v1] misc: fastrpc: Free DMA handles for RPC calls with no arguments
Date: Tue, 26 Sep 2023 11:27:51 +0100 [thread overview]
Message-ID: <90dffe7f-02c1-4965-8d48-1d689abc9323@linaro.org> (raw)
In-Reply-To: <1693463029-9311-1-git-send-email-quic_ekangupt@quicinc.com>
Thanks Ekansh for this patch.
few comments below
On 31/08/2023 07:23, Ekansh Gupta wrote:
> The FDs for DMA handles to be freed is updated in fdlist by DSP over
So the dsp is updating the fd list after invoke?
> a remote call. This holds true even for remote calls with no
> arguments. To handle this, get_args and put_args are needed to
> be called for remote calls with no arguments also as fdlist
> is allocated in get_args and FDs updated in fdlist is freed
> in put_args.
>
> Signed-off-by: Ekansh Gupta <quic_ekangupt@quicinc.com>
> ---
> drivers/misc/fastrpc.c | 22 +++++++++-------------
> 1 file changed, 9 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index 9666d28..e6df66e 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -1153,11 +1153,9 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel,
> if (IS_ERR(ctx))
> return PTR_ERR(ctx);
>
> - if (ctx->nscalars) {
Why do we need to remove this check?
fastrpc_internal_invoke will have nscalars set before calling. and we
are not dealing with fdlist in fastrpc_get_args(), so am not sure what
this change is helping with.
> - err = fastrpc_get_args(kernel, ctx);
> - if (err)
> - goto bail;
> - }
> + err = fastrpc_get_args(kernel, ctx);
> + if (err)
> + goto bail;
>
> /* make sure that all CPU memory writes are seen by DSP */
> dma_wmb();
> @@ -1181,14 +1179,12 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel,
> if (err)
> goto bail;
>
> - if (ctx->nscalars) {
> - /* make sure that all memory writes by DSP are seen by CPU */
> - dma_rmb();
> - /* populate all the output buffers with results */
> - err = fastrpc_put_args(ctx, kernel);
> - if (err)
> - goto bail;
> - }
> + /* make sure that all memory writes by DSP are seen by CPU */
> + dma_rmb();
> + /* populate all the output buffers with results */
A comment about fdlist here would be really useful
> + err = fastrpc_put_args(ctx, kernel);
> + if (err)
> + goto bail;
>
> bail:
> if (err != -ERESTARTSYS && err != -ETIMEDOUT) {
next prev parent reply other threads:[~2023-09-26 10:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-31 6:23 Ekansh Gupta
2023-09-26 10:27 ` Srinivas Kandagatla [this message]
2023-09-26 11:44 ` Ekansh Gupta
2023-09-28 13:05 ` Greg KH
2023-09-29 7:14 ` Ekansh Gupta
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=90dffe7f-02c1-4965-8d48-1d689abc9323@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=ekangupt@qti.qualcomm.com \
--cc=fastrpc.upstream@qti.qualcomm.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_ekangupt@quicinc.com \
/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
all inboxes | Powered by JetHome®