From 32672afbc03e4688b444e58494aa77168b7f2147 Mon Sep 17 00:00:00 2001 From: Peter Daifuku Date: Fri, 7 Dec 2018 11:04:07 -0800 Subject: nvgpu: pmu: cleanup init thread on destroy In nvgpu_kill_task_pg_init(), call nvgpu_thread_join() if the init thread is no longer running in order to reclaim thread resources. Bug 2452799 JIRA ESRM-437 Change-Id: Id9c67f689027f00039ac2df226ee9c28ad89dd1d Signed-off-by: Peter Daifuku Reviewed-on: https://git-master.nvidia.com/r/1967983 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-misra-checker GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions Reviewed-on: https://git-master.nvidia.com/r/1970058 Reviewed-by: Shmuel Ungerfeld Reviewed-by: Automatic_Commit_Validation_User Tested-by: Shmuel Ungerfeld Reviewed-by: Rahul Jain (SW-TEGRA) --- drivers/gpu/nvgpu/common/pmu/pmu.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/gpu/nvgpu/common') diff --git a/drivers/gpu/nvgpu/common/pmu/pmu.c b/drivers/gpu/nvgpu/common/pmu/pmu.c index 9bcfa14e..f86dc2c2 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu.c @@ -171,6 +171,8 @@ void nvgpu_kill_task_pg_init(struct gk20a *g) nvgpu_udelay(2); } while (nvgpu_timeout_expired_msg(&timeout, "timeout - waiting PMU state machine thread stop") == 0); + } else { + nvgpu_thread_join(&pmu->pg_init.state_task); } } -- cgit v1.2.2