Skip to content

Commit ff5e0c8

Browse files
quic-ekanguptgregkh
authored andcommitted
misc: fastrpc: Rename tgid and pid to client_id
The information passed as request tgid and pid is actually the client id of the process. This client id is used as an identifier by DSP to identify the DSP PD corresponding to the process. Currently process tgid is getting passed as the identifier which is getting replaced by a custom client id. Rename the data which uses this client id. Signed-off-by: Ekansh Gupta <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 37d56e0 commit ff5e0c8

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

drivers/misc/fastrpc.c

+24-24
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ struct fastrpc_mmap_rsp_msg {
139139
};
140140

141141
struct fastrpc_mmap_req_msg {
142-
s32 pgid;
142+
s32 client_id;
143143
u32 flags;
144144
u64 vaddr;
145145
s32 num;
146146
};
147147

148148
struct fastrpc_mem_map_req_msg {
149-
s32 pgid;
149+
s32 client_id;
150150
s32 fd;
151151
s32 offset;
152152
u32 flags;
@@ -156,20 +156,20 @@ struct fastrpc_mem_map_req_msg {
156156
};
157157

158158
struct fastrpc_munmap_req_msg {
159-
s32 pgid;
159+
s32 client_id;
160160
u64 vaddr;
161161
u64 size;
162162
};
163163

164164
struct fastrpc_mem_unmap_req_msg {
165-
s32 pgid;
165+
s32 client_id;
166166
s32 fd;
167167
u64 vaddrin;
168168
u64 len;
169169
};
170170

171171
struct fastrpc_msg {
172-
int pid; /* process group id */
172+
int client_id; /* process client id */
173173
int tid; /* thread id */
174174
u64 ctx; /* invoke caller context */
175175
u32 handle; /* handle to invoke */
@@ -234,7 +234,7 @@ struct fastrpc_invoke_ctx {
234234
int nbufs;
235235
int retval;
236236
int pid;
237-
int tgid;
237+
int client_id;
238238
u32 sc;
239239
u32 *crc;
240240
u64 ctxid;
@@ -614,7 +614,7 @@ static struct fastrpc_invoke_ctx *fastrpc_context_alloc(
614614
ctx->sc = sc;
615615
ctx->retval = -1;
616616
ctx->pid = current->pid;
617-
ctx->tgid = user->client_id;
617+
ctx->client_id = user->client_id;
618618
ctx->cctx = cctx;
619619
init_completion(&ctx->work);
620620
INIT_WORK(&ctx->put_work, fastrpc_context_put_wq);
@@ -1115,11 +1115,11 @@ static int fastrpc_invoke_send(struct fastrpc_session_ctx *sctx,
11151115
int ret;
11161116

11171117
cctx = fl->cctx;
1118-
msg->pid = fl->client_id;
1118+
msg->client_id = fl->client_id;
11191119
msg->tid = current->pid;
11201120

11211121
if (kernel)
1122-
msg->pid = 0;
1122+
msg->client_id = 0;
11231123

11241124
msg->ctx = ctx->ctxid | fl->pd;
11251125
msg->handle = handle;
@@ -1244,7 +1244,7 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
12441244
int err;
12451245
bool scm_done = false;
12461246
struct {
1247-
int pgid;
1247+
int client_id;
12481248
u32 namelen;
12491249
u32 pageslen;
12501250
} inbuf;
@@ -1293,7 +1293,7 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
12931293
}
12941294
}
12951295

1296-
inbuf.pgid = fl->client_id;
1296+
inbuf.client_id = fl->client_id;
12971297
inbuf.namelen = init.namelen;
12981298
inbuf.pageslen = 0;
12991299
fl->pd = USER_PD;
@@ -1363,7 +1363,7 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl,
13631363
int memlen;
13641364
int err;
13651365
struct {
1366-
int pgid;
1366+
int client_id;
13671367
u32 namelen;
13681368
u32 filelen;
13691369
u32 pageslen;
@@ -1395,7 +1395,7 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl,
13951395
goto err;
13961396
}
13971397

1398-
inbuf.pgid = fl->client_id;
1398+
inbuf.client_id = fl->client_id;
13991399
inbuf.namelen = strlen(current->comm) + 1;
14001400
inbuf.filelen = init.filelen;
14011401
inbuf.pageslen = 1;
@@ -1504,12 +1504,12 @@ static void fastrpc_session_free(struct fastrpc_channel_ctx *cctx,
15041504
static int fastrpc_release_current_dsp_process(struct fastrpc_user *fl)
15051505
{
15061506
struct fastrpc_invoke_args args[1];
1507-
int tgid = 0;
1507+
int client_id = 0;
15081508
u32 sc;
15091509

1510-
tgid = fl->client_id;
1511-
args[0].ptr = (u64)(uintptr_t) &tgid;
1512-
args[0].length = sizeof(tgid);
1510+
client_id = fl->client_id;
1511+
args[0].ptr = (u64)(uintptr_t) &client_id;
1512+
args[0].length = sizeof(client_id);
15131513
args[0].fd = -1;
15141514
sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_RELEASE, 1, 0);
15151515

@@ -1649,11 +1649,11 @@ static int fastrpc_dmabuf_alloc(struct fastrpc_user *fl, char __user *argp)
16491649
static int fastrpc_init_attach(struct fastrpc_user *fl, int pd)
16501650
{
16511651
struct fastrpc_invoke_args args[1];
1652-
int tgid = fl->client_id;
1652+
int client_id = fl->client_id;
16531653
u32 sc;
16541654

1655-
args[0].ptr = (u64)(uintptr_t) &tgid;
1656-
args[0].length = sizeof(tgid);
1655+
args[0].ptr = (u64)(uintptr_t) &client_id;
1656+
args[0].length = sizeof(client_id);
16571657
args[0].fd = -1;
16581658
sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_ATTACH, 1, 0);
16591659
fl->pd = pd;
@@ -1805,7 +1805,7 @@ static int fastrpc_req_munmap_impl(struct fastrpc_user *fl, struct fastrpc_buf *
18051805
int err;
18061806
u32 sc;
18071807

1808-
req_msg.pgid = fl->client_id;
1808+
req_msg.client_id = fl->client_id;
18091809
req_msg.size = buf->size;
18101810
req_msg.vaddr = buf->raddr;
18111811

@@ -1891,7 +1891,7 @@ static int fastrpc_req_mmap(struct fastrpc_user *fl, char __user *argp)
18911891
return err;
18921892
}
18931893

1894-
req_msg.pgid = fl->client_id;
1894+
req_msg.client_id = fl->client_id;
18951895
req_msg.flags = req.flags;
18961896
req_msg.vaddr = req.vaddrin;
18971897
req_msg.num = sizeof(pages);
@@ -1980,7 +1980,7 @@ static int fastrpc_req_mem_unmap_impl(struct fastrpc_user *fl, struct fastrpc_me
19801980
return -EINVAL;
19811981
}
19821982

1983-
req_msg.pgid = fl->client_id;
1983+
req_msg.client_id = fl->client_id;
19841984
req_msg.len = map->len;
19851985
req_msg.vaddrin = map->raddr;
19861986
req_msg.fd = map->fd;
@@ -2033,7 +2033,7 @@ static int fastrpc_req_mem_map(struct fastrpc_user *fl, char __user *argp)
20332033
return err;
20342034
}
20352035

2036-
req_msg.pgid = fl->client_id;
2036+
req_msg.client_id = fl->client_id;
20372037
req_msg.fd = req.fd;
20382038
req_msg.offset = req.offset;
20392039
req_msg.vaddrin = req.vaddrin;

0 commit comments

Comments
 (0)