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

Commit 008d58f0 authored by Jaiju Yesudasan's avatar Jaiju Yesudasan Committed by Jaiju Yesudasan
Browse files

profiler: Add referance count for profiler's STOP command



Add referance count for profiler stop command This will handle
back to back calling of stop tz service from userspace.

Change-Id: Iaf3d65adc724673491f6fcbe67aab8e20adccae1
Signed-off-by: default avatarJaiju Yesudasan <cjaijuy@codeaurora.org>
parent becfd28d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@

static struct class *driver_class;
static dev_t profiler_device_no;
static int stop_done = 1;

struct profiler_control {

@@ -212,6 +213,10 @@ static int bw_profiling_stop(struct tz_bw_svc_buf *bwbuf)
{
	struct tz_bw_svc_stop_req *bwstopreq = NULL;

	if (stop_done) {
		stop_done--;
		return 0;
	}
	bwstopreq = (struct tz_bw_svc_stop_req *) &bwbuf->bwreq;
	/* Populate request data */
	bwstopreq->cmd_id = TZ_BW_SVC_STOP_ID;
@@ -253,6 +258,7 @@ static int profiler_get_bw_info(void __user *argp)
		ret = bw_profiling_stop(bwbuf);
		if (ret)
			pr_err("bw_profiling_stop Failed with ret: %d\n", ret);
		stop_done++;
		break;
	}
	default: