gpu: nvgpu: stop nvs thread during unload

nvs worker thread is created on each resume and deinitialized on every
suspend. nvgpu can be resumed when process is getting killed. Thread
creation can fail when the process is getting killed. That will lead
to driver resume failure.

To avoid the issue above, don't stop the nvs worker thread in suspend
and let the first created thread handle the nvs work always.
Deinitialize the nvs worker thread during nvgpu unload.

Also, log the error returned by nvgpu_thread_create in the function
nvgpu_worker_start.

bug 3480192

Change-Id: I8d5d9e7716a950b162cc3c2d9fcfde07c4edfcf6
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2646218
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Sagar Kamble
2021-12-23 11:56:48 +05:30
committed by mobile promotions
parent 4fd0f11e9c
commit d424598b7b
4 changed files with 9 additions and 20 deletions

View File

@@ -339,10 +339,6 @@ int nvgpu_prepare_poweroff(struct gk20a *g)
if (tmp_ret != 0) {
ret = tmp_ret;
}
tmp_ret = nvgpu_nvs_suspend(g);
if (tmp_ret != 0) {
ret = tmp_ret;
}
tmp_ret = g->ops.fifo.fifo_suspend(g);
if (tmp_ret != 0) {
ret = tmp_ret;