From https://gitlab.postmarketos.org/soc/qualcomm-sm8250/linux/-/commits/6.17.0?ref_type=HEADS Made some modifications to be compatible with the latest kernel. Signed-off-by: CodeChenL <2540735020@qq.com>
198 lines
5.1 KiB
Diff
198 lines
5.1 KiB
Diff
From 823d2e7549cf3aa559d3995d2d315479699a08ae Mon Sep 17 00:00:00 2001
|
|
From: Jianhua Lu <lujianhua000@gmail.com>
|
|
Date: Tue, 11 Nov 2025 21:46:53 +0800
|
|
Subject: [PATCH 61/62] Revert "misc: fastrpc: Rename tgid and pid to
|
|
client_id"
|
|
|
|
This reverts commit ff5e0c847042bdde7efd550c722c614ad57715b3.
|
|
|
|
Signed-off-by: Jiali Chen <chenjiali@radxa.com>
|
|
---
|
|
drivers/misc/fastrpc.c | 48 +++++++++++++++++++++---------------------
|
|
1 file changed, 24 insertions(+), 24 deletions(-)
|
|
|
|
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
|
|
index 53e88a1bc430..cf00fd704086 100644
|
|
--- a/drivers/misc/fastrpc.c
|
|
+++ b/drivers/misc/fastrpc.c
|
|
@@ -139,14 +139,14 @@ struct fastrpc_mmap_rsp_msg {
|
|
};
|
|
|
|
struct fastrpc_mmap_req_msg {
|
|
- s32 client_id;
|
|
+ s32 pgid;
|
|
u32 flags;
|
|
u64 vaddr;
|
|
s32 num;
|
|
};
|
|
|
|
struct fastrpc_mem_map_req_msg {
|
|
- s32 client_id;
|
|
+ s32 pgid;
|
|
s32 fd;
|
|
s32 offset;
|
|
u32 flags;
|
|
@@ -156,20 +156,20 @@ struct fastrpc_mem_map_req_msg {
|
|
};
|
|
|
|
struct fastrpc_munmap_req_msg {
|
|
- s32 client_id;
|
|
+ s32 pgid;
|
|
u64 vaddr;
|
|
u64 size;
|
|
};
|
|
|
|
struct fastrpc_mem_unmap_req_msg {
|
|
- s32 client_id;
|
|
+ s32 pgid;
|
|
s32 fd;
|
|
u64 vaddrin;
|
|
u64 len;
|
|
};
|
|
|
|
struct fastrpc_msg {
|
|
- int client_id; /* process client id */
|
|
+ int pid; /* process group id */
|
|
int tid; /* thread id */
|
|
u64 ctx; /* invoke caller context */
|
|
u32 handle; /* handle to invoke */
|
|
@@ -234,7 +234,7 @@ struct fastrpc_invoke_ctx {
|
|
int nbufs;
|
|
int retval;
|
|
int pid;
|
|
- int client_id;
|
|
+ int tgid;
|
|
u32 sc;
|
|
u32 *crc;
|
|
u64 ctxid;
|
|
@@ -614,7 +614,7 @@ static struct fastrpc_invoke_ctx *fastrpc_context_alloc(
|
|
ctx->sc = sc;
|
|
ctx->retval = -1;
|
|
ctx->pid = current->pid;
|
|
- ctx->client_id = user->client_id;
|
|
+ ctx->tgid = user->client_id;
|
|
ctx->cctx = cctx;
|
|
init_completion(&ctx->work);
|
|
INIT_WORK(&ctx->put_work, fastrpc_context_put_wq);
|
|
@@ -1115,11 +1115,11 @@ static int fastrpc_invoke_send(struct fastrpc_session_ctx *sctx,
|
|
int ret;
|
|
|
|
cctx = fl->cctx;
|
|
- msg->client_id = fl->client_id;
|
|
+ msg->pid = fl->client_id;
|
|
msg->tid = current->pid;
|
|
|
|
if (kernel)
|
|
- msg->client_id = 0;
|
|
+ msg->pid = 0;
|
|
|
|
msg->ctx = ctx->ctxid | fl->pd;
|
|
msg->handle = handle;
|
|
@@ -1244,7 +1244,7 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
|
|
int err;
|
|
bool scm_done = false;
|
|
struct {
|
|
- int client_id;
|
|
+ int pgid;
|
|
u32 namelen;
|
|
u32 pageslen;
|
|
} inbuf;
|
|
@@ -1293,7 +1293,7 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
|
|
}
|
|
}
|
|
|
|
- inbuf.client_id = fl->client_id;
|
|
+ inbuf.pgid = fl->client_id;
|
|
inbuf.namelen = init.namelen;
|
|
inbuf.pageslen = 0;
|
|
fl->pd = USER_PD;
|
|
@@ -1363,7 +1363,7 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl,
|
|
int memlen;
|
|
int err;
|
|
struct {
|
|
- int client_id;
|
|
+ int pgid;
|
|
u32 namelen;
|
|
u32 filelen;
|
|
u32 pageslen;
|
|
@@ -1395,7 +1395,7 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl,
|
|
goto err;
|
|
}
|
|
|
|
- inbuf.client_id = fl->client_id;
|
|
+ inbuf.pgid = fl->client_id;
|
|
inbuf.namelen = strlen(current->comm) + 1;
|
|
inbuf.filelen = init.filelen;
|
|
inbuf.pageslen = 1;
|
|
@@ -1504,12 +1504,12 @@ static void fastrpc_session_free(struct fastrpc_channel_ctx *cctx,
|
|
static int fastrpc_release_current_dsp_process(struct fastrpc_user *fl)
|
|
{
|
|
struct fastrpc_invoke_args args[1];
|
|
- int client_id = 0;
|
|
+ int tgid = 0;
|
|
u32 sc;
|
|
|
|
- client_id = fl->client_id;
|
|
- args[0].ptr = (u64)(uintptr_t) &client_id;
|
|
- args[0].length = sizeof(client_id);
|
|
+ tgid = fl->client_id;
|
|
+ args[0].ptr = (u64)(uintptr_t) &tgid;
|
|
+ args[0].length = sizeof(tgid);
|
|
args[0].fd = -1;
|
|
sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_RELEASE, 1, 0);
|
|
|
|
@@ -1649,11 +1649,11 @@ static int fastrpc_dmabuf_alloc(struct fastrpc_user *fl, char __user *argp)
|
|
static int fastrpc_init_attach(struct fastrpc_user *fl, int pd)
|
|
{
|
|
struct fastrpc_invoke_args args[1];
|
|
- int client_id = fl->client_id;
|
|
+ int tgid = fl->client_id;
|
|
u32 sc;
|
|
|
|
- args[0].ptr = (u64)(uintptr_t) &client_id;
|
|
- args[0].length = sizeof(client_id);
|
|
+ args[0].ptr = (u64)(uintptr_t) &tgid;
|
|
+ args[0].length = sizeof(tgid);
|
|
args[0].fd = -1;
|
|
sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_ATTACH, 1, 0);
|
|
fl->pd = pd;
|
|
@@ -1805,7 +1805,7 @@ static int fastrpc_req_munmap_impl(struct fastrpc_user *fl, struct fastrpc_buf *
|
|
int err;
|
|
u32 sc;
|
|
|
|
- req_msg.client_id = fl->client_id;
|
|
+ req_msg.pgid = fl->client_id;
|
|
req_msg.size = buf->size;
|
|
req_msg.vaddr = buf->raddr;
|
|
|
|
@@ -1891,7 +1891,7 @@ static int fastrpc_req_mmap(struct fastrpc_user *fl, char __user *argp)
|
|
return err;
|
|
}
|
|
|
|
- req_msg.client_id = fl->client_id;
|
|
+ req_msg.pgid = fl->client_id;
|
|
req_msg.flags = req.flags;
|
|
req_msg.vaddr = req.vaddrin;
|
|
req_msg.num = sizeof(pages);
|
|
@@ -1980,7 +1980,7 @@ static int fastrpc_req_mem_unmap_impl(struct fastrpc_user *fl, struct fastrpc_me
|
|
return -EINVAL;
|
|
}
|
|
|
|
- req_msg.client_id = fl->client_id;
|
|
+ req_msg.pgid = fl->client_id;
|
|
req_msg.len = map->len;
|
|
req_msg.vaddrin = map->raddr;
|
|
req_msg.fd = map->fd;
|
|
@@ -2033,7 +2033,7 @@ static int fastrpc_req_mem_map(struct fastrpc_user *fl, char __user *argp)
|
|
return err;
|
|
}
|
|
|
|
- req_msg.client_id = fl->client_id;
|
|
+ req_msg.pgid = fl->client_id;
|
|
req_msg.fd = req.fd;
|
|
req_msg.offset = req.offset;
|
|
req_msg.vaddrin = req.vaddrin;
|
|
--
|
|
2.47.3
|
|
|