gpu: nvgpu: unit: complete tsg coverage

Previous pruning rules in test_tsg_unbind_channel were
skipping the case where both tsg unbind and update runlist
fail.

Modified pruning rules to cover all cases.

Jira NVGPU-4673

Change-Id: I38a63347483252deb83fa079545cead59c7ec594
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master.nvidia.com/r/c/linux-nvgpu/+/2276011
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: Philip Elcan <pelcan@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
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 14:10:14 -05:00
committed by Alex Waterman
parent 2540a98aa4
commit dfc0f3342a

View File

@@ -435,21 +435,6 @@ static int stub_runlist_update_for_channel_EINVAL(
return 0;
}
static bool unbind_pruned(u32 branches, u32 fail)
{
u32 branches_init = branches;
if ((branches & fail) == 0) {
branches &= ~F_TSG_UNBIND_CHANNEL_ABORT_RUNLIST_UPDATE_FAIL;
}
if (branches < branches_init) {
return true;
}
return pruned(branches, fail);
}
int test_tsg_unbind_channel(struct unit_module *m,
struct gk20a *g, void *args)
{
@@ -477,13 +462,22 @@ int test_tsg_unbind_channel(struct unit_module *m,
F_TSG_UNBIND_CHANNEL_RUNLIST_UPDATE_FAIL |
F_TSG_UNBIND_CHANNEL_UNBIND_HAL_FAIL;
for (branches = 0U; branches < F_TSG_UNBIND_CHANNEL_LAST; branches++) {
/*
* do not prune F_TSG_UNBIND_CHANNEL_UNBIND_HAL_FAIL, to
* exercise following abort path.
*/
u32 prune =
F_TSG_UNBIND_CHANNEL_PREEMPT_TSG_FAIL |
F_TSG_UNBIND_CHANNEL_CHECK_HW_STATE_FAIL |
F_TSG_UNBIND_CHANNEL_RUNLIST_UPDATE_FAIL;
if (unbind_pruned(branches, fail)) {
for (branches = 0U; branches < F_TSG_UNBIND_CHANNEL_LAST; branches++) {
if (pruned(branches, prune)) {
unit_verbose(m, "%s branches=%s (pruned)\n", __func__,
branches_str(branches, labels));
continue;
}
subtest_setup(branches);
unit_verbose(m, "%s branches=%s\n", __func__,
branches_str(branches, labels));