From ccc0f39f40c8d6e369361f66633f2d6dca351bd9 Mon Sep 17 00:00:00 2001 From: Antony Clince Alex Date: Thu, 28 Feb 2019 15:37:03 +0530 Subject: [PATCH] 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 Reviewed-on: https://git-master.nvidia.com/r/2029941 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/gr/fecs_trace/fecs_trace.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/common/gr/fecs_trace/fecs_trace.c b/drivers/gpu/nvgpu/common/gr/fecs_trace/fecs_trace.c index 270eda140..1d5501627 100644 --- a/drivers/gpu/nvgpu/common/gr/fecs_trace/fecs_trace.c +++ b/drivers/gpu/nvgpu/common/gr/fecs_trace/fecs_trace.c @@ -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);