gpu: nvgpu: fix disable fecs trace

- This patch fixes disable fecs trace logic.
- If user does trace disable twice, enable_count will become
negative and when user tries to re-enable it, fecs trace
will not be enabled.

Bug 2672760

Change-Id: I895e48549970fa2faf06d5a531a423489f494cf4
Signed-off-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2171015
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Vaibhav Kachore
2019-08-21 17:10:35 +05:30
committed by mobile promotions
parent 087d4d3df4
commit abede466e3

View File

@@ -302,6 +302,11 @@ int nvgpu_gr_fecs_trace_disable(struct gk20a *g)
}
nvgpu_mutex_acquire(&trace->enable_lock);
if (trace->enable_count <= 0U) {
nvgpu_mutex_release(&trace->enable_lock);
return 0;
}
trace->enable_count--;
if (trace->enable_count == 0U) {
if (nvgpu_is_enabled(g, NVGPU_FECS_TRACE_FEATURE_CONTROL)) {