gpu: nvgpu: add timeout error handling

Report a timeout error when fb_mmu_ctrl_r() register doesn't
correctly reflect the tlb invalidate status.

Jira NVGPU-7192

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2603267
(cherry picked from commit b16ed38d087667bc2bddaddde820648d6a931064)
Change-Id: I2360c8741b396b26079438a917770e0bb051c661
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2700042
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Debarshi Dutta
2021-09-30 17:44:53 +05:30
committed by mobile promotions
parent 76cc8870e1
commit 48cd58d332
3 changed files with 13 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2019-2022, 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"),
@@ -73,13 +73,12 @@ int fb_gm20b_tlb_invalidate_test(struct unit_module *m, struct gk20a *g,
nvgpu_writel(g, fb_mmu_ctrl_r(), 1 << 16U);
/*
* Timeout on fb_mmu_ctrl_r read after MMU invalidate (does not return
* a failure)
* Timeout on fb_mmu_ctrl_r read after MMU invalidate.
*/
helper_intercept_mmu_write(0);
err = g->ops.fb.tlb_invalidate(g, &pdb);
if (err != 0) {
unit_return_fail(m, "tlb_invalidate failed (2)\n");
if (err == 0) {
unit_return_fail(m, "tlb_invalidate did not fail as expected (2)\n");
}
/* Success */