gpu: nvgpu: add fecs trace enable check in deinit path

FECS trace deinit routine was not checking if tracer was enabled
when attempting to stop the tracer thread. This causes thead stop to
fail when trace is not running.

Jira NVGPU-2801

Change-Id: I09f5eb3c4f498434e6e30394ee675e7745cfde5d
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2029941
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Antony Clince Alex
2019-02-28 15:37:03 +05:30
committed by mobile promotions
parent d02c558aa4
commit ccc0f39f40

View File

@@ -183,7 +183,13 @@ int nvgpu_gr_fecs_trace_deinit(struct gk20a *g)
{
struct nvgpu_gr_fecs_trace *trace = g->fecs_trace;
nvgpu_thread_stop(&trace->poll_task);
/*
* Check if tracer was enabled before attempting to stop the
* tracer thread.
*/
if (trace->enable_count > 0) {
nvgpu_thread_stop(&trace->poll_task);
}
nvgpu_gr_fecs_trace_remove_contexts(g, &trace->context_list);