gpu: nvgpu: Address Vectorcast gap for posix queue

Update unit test for posix queue unit to cover Vectorcast gap.

Jira NVGPU-4478

Change-Id: I0d79861f173d511d25cf45051c399e3193eabdbe
Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2294146
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Petlozu Pravareshwar
2020-02-13 04:46:32 -08:00
committed by Alex Waterman
parent 566b1df08c
commit c2fbc99967
3 changed files with 21 additions and 0 deletions

View File

@@ -185,6 +185,8 @@ int test_nvgpu_queue_out(struct unit_module *m, struct gk20a *g, void *args)
struct nvgpu_queue q = {0};
struct nvgpu_mutex lock;
char buf[BUF_LEN];
struct nvgpu_posix_fault_inj *queue_out_fi =
nvgpu_queue_out_get_fault_injection();
nvgpu_mutex_init(&lock);
@@ -250,6 +252,20 @@ int test_nvgpu_queue_out(struct unit_module *m, struct gk20a *g, void *args)
goto fail;
}
/*
* Fault injection so that immediate call to nvgpu_queue_out_locked()
* API would return error.
*/
nvgpu_posix_enable_fault_injection(queue_out_fi, true, 0);
ret = nvgpu_queue_out_locked(&q, buf, BUF_LEN, &lock);
if (ret != -1) {
err = UNIT_FAIL;
nvgpu_posix_enable_fault_injection(queue_out_fi, false, 0);
unit_err(m, "%d. queue_out failed err=%d\n", __LINE__, ret);
goto fail;
}
nvgpu_posix_enable_fault_injection(queue_out_fi, false, 0);
fail:
if (q.data != NULL)
free(q.data);