summaryrefslogtreecommitdiff
path: root/drivers/misc/tegra-profiler/main.c
diff options
context:
space:
mode:
authorIgor Nabirushkin <inabirushkin@nvidia.com>2014-12-29 12:16:30 +0400
committerWinnie Hsu <whsu@nvidia.com>2015-01-29 22:05:27 -0800
commitc017b032a284d7cb1974f7e80a6c3613089b9c0e (patch)
tree1f9d6e50d2332f315749bd5d765de1561c1d755c /drivers/misc/tegra-profiler/main.c
parent6d956bb7ac0872a090b92d4ed4c842edf3c46963 (diff)
misc: tegra-profiler: fix debug preempt warningstegra-l4t-r21.3tegra-l4t-r21-er-2015-02-02
Tegra Profiler: fix warnings with CONFIG_DEBUG_PREEMPT=y * Add the missing preempt_disable/enable() pairs in start/stop ioctls. * Untie mmap and some other samples from the current cpu. Bug 200067410 Bug 1598009 Change-Id: I9f03facf3a0ecee20432019ea8094a349c7897d1 Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com> Reviewed-on: http://git-master/r/668123 (cherry picked from commit ee3374eb9983d1ccadbf3a54c977d3e6db97ec4a) Reviewed-on: http://git-master/r/672042 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Diffstat (limited to 'drivers/misc/tegra-profiler/main.c')
-rw-r--r--drivers/misc/tegra-profiler/main.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/misc/tegra-profiler/main.c b/drivers/misc/tegra-profiler/main.c
index f0116af49035..0f1237fe57f4 100644
--- a/drivers/misc/tegra-profiler/main.c
+++ b/drivers/misc/tegra-profiler/main.c
@@ -85,6 +85,8 @@ static int start(void)
return -EBUSY;
}
+ preempt_disable();
+
if (!atomic_cmpxchg(&ctx.started, 0, 1)) {
if (ctx.pmu) {
err = ctx.pmu->enable();
@@ -117,16 +119,21 @@ static int start(void)
}
}
+ preempt_enable();
return 0;
errout:
atomic_set(&ctx.started, 0);
tegra_profiler_unlock();
+ preempt_enable();
+
return err;
}
static void stop(void)
{
+ preempt_disable();
+
if (atomic_cmpxchg(&ctx.started, 1, 0)) {
quadd_hrt_stop();
@@ -143,6 +150,8 @@ static void stop(void)
tegra_profiler_unlock();
}
+
+ preempt_enable();
}
static inline int is_event_supported(struct source_info *si, int event)
@@ -180,13 +189,7 @@ set_parameters(struct quadd_parameters *p, uid_t *debug_app_uid)
return -EINVAL;
}
- ctx.param.freq = p->freq;
- ctx.param.ma_freq = p->ma_freq;
- ctx.param.backtrace = p->backtrace;
- ctx.param.use_freq = p->use_freq;
- ctx.param.system_wide = p->system_wide;
- ctx.param.power_rate_freq = p->power_rate_freq;
- ctx.param.debug_samples = p->debug_samples;
+ ctx.param = *p;
for (i = 0; i < ARRAY_SIZE(p->reserved); i++)
ctx.param.reserved[i] = p->reserved[i];