summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-07-19 09:10:28 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-07-19 09:10:27 -0700
commit8ee12d5cb219a0eaf954e97572ed02cee2fbeac8 (patch)
treed1c172957cfac65c301a5facef157f490afa513d /drivers
parent42029fbe8c7a723a405bc9772a7f545046280a53 (diff)
parent86ad5044c39b2bb0d3b9cdf28f8b48a88922738f (diff)
Merge "msm: ADSPRPC: avoid sending new requests to dsp while device_release"
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/adsprpc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c
index a84172106e0f..7a4b52913a19 100644
--- a/drivers/char/adsprpc.c
+++ b/drivers/char/adsprpc.c
@@ -291,6 +291,7 @@ struct fastrpc_file {
int cid;
int ssrcount;
int pd;
+ int file_close;
struct fastrpc_apps *apps;
struct fastrpc_perf perf;
struct dentry *debugfs_file;
@@ -2195,6 +2196,9 @@ static int fastrpc_file_free(struct fastrpc_file *fl)
return 0;
}
(void)fastrpc_release_current_dsp_process(fl);
+ spin_lock(&fl->hlock);
+ fl->file_close = 1;
+ spin_unlock(&fl->hlock);
fastrpc_context_list_dtor(fl);
fastrpc_buf_list_free(fl);
hlist_for_each_entry_safe(map, n, &fl->maps, hn) {
@@ -2583,6 +2587,14 @@ static long fastrpc_device_ioctl(struct file *file, unsigned int ioctl_num,
p.inv.fds = 0;
p.inv.attrs = 0;
+ spin_lock(&fl->hlock);
+ if (fl->file_close == 1) {
+ err = EBADF;
+ pr_warn("ADSPRPC: fastrpc_device_release is happening, So not sending any new requests to DSP");
+ spin_unlock(&fl->hlock);
+ goto bail;
+ }
+ spin_unlock(&fl->hlock);
switch (ioctl_num) {
case FASTRPC_IOCTL_INVOKE: