All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ekansh Gupta <quic_ekangupt@quicinc.com>
To: <srinivas.kandagatla@linaro.org>, <linux-arm-msm@vger.kernel.org>
Cc: <gregkh@linuxfoundation.org>, <quic_bkumar@quicinc.com>,
	<linux-kernel@vger.kernel.org>, <quic_chennak@quicinc.com>,
	<dri-devel@lists.freedesktop.org>, <arnd@arndb.de>
Subject: [PATCH v1 3/4] misc: fastrpc: Modify context id calculation for poll mode
Date: Mon, 7 Oct 2024 14:15:17 +0530	[thread overview]
Message-ID: <20241007084518.3649876-4-quic_ekangupt@quicinc.com> (raw)
In-Reply-To: <20241007084518.3649876-1-quic_ekangupt@quicinc.com>

Poll mode is a feature to be introduced which improves the fastrpc
remote calls latency. For this feature, DSP expects the 4th to 7th
bit of context id to be zero. Prepare context id in such a way that
polling mode can be supported.

Signed-off-by: Ekansh Gupta <quic_ekangupt@quicinc.com>
---
 drivers/misc/fastrpc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 54a562fc94fb..c008fcd95e15 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -40,7 +40,7 @@
 #define FASTRPC_INIT_HANDLE	1
 #define FASTRPC_DSP_UTILITIES_HANDLE	2
 #define FASTRPC_MAX_STATIC_HANDLE (20)
-#define FASTRPC_CTXID_MASK (0xFF0)
+#define FASTRPC_CTXID_MASK (0xFF0000)
 #define INIT_FILELEN_MAX (2 * 1024 * 1024)
 #define INIT_FILE_NAMELEN_MAX (128)
 #define FASTRPC_DEVICE_NAME	"fastrpc"
@@ -559,7 +559,7 @@ static void fastrpc_context_free(struct kref *ref)
 		fastrpc_buf_free(ctx->buf);
 
 	spin_lock_irqsave(&cctx->lock, flags);
-	idr_remove(&cctx->ctx_idr, ctx->ctxid >> 4);
+	idr_remove(&cctx->ctx_idr, ctx->ctxid >> 16);
 	spin_unlock_irqrestore(&cctx->lock, flags);
 
 	kfree(ctx->perf);
@@ -706,7 +706,7 @@ static struct fastrpc_invoke_ctx *fastrpc_context_alloc(
 		spin_unlock_irqrestore(&cctx->lock, flags);
 		goto err_idr;
 	}
-	ctx->ctxid = ret << 4;
+	ctx->ctxid = ret << 16;
 	spin_unlock_irqrestore(&cctx->lock, flags);
 
 	kref_init(&ctx->refcount);
@@ -2621,7 +2621,7 @@ static int fastrpc_rpmsg_callback(struct rpmsg_device *rpdev, void *data,
 	if (len < sizeof(*rsp))
 		return -EINVAL;
 
-	ctxid = ((rsp->ctx & FASTRPC_CTXID_MASK) >> 4);
+	ctxid = ((rsp->ctx & FASTRPC_CTXID_MASK) >> 16);
 
 	spin_lock_irqsave(&cctx->lock, flags);
 	ctx = idr_find(&cctx->ctx_idr, ctxid);
-- 
2.34.1


  parent reply	other threads:[~2024-10-07  8:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07  8:45 [PATCH v1 0/4] Add invokeV2 to support new features Ekansh Gupta
2024-10-07  8:45 ` [PATCH v1 1/4] misc: fastrpc: Add CRC support using invokeV2 request Ekansh Gupta
2024-10-07  8:53   ` Greg KH
2024-10-10  5:25     ` Ekansh Gupta
2024-10-07 13:57   ` Dmitry Baryshkov
2025-01-23  5:46     ` Ekansh Gupta
2025-01-23  7:48       ` Dmitry Baryshkov
2025-01-23  9:49         ` Ekansh Gupta
2025-01-23 11:13           ` Dmitry Baryshkov
2025-01-23 12:04             ` Ekansh Gupta
2025-01-23 12:33               ` Dmitry Baryshkov
2025-01-24  4:19                 ` Ekansh Gupta
2024-10-08  1:41   ` kernel test robot
2024-10-08  1:41   ` kernel test robot
2024-10-08  2:32   ` kernel test robot
2024-10-08 21:21   ` kernel test robot
2024-10-07  8:45 ` [PATCH v1 2/4] misc: fastrpc: Capture kernel and DSP performance counters Ekansh Gupta
2024-10-07  9:07   ` Greg KH
2024-10-07  8:45 ` Ekansh Gupta [this message]
2024-10-07  8:45 ` [PATCH v1 4/4] misc: fastrpc: Add polling mode support for fastRPC driver Ekansh Gupta
2024-10-07 13:27 ` [PATCH v1 0/4] Add invokeV2 to support new features Dmitry Baryshkov

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=20241007084518.3649876-4-quic_ekangupt@quicinc.com \
    --to=quic_ekangupt@quicinc.com \
    --cc=arnd@arndb.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_bkumar@quicinc.com \
    --cc=quic_chennak@quicinc.com \
    --cc=srinivas.kandagatla@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.