gpu: nvgpu: unit: remove gv11b_channel_debug_dump test

dump_channel hal is moved to common code.
Remove the test_gv11b_channel_debug_dump

Jira NVGPU-5109

Signed-off-by: vinodg <vinodg@nvidia.com>
Change-Id: If04314c09d9f7f0c789752a8a003e012a629d9be
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2323553
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
vinodg
2020-04-03 15:48:09 -07:00
committed by Alex Waterman
parent 340ea241cb
commit 9d577b8d9a
5 changed files with 0 additions and 122 deletions

View File

@@ -224,99 +224,12 @@ done:
return ret;
}
#define F_CHANNEL_DUMP_DETERMINISTIC BIT(0)
#define F_CHANNEL_DUMP_ENABLED BIT(1)
#define F_CHANNEL_DUMP_BUSY BIT(2)
#define F_CHANNEL_DUMP_SEMA BIT(3)
#define F_CHANNEL_DUMP_LAST BIT(4)
static const char *f_channel_dump[] = {
"deterministic",
"enabled",
"busy",
"sema",
};
static void test_debug_out(void *ctx, const char *str, size_t len)
{
struct unit_ctx *unit_ctx = ctx;
unit_ctx->count++;
if (len >= unit_ctx->size || strlen(str) > len) {
unit_ctx->err++;
unit_err(unit_ctx->m, "** oversize string" );
} else {
unit_verbose(unit_ctx->m, "%s", str);
}
}
int test_gv11b_channel_debug_dump(struct unit_module *m,
struct gk20a *g, void *args)
{
bool privileged = false;
u32 runlist_id = NVGPU_INVALID_RUNLIST_ID;
struct nvgpu_channel *ch;
int ret = UNIT_FAIL;
u32 branches;
struct unit_ctx unit_ctx;
struct nvgpu_debug_context o;
o.fn = test_debug_out;
o.ctx = &unit_ctx;
unit_ctx.m = m;
unit_ctx.size = sizeof(o.buf);
ch = nvgpu_channel_open_new(g, runlist_id,
privileged, getpid(), getpid());
unit_assert(ch, goto done);
for (branches = 0U; branches < F_CHANNEL_DUMP_LAST; branches++) {
struct nvgpu_channel_dump_info _info, *info = &_info;
unit_verbose(m, "%s branches=%s\n",
__func__, branches_str(branches, f_channel_dump));
memset(info, 0, sizeof(*info));
info->chid = ch->chid;
info->tsgid = ch->tsgid;
info->pid = ch->pid;
info->refs = nvgpu_atomic_read(&ch->ref_count);
info->deterministic = (branches & F_CHANNEL_DUMP_DETERMINISTIC) != 0;
info->hw_state.enabled = (branches & F_CHANNEL_DUMP_ENABLED) != 0;
info->hw_state.busy = (branches & F_CHANNEL_DUMP_BUSY) != 0;
info->hw_state.status_string = "fake";
info->sema.addr = branches & F_CHANNEL_DUMP_SEMA ? 0x1000beef : 0;
unit_ctx.count = 0;
gv11b_channel_debug_dump(g, &o, info);
#ifdef CONFIG_DEBUG_FS
unit_assert(unit_ctx.count > 4, goto done);
unit_assert(unit_ctx.err == 0, goto done);
#endif
}
ret = UNIT_SUCCESS;
done:
if (ch) {
nvgpu_channel_close(ch);
}
return ret;
}
struct unit_module_test nvgpu_channel_gv11b_tests[] = {
UNIT_TEST(init_support, test_fifo_init_support, NULL, 0),
UNIT_TEST(unbind, test_gv11b_channel_unbind, NULL, 0),
UNIT_TEST(count, test_gv11b_channel_count, NULL, 0),
UNIT_TEST(read_state, test_gv11b_channel_read_state, NULL, 0),
UNIT_TEST(reset_faulted, test_gv11b_channel_reset_faulted, NULL, 0),
UNIT_TEST(debug_dump, test_gv11b_channel_debug_dump, NULL, 0),
UNIT_TEST(remove_support, test_fifo_remove_support, NULL, 0),
};

View File

@@ -124,31 +124,6 @@ int test_gv11b_channel_read_state(struct unit_module *m,
int test_gv11b_channel_reset_faulted(struct unit_module *m,
struct gk20a *g, void *args);
/**
* Test specification for: test_gv11b_channel_debug_dump
*
* Description: Branch coverage for gv11b_channel_debug_dump
*
* Test Type: Feature
*
* Targets: gops_channel.debug_dump, gv11b_channel_debug_dump
*
* Input: test_fifo_init_support() run for this GPU
*
* Steps:
* - Allocate channel.
* - Build nvgpu_channel_dump_info structure.
* - Call gv11b_channel_debug_output, with all combinations of
* channel deterministic, enabled, busy and sema.
* - If gk20a_debug_output actually calls output function,
* check that length of output string does not exceed buffer
* capacity.
*
* Output: Returns PASS if all branches gave expected results. FAIL otherwise.
*/
int test_gv11b_channel_debug_dump(struct unit_module *m,
struct gk20a *g, void *args);
/**
* @}
*/

View File

@@ -1589,13 +1589,6 @@ static void stub_ramfc_capture_ram_dump(struct gk20a *g,
stub[1].chid = ch->chid;
}
static void stub_channel_debug_dump(struct gk20a *g,
struct nvgpu_debug_context *o,
struct nvgpu_channel_dump_info *info)
{
}
int test_channel_debug_dump(struct unit_module *m, struct gk20a *g, void *vargs)
{
struct nvgpu_channel *ch = NULL;
@@ -1629,7 +1622,6 @@ int test_channel_debug_dump(struct unit_module *m, struct gk20a *g, void *vargs)
g->ops.channel.read_state = stub_channel_read_state;
g->ops.ramfc.capture_ram_dump = stub_ramfc_capture_ram_dump;
g->ops.channel.debug_dump = stub_channel_debug_dump;
for (branches = 0U; branches < F_CHANNEL_DEBUG_DUMP_LAST;
branches++) {