mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
gpu: nvgpu: unit: init: add coverage in quiesce
This adds an additional test for where the cond init fails which was not previously covered. JIRA NVGPU-4818 Change-Id: I61f9808b3b438bacce6e41a7d1f84a3206837a8e Signed-off-by: Philip Elcan <pelcan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2275222 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
9160bd29c3
commit
50f3a94317
@@ -708,6 +708,8 @@ int test_quiesce(struct unit_module *m, struct gk20a *g, void *args)
|
||||
int ret = UNIT_SUCCESS;
|
||||
struct nvgpu_posix_fault_inj *thread_fi =
|
||||
nvgpu_thread_get_fault_injection();
|
||||
struct nvgpu_posix_fault_inj *cond_fi =
|
||||
nvgpu_cond_get_fault_injection();
|
||||
int err;
|
||||
unsigned long *save_enabled_ptr;
|
||||
|
||||
@@ -791,9 +793,18 @@ int test_quiesce(struct unit_module *m, struct gk20a *g, void *args)
|
||||
nvgpu_thread_join(&g->sw_quiesce_thread);
|
||||
nvgpu_set_power_state(g, NVGPU_STATE_POWERED_ON);
|
||||
|
||||
/* coverage for thread creation failing when creating thread */
|
||||
/* coverage for cond init failing */
|
||||
nvgpu_sw_quiesce_remove_support(g);
|
||||
set_poweron_funcs_success(g);
|
||||
nvgpu_posix_enable_fault_injection(cond_fi, true, 0);
|
||||
err = nvgpu_finalize_poweron(g);
|
||||
if (err == 0) {
|
||||
unit_return_fail(m, "failed to detect cond init error\n");
|
||||
}
|
||||
nvgpu_posix_enable_fault_injection(cond_fi, false, 0);
|
||||
|
||||
/* coverage for thread creation failing when creating thread */
|
||||
/* Note: quiesce is disabled from cond test above */
|
||||
nvgpu_posix_enable_fault_injection(thread_fi, true, 0);
|
||||
err = nvgpu_finalize_poweron(g);
|
||||
if (err == 0) {
|
||||
|
||||
Reference in New Issue
Block a user