mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: unit: handle BUG() calls in page_table
With the use of nvgpu_assert in page_table code, some tests trying to cause failures are now causing calls to BUG() which are now being handled with calls to EXPECT_BUG JIRA NVGPU-677 Change-Id: Ib73055eba307ce00a2515fed19c7c278413bdc43 Signed-off-by: Nicolas Benech <nbenech@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2020600 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Adeel Raza <araza@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
mobile promotions
parent
cb48b30737
commit
9db43bad82
@@ -596,17 +596,23 @@ static int test_nvgpu_gmmu_map_unmap_map_fail(struct unit_module *m,
|
|||||||
static int test_nvgpu_gmmu_init_page_table_fail(struct unit_module *m,
|
static int test_nvgpu_gmmu_init_page_table_fail(struct unit_module *m,
|
||||||
struct gk20a *g, void *args)
|
struct gk20a *g, void *args)
|
||||||
{
|
{
|
||||||
int err;
|
bool success;
|
||||||
struct nvgpu_posix_fault_inj *kmem_fi =
|
struct nvgpu_posix_fault_inj *kmem_fi =
|
||||||
nvgpu_kmem_get_fault_injection();
|
nvgpu_kmem_get_fault_injection();
|
||||||
|
|
||||||
nvgpu_posix_enable_fault_injection(kmem_fi, true, 0);
|
nvgpu_posix_enable_fault_injection(kmem_fi, true, 0);
|
||||||
|
|
||||||
err = nvgpu_gmmu_init_page_table(g->mm.pmu.vm);
|
if (!EXPECT_BUG((void) nvgpu_gmmu_init_page_table(g->mm.pmu.vm))) {
|
||||||
|
unit_err(m, "BUG() was not called as expected\n");
|
||||||
|
success = false;
|
||||||
|
} else {
|
||||||
|
unit_info(m, "Caught expected call to BUG()\n");
|
||||||
|
success = true;
|
||||||
|
}
|
||||||
|
|
||||||
nvgpu_posix_enable_fault_injection(kmem_fi, false, 0);
|
nvgpu_posix_enable_fault_injection(kmem_fi, false, 0);
|
||||||
|
|
||||||
if (err == 0) {
|
if (!success) {
|
||||||
unit_return_fail(m, "init_pt did not fail as expected\n");
|
unit_return_fail(m, "init_pt did not fail as expected\n");
|
||||||
}
|
}
|
||||||
return UNIT_SUCCESS;
|
return UNIT_SUCCESS;
|
||||||
|
|||||||
Reference in New Issue
Block a user