mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-28 16:52:18 +00:00
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/srini/fastrpc.git
This commit is contained in:
commit
be0592e86c
@ -139,14 +139,14 @@ struct fastrpc_mmap_rsp_msg {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct fastrpc_mmap_req_msg {
|
struct fastrpc_mmap_req_msg {
|
||||||
s32 pgid;
|
s32 client_id;
|
||||||
u32 flags;
|
u32 flags;
|
||||||
u64 vaddr;
|
u64 vaddr;
|
||||||
s32 num;
|
s32 num;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fastrpc_mem_map_req_msg {
|
struct fastrpc_mem_map_req_msg {
|
||||||
s32 pgid;
|
s32 client_id;
|
||||||
s32 fd;
|
s32 fd;
|
||||||
s32 offset;
|
s32 offset;
|
||||||
u32 flags;
|
u32 flags;
|
||||||
@ -156,20 +156,20 @@ struct fastrpc_mem_map_req_msg {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct fastrpc_munmap_req_msg {
|
struct fastrpc_munmap_req_msg {
|
||||||
s32 pgid;
|
s32 client_id;
|
||||||
u64 vaddr;
|
u64 vaddr;
|
||||||
u64 size;
|
u64 size;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fastrpc_mem_unmap_req_msg {
|
struct fastrpc_mem_unmap_req_msg {
|
||||||
s32 pgid;
|
s32 client_id;
|
||||||
s32 fd;
|
s32 fd;
|
||||||
u64 vaddrin;
|
u64 vaddrin;
|
||||||
u64 len;
|
u64 len;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fastrpc_msg {
|
struct fastrpc_msg {
|
||||||
int pid; /* process group id */
|
int client_id; /* process client id */
|
||||||
int tid; /* thread id */
|
int tid; /* thread id */
|
||||||
u64 ctx; /* invoke caller context */
|
u64 ctx; /* invoke caller context */
|
||||||
u32 handle; /* handle to invoke */
|
u32 handle; /* handle to invoke */
|
||||||
@ -234,7 +234,7 @@ struct fastrpc_invoke_ctx {
|
|||||||
int nbufs;
|
int nbufs;
|
||||||
int retval;
|
int retval;
|
||||||
int pid;
|
int pid;
|
||||||
int tgid;
|
int client_id;
|
||||||
u32 sc;
|
u32 sc;
|
||||||
u32 *crc;
|
u32 *crc;
|
||||||
u64 ctxid;
|
u64 ctxid;
|
||||||
@ -299,7 +299,7 @@ struct fastrpc_user {
|
|||||||
struct fastrpc_session_ctx *sctx;
|
struct fastrpc_session_ctx *sctx;
|
||||||
struct fastrpc_buf *init_mem;
|
struct fastrpc_buf *init_mem;
|
||||||
|
|
||||||
int tgid;
|
int client_id;
|
||||||
int pd;
|
int pd;
|
||||||
bool is_secure_dev;
|
bool is_secure_dev;
|
||||||
/* Lock for lists */
|
/* Lock for lists */
|
||||||
@ -614,7 +614,7 @@ static struct fastrpc_invoke_ctx *fastrpc_context_alloc(
|
|||||||
ctx->sc = sc;
|
ctx->sc = sc;
|
||||||
ctx->retval = -1;
|
ctx->retval = -1;
|
||||||
ctx->pid = current->pid;
|
ctx->pid = current->pid;
|
||||||
ctx->tgid = user->tgid;
|
ctx->client_id = user->client_id;
|
||||||
ctx->cctx = cctx;
|
ctx->cctx = cctx;
|
||||||
init_completion(&ctx->work);
|
init_completion(&ctx->work);
|
||||||
INIT_WORK(&ctx->put_work, fastrpc_context_put_wq);
|
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;
|
int ret;
|
||||||
|
|
||||||
cctx = fl->cctx;
|
cctx = fl->cctx;
|
||||||
msg->pid = fl->tgid;
|
msg->client_id = fl->client_id;
|
||||||
msg->tid = current->pid;
|
msg->tid = current->pid;
|
||||||
|
|
||||||
if (kernel)
|
if (kernel)
|
||||||
msg->pid = 0;
|
msg->client_id = 0;
|
||||||
|
|
||||||
msg->ctx = ctx->ctxid | fl->pd;
|
msg->ctx = ctx->ctxid | fl->pd;
|
||||||
msg->handle = handle;
|
msg->handle = handle;
|
||||||
@ -1244,7 +1244,7 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
|
|||||||
int err;
|
int err;
|
||||||
bool scm_done = false;
|
bool scm_done = false;
|
||||||
struct {
|
struct {
|
||||||
int pgid;
|
int client_id;
|
||||||
u32 namelen;
|
u32 namelen;
|
||||||
u32 pageslen;
|
u32 pageslen;
|
||||||
} inbuf;
|
} inbuf;
|
||||||
@ -1293,7 +1293,7 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inbuf.pgid = fl->tgid;
|
inbuf.client_id = fl->client_id;
|
||||||
inbuf.namelen = init.namelen;
|
inbuf.namelen = init.namelen;
|
||||||
inbuf.pageslen = 0;
|
inbuf.pageslen = 0;
|
||||||
fl->pd = USER_PD;
|
fl->pd = USER_PD;
|
||||||
@ -1363,7 +1363,7 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl,
|
|||||||
int memlen;
|
int memlen;
|
||||||
int err;
|
int err;
|
||||||
struct {
|
struct {
|
||||||
int pgid;
|
int client_id;
|
||||||
u32 namelen;
|
u32 namelen;
|
||||||
u32 filelen;
|
u32 filelen;
|
||||||
u32 pageslen;
|
u32 pageslen;
|
||||||
@ -1395,7 +1395,7 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl,
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
inbuf.pgid = fl->tgid;
|
inbuf.client_id = fl->client_id;
|
||||||
inbuf.namelen = strlen(current->comm) + 1;
|
inbuf.namelen = strlen(current->comm) + 1;
|
||||||
inbuf.filelen = init.filelen;
|
inbuf.filelen = init.filelen;
|
||||||
inbuf.pageslen = 1;
|
inbuf.pageslen = 1;
|
||||||
@ -1469,8 +1469,9 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct fastrpc_session_ctx *fastrpc_session_alloc(
|
static struct fastrpc_session_ctx *fastrpc_session_alloc(
|
||||||
struct fastrpc_channel_ctx *cctx)
|
struct fastrpc_user *fl)
|
||||||
{
|
{
|
||||||
|
struct fastrpc_channel_ctx *cctx = fl->cctx;
|
||||||
struct fastrpc_session_ctx *session = NULL;
|
struct fastrpc_session_ctx *session = NULL;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int i;
|
int i;
|
||||||
@ -1480,6 +1481,8 @@ static struct fastrpc_session_ctx *fastrpc_session_alloc(
|
|||||||
if (!cctx->session[i].used && cctx->session[i].valid) {
|
if (!cctx->session[i].used && cctx->session[i].valid) {
|
||||||
cctx->session[i].used = true;
|
cctx->session[i].used = true;
|
||||||
session = &cctx->session[i];
|
session = &cctx->session[i];
|
||||||
|
/* any non-zero ID will work, session_idx + 1 is the simplest one */
|
||||||
|
fl->client_id = i + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1501,12 +1504,12 @@ static void fastrpc_session_free(struct fastrpc_channel_ctx *cctx,
|
|||||||
static int fastrpc_release_current_dsp_process(struct fastrpc_user *fl)
|
static int fastrpc_release_current_dsp_process(struct fastrpc_user *fl)
|
||||||
{
|
{
|
||||||
struct fastrpc_invoke_args args[1];
|
struct fastrpc_invoke_args args[1];
|
||||||
int tgid = 0;
|
int client_id = 0;
|
||||||
u32 sc;
|
u32 sc;
|
||||||
|
|
||||||
tgid = fl->tgid;
|
client_id = fl->client_id;
|
||||||
args[0].ptr = (u64)(uintptr_t) &tgid;
|
args[0].ptr = (u64)(uintptr_t) &client_id;
|
||||||
args[0].length = sizeof(tgid);
|
args[0].length = sizeof(client_id);
|
||||||
args[0].fd = -1;
|
args[0].fd = -1;
|
||||||
sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_RELEASE, 1, 0);
|
sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_RELEASE, 1, 0);
|
||||||
|
|
||||||
@ -1579,11 +1582,10 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp)
|
|||||||
INIT_LIST_HEAD(&fl->maps);
|
INIT_LIST_HEAD(&fl->maps);
|
||||||
INIT_LIST_HEAD(&fl->mmaps);
|
INIT_LIST_HEAD(&fl->mmaps);
|
||||||
INIT_LIST_HEAD(&fl->user);
|
INIT_LIST_HEAD(&fl->user);
|
||||||
fl->tgid = current->tgid;
|
|
||||||
fl->cctx = cctx;
|
fl->cctx = cctx;
|
||||||
fl->is_secure_dev = fdevice->secure;
|
fl->is_secure_dev = fdevice->secure;
|
||||||
|
|
||||||
fl->sctx = fastrpc_session_alloc(cctx);
|
fl->sctx = fastrpc_session_alloc(fl);
|
||||||
if (!fl->sctx) {
|
if (!fl->sctx) {
|
||||||
dev_err(&cctx->rpdev->dev, "No session available\n");
|
dev_err(&cctx->rpdev->dev, "No session available\n");
|
||||||
mutex_destroy(&fl->mutex);
|
mutex_destroy(&fl->mutex);
|
||||||
@ -1647,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)
|
static int fastrpc_init_attach(struct fastrpc_user *fl, int pd)
|
||||||
{
|
{
|
||||||
struct fastrpc_invoke_args args[1];
|
struct fastrpc_invoke_args args[1];
|
||||||
int tgid = fl->tgid;
|
int client_id = fl->client_id;
|
||||||
u32 sc;
|
u32 sc;
|
||||||
|
|
||||||
args[0].ptr = (u64)(uintptr_t) &tgid;
|
args[0].ptr = (u64)(uintptr_t) &client_id;
|
||||||
args[0].length = sizeof(tgid);
|
args[0].length = sizeof(client_id);
|
||||||
args[0].fd = -1;
|
args[0].fd = -1;
|
||||||
sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_ATTACH, 1, 0);
|
sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_ATTACH, 1, 0);
|
||||||
fl->pd = pd;
|
fl->pd = pd;
|
||||||
@ -1803,7 +1805,7 @@ static int fastrpc_req_munmap_impl(struct fastrpc_user *fl, struct fastrpc_buf *
|
|||||||
int err;
|
int err;
|
||||||
u32 sc;
|
u32 sc;
|
||||||
|
|
||||||
req_msg.pgid = fl->tgid;
|
req_msg.client_id = fl->client_id;
|
||||||
req_msg.size = buf->size;
|
req_msg.size = buf->size;
|
||||||
req_msg.vaddr = buf->raddr;
|
req_msg.vaddr = buf->raddr;
|
||||||
|
|
||||||
@ -1889,7 +1891,7 @@ static int fastrpc_req_mmap(struct fastrpc_user *fl, char __user *argp)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
req_msg.pgid = fl->tgid;
|
req_msg.client_id = fl->client_id;
|
||||||
req_msg.flags = req.flags;
|
req_msg.flags = req.flags;
|
||||||
req_msg.vaddr = req.vaddrin;
|
req_msg.vaddr = req.vaddrin;
|
||||||
req_msg.num = sizeof(pages);
|
req_msg.num = sizeof(pages);
|
||||||
@ -1978,7 +1980,7 @@ static int fastrpc_req_mem_unmap_impl(struct fastrpc_user *fl, struct fastrpc_me
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
req_msg.pgid = fl->tgid;
|
req_msg.client_id = fl->client_id;
|
||||||
req_msg.len = map->len;
|
req_msg.len = map->len;
|
||||||
req_msg.vaddrin = map->raddr;
|
req_msg.vaddrin = map->raddr;
|
||||||
req_msg.fd = map->fd;
|
req_msg.fd = map->fd;
|
||||||
@ -2031,7 +2033,7 @@ static int fastrpc_req_mem_map(struct fastrpc_user *fl, char __user *argp)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
req_msg.pgid = fl->tgid;
|
req_msg.client_id = fl->client_id;
|
||||||
req_msg.fd = req.fd;
|
req_msg.fd = req.fd;
|
||||||
req_msg.offset = req.offset;
|
req_msg.offset = req.offset;
|
||||||
req_msg.vaddrin = req.vaddrin;
|
req_msg.vaddrin = req.vaddrin;
|
||||||
|
Loading…
Reference in New Issue
Block a user