diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2017-06-13 09:15:47 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-19 05:15:53 -0400 |
commit | 9d2e7730515acf3114f7d1354277db81b5b022b0 (patch) | |
tree | e0214d6d40ac0785536c66495d7e03c2c14625a3 /drivers/gpu/nvgpu/include | |
parent | 741e5c45179db066ddf5bed0be6f36e4d0d4010e (diff) |
gpu: nvgpu: mark thread stopped when it independently quits
It's technically possible for a thread to exit without first calling
nvgpu_thread_stop() in another, so mark the thread exit status from the
thread after it has finished instead of in nvgpu_thread_stop(). Do this
by starting the thread as a proxy function which calls the actual thread
function and then sets the flag.
Also, add a new flag to actually signify the running state because the
thread->task going null abruptly would break nvgpu_thread_stop().
This does not guarantee that the kernel thread itself has stopped, but
the function which can be considered as an "nvgpu thread" will be.
Change-Id: Ib911b02bd51342ddeb8e6b9533ef7943f2606d2d
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1501571
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/linux/thread.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/thread.h b/drivers/gpu/nvgpu/include/nvgpu/linux/thread.h index 13f29515..1355319c 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/linux/thread.h +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/thread.h | |||
@@ -21,6 +21,9 @@ struct task_struct; | |||
21 | 21 | ||
22 | struct nvgpu_thread { | 22 | struct nvgpu_thread { |
23 | struct task_struct *task; | 23 | struct task_struct *task; |
24 | bool running; | ||
25 | int (*fn)(void *); | ||
26 | void *data; | ||
24 | }; | 27 | }; |
25 | 28 | ||
26 | #endif /* __NVGPU_THREAD_LINUX_H__ */ | 29 | #endif /* __NVGPU_THREAD_LINUX_H__ */ |