Commit Graph

3 Commits

Author SHA1 Message Date
Konsta Holtta
9d2e773051 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>
2017-06-19 02:15:53 -07:00
Terje Bergstrom
a7e6a8cf51 gpu: nvgpu: Add query nvgpu_thread_is_running
Add query nvgpu_thread_is_running(). It returns true if thread has
already been started.

JIRA NVGPU-14

Change-Id: If3bed6f9ffe181703134ae1b92b0b275db364195
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1480257
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-05-24 04:55:36 -07:00
Terje Bergstrom
fc95237cf0 gpu: nvgpu: Abstract threads
Add abstraction for threads. Implement them using kthreads in Linux kernel.

JIRA NVGPU-14

Change-Id: I26996d844db6bdc4b5e6f3230514a1dadb3fb07c
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1469636
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-05-04 09:14:39 -07:00