gpu: nvgpu: tear down TSG on unbind HAL failure

Currently nvgpu_tsg_unbind ignores return code from
g->ops.tsg.unbind_channel. For consistency, tear down
TSG in case an error occurs in the unbind HAL.

Also make sure to restore valid ops for fifo.preempt_tsg
in test_gr_setup_free_obj_ctx, to avoid unbind failure.

Jira NVGPU-4387

Change-Id: I27a9c0daa365d05684149fc4bb17874d60ae1fde
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2248159
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: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Thomas Fleury
2019-11-26 11:28:11 -05:00
committed by Alex Waterman
parent 1865b2804b
commit 1fc9a427e0
2 changed files with 34 additions and 17 deletions

View File

@@ -602,13 +602,13 @@ int test_gr_setup_free_obj_ctx(struct unit_module *m,
{
int err = 0;
/* Restore valid ops for negative tests */
gr_setup_restore_valid_ops(g);
err = gr_test_setup_unbind_tsg(m, g);
gr_test_setup_cleanup_ch_tsg(m, g);
/* Restore valid ops for negative tests */
gr_setup_restore_valid_ops(g);
return (err == 0) ? UNIT_SUCCESS: UNIT_FAIL;
}