gpu: nvgpu: unit: improve gv11b tsg coverage

test_gv11b_tsg_bind_channel_eng_method_buffers was missing
in the list of tests for the module.

Added the test, and fixed couple issues:
- wrong test on gpu_va in valid case.
- NULL pointer assignment during test setup, when
  tsg->eng_method_buffers is NULL.

Jira NVGPU-4673

Change-Id: I2478425f0380540e8295325ffd3df672dc5d9fd0
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2276068
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Thomas Fleury
2020-01-08 16:00:44 -05:00
committed by Alex Waterman
parent a252ab1b0d
commit 0836f31c47
2 changed files with 12 additions and 4 deletions

View File

@@ -3365,6 +3365,12 @@
"unit": "nvgpu_tsg",
"test_level": 0
},
{
"test": "test_gv11b_tsg_bind_channel_eng_method_buffers",
"case": "gv11b_tsg_bind_channel_eng_method_buffers",
"unit": "nvgpu_tsg_gv11b",
"test_level": 0
},
{
"test": "test_gv11b_tsg_init_eng_method_buffers",
"case": "gv11b_tsg_init_eng_method_buffers",

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -238,10 +238,10 @@ int test_gv11b_tsg_bind_channel_eng_method_buffers(struct unit_module *m,
if (branches & F_TSG_BIND_BUF_FAST_CE_RUNLIST_ID) {
tsg->runlist_id = nvgpu_engine_get_fast_ce_runlist_id(g);
gpu_va = tsg->eng_method_buffers[ASYNC_CE_RUNQUE].gpu_va;
gpu_va = eng_method_buffers[ASYNC_CE_RUNQUE].gpu_va;
} else {
tsg->runlist_id = nvgpu_engine_get_gr_runlist_id(g);
gpu_va = tsg->eng_method_buffers[GR_RUNQUE].gpu_va;
gpu_va = eng_method_buffers[GR_RUNQUE].gpu_va;
}
nvgpu_mem_wr32(g, &ch->inst_block,
@@ -259,7 +259,7 @@ int test_gv11b_tsg_bind_channel_eng_method_buffers(struct unit_module *m,
} else {
assert(nvgpu_mem_rd32(g, &ch->inst_block,
ram_in_eng_method_buffer_addr_lo_w()) !=
ram_in_eng_method_buffer_addr_lo_w()) ==
u64_lo32(gpu_va));
assert(nvgpu_mem_rd32(g, &ch->inst_block,
ram_in_eng_method_buffer_addr_hi_w()) ==
@@ -378,6 +378,8 @@ struct unit_module_test nvgpu_tsg_gv11b_tests[] = {
UNIT_TEST(init_support, test_fifo_init_support, &unit_ctx, 0),
UNIT_TEST(gv11b_tsg_init_eng_method_buffers, \
test_gv11b_tsg_init_eng_method_buffers, &unit_ctx, 0),
UNIT_TEST(gv11b_tsg_bind_channel_eng_method_buffers,
test_gv11b_tsg_bind_channel_eng_method_buffers, &unit_ctx, 0),
UNIT_TEST(gv11b_tsg_unbind_channel_check_eng_faulted, \
test_gv11b_tsg_unbind_channel_check_eng_faulted, &unit_ctx, 0),
UNIT_TEST(remove_support, test_fifo_remove_support, &unit_ctx, 0),