Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d67920f0 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ADSPRPC: Handle glink close properly"

parents a9c20686 35173342
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -367,6 +367,7 @@ struct fastrpc_file {
	int qos_request;
	int qos_request;
	struct mutex map_mutex;
	struct mutex map_mutex;
	struct mutex fl_map_mutex;
	struct mutex fl_map_mutex;
	int refcount;
};
};


static struct fastrpc_apps gfa;
static struct fastrpc_apps gfa;
@@ -2006,6 +2007,8 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
		if (!strcmp(proc_name, "audiopd")) {
		if (!strcmp(proc_name, "audiopd")) {
			fl->spdname = AUDIO_PDR_SERVICE_LOCATION_CLIENT_NAME;
			fl->spdname = AUDIO_PDR_SERVICE_LOCATION_CLIENT_NAME;
			VERIFY(err, !fastrpc_mmap_remove_pdr(fl));
			VERIFY(err, !fastrpc_mmap_remove_pdr(fl));
			if (err)
				goto bail;
		}
		}


		if (!me->staticpd_flags) {
		if (!me->staticpd_flags) {
@@ -2605,7 +2608,7 @@ static int fastrpc_file_free(struct fastrpc_file *fl)
		fastrpc_mmap_free(map, 1);
		fastrpc_mmap_free(map, 1);
	}
	}
	mutex_unlock(&fl->fl_map_mutex);
	mutex_unlock(&fl->fl_map_mutex);
	if (fl->ssrcount == fl->apps->channel[cid].ssrcount)
	if (fl->refcount && (fl->ssrcount == fl->apps->channel[cid].ssrcount))
		kref_put_mutex(&fl->apps->channel[cid].kref,
		kref_put_mutex(&fl->apps->channel[cid].kref,
				fastrpc_channel_close, &fl->apps->smd_mutex);
				fastrpc_channel_close, &fl->apps->smd_mutex);
	if (fl->sctx)
	if (fl->sctx)
@@ -2898,6 +2901,7 @@ static int fastrpc_channel_open(struct fastrpc_file *fl)
		}
		}
	}
	}
	fl->ssrcount = me->channel[cid].ssrcount;
	fl->ssrcount = me->channel[cid].ssrcount;
	fl->refcount = 1;
	if ((kref_get_unless_zero(&me->channel[cid].kref) == 0) ||
	if ((kref_get_unless_zero(&me->channel[cid].kref) == 0) ||
	    (me->channel[cid].chan == NULL)) {
	    (me->channel[cid].chan == NULL)) {
		if (me->glink) {
		if (me->glink) {
@@ -2971,6 +2975,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp)
	if (debugfs_file != NULL)
	if (debugfs_file != NULL)
		fl->debugfs_file = debugfs_file;
		fl->debugfs_file = debugfs_file;
	fl->qos_request = 0;
	fl->qos_request = 0;
	fl->refcount = 0;
	filp->private_data = fl;
	filp->private_data = fl;
	mutex_init(&fl->map_mutex);
	mutex_init(&fl->map_mutex);
	mutex_init(&fl->fl_map_mutex);
	mutex_init(&fl->fl_map_mutex);